[llvm] r188288 - ARMv8: SWP and SWPB are obsoleted on ARMv8.
Joey Gouly
joey.gouly at arm.com
Tue Aug 13 09:40:48 PDT 2013
Author: joey
Date: Tue Aug 13 11:40:47 2013
New Revision: 188288
URL: http://llvm.org/viewvc/llvm-project?rev=188288&view=rev
Log:
ARMv8: SWP and SWPB are obsoleted on ARMv8.
Added:
llvm/trunk/test/MC/ARM/obsolete-v8.s
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=188288&r1=188287&r2=188288&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Aug 13 11:40:47 2013
@@ -196,6 +196,8 @@ def HasV7 : Predicate<"Subtar
AssemblerPredicate<"HasV7Ops", "armv7">;
def HasV8 : Predicate<"Subtarget->hasV8Ops()">,
AssemblerPredicate<"HasV8Ops", "armv8">;
+def PreV8 : Predicate<"!Subtarget->hasV8Ops()">,
+ AssemblerPredicate<"!HasV8Ops", "armv7 or earlier">;
def NoVFP : Predicate<"!Subtarget->hasVFP2()">;
def HasVFP2 : Predicate<"Subtarget->hasVFP2()">,
AssemblerPredicate<"FeatureVFP2", "VFP2">;
@@ -4455,9 +4457,11 @@ def : ARMPat<(strex_2 (and GPR:$Rt, 0xff
// SWP/SWPB are deprecated in V6/V7.
let mayLoad = 1, mayStore = 1 in {
def SWP : AIswp<0, (outs GPRnopc:$Rt),
- (ins GPRnopc:$Rt2, addr_offset_none:$addr), "swp", []>;
+ (ins GPRnopc:$Rt2, addr_offset_none:$addr), "swp", []>,
+ Requires<[PreV8]>;
def SWPB: AIswp<1, (outs GPRnopc:$Rt),
- (ins GPRnopc:$Rt2, addr_offset_none:$addr), "swpb", []>;
+ (ins GPRnopc:$Rt2, addr_offset_none:$addr), "swpb", []>,
+ Requires<[PreV8]>;
}
//===----------------------------------------------------------------------===//
Added: llvm/trunk/test/MC/ARM/obsolete-v8.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/obsolete-v8.s?rev=188288&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/obsolete-v8.s (added)
+++ llvm/trunk/test/MC/ARM/obsolete-v8.s Tue Aug 13 11:40:47 2013
@@ -0,0 +1,7 @@
+@ RUN: not llvm-mc -triple=armv8 < %s 2>&1 | FileCheck %s
+
+swp r0, r1, [r2]
+@ CHECK: instruction requires: armv7 or earlier
+
+swpb r0, r1, [r2]
+@ CHECK: instruction requires: armv7 or earlier
More information about the llvm-commits
mailing list