Disallow YIELD and other allocated nop hints in pre-ARMv6 architectures.
authorRichard Barton <richard.barton@arm.com>
Wed, 2 May 2012 09:43:18 +0000 (09:43 +0000)
committerRichard Barton <richard.barton@arm.com>
Wed, 2 May 2012 09:43:18 +0000 (09:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155983 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrThumb.td
test/MC/ARM/basic-thumb-instructions.s
test/MC/ARM/thumb-diagnostics.s
test/MC/ARM/thumb.s
test/MC/Disassembler/ARM/thumb1.txt

index 15cb9fa5d2bdc313e751dd6b05c207a48e9ec380..fe553c215025bd15ba9ff2f9504012a1e7507d8a 100644 (file)
@@ -258,16 +258,20 @@ def tNOP : T1pI<(outs), (ins), NoItinerary, "nop", "", []>,
         Requires<[IsThumb2]>;
 
 def tYIELD : T1pI<(outs), (ins), NoItinerary, "yield", "", []>,
-           T1SystemEncoding<0x10>; // A8.6.410
+           T1SystemEncoding<0x10>, // A8.6.410
+           Requires<[IsThumb2]>;
 
 def tWFE : T1pI<(outs), (ins), NoItinerary, "wfe", "", []>,
-           T1SystemEncoding<0x20>; // A8.6.408
+           T1SystemEncoding<0x20>, // A8.6.408
+           Requires<[IsThumb2]>;
 
 def tWFI : T1pI<(outs), (ins), NoItinerary, "wfi", "", []>,
-           T1SystemEncoding<0x30>; // A8.6.409
+           T1SystemEncoding<0x30>, // A8.6.409
+           Requires<[IsThumb2]>;
 
 def tSEV : T1pI<(outs), (ins), NoItinerary, "sev", "", []>,
-           T1SystemEncoding<0x40>; // A8.6.157
+           T1SystemEncoding<0x40>, // A8.6.157
+           Requires<[IsThumb2]>;
 
 // The imm operand $val can be used by a debugger to store more information
 // about the breakpoint.
index bc2605c16ec91e36bef8a8bb81b25a200f5364d1..231b3338e4ed26be1be2a22458210576c24ecf90 100644 (file)
@@ -635,13 +635,3 @@ _func:
 @ CHECK: uxth  r1, r4                  @ encoding: [0xa1,0xb2]
 
 
-@------------------------------------------------------------------------------
-@ WFE/WFI/YIELD
-@------------------------------------------------------------------------------
-        wfe
-        wfi
-        yield
-
-@ CHECK: wfe                             @ encoding: [0x20,0xbf]
-@ CHECK: wfi                             @ encoding: [0x30,0xbf]
-@ CHECK: yield                           @ encoding: [0x10,0xbf]
index 0902f4e6fb3de5b56dc6cc9c5fee973865287b18..6f822d1c8e8ad7addc4e4d41cbcff4e269a03a6b 100644 (file)
@@ -138,3 +138,21 @@ error: invalid operand for instruction
 @ CHECK-ERRORS: error: source register must be the same as destination
 @ CHECK-ERRORS:         add r2, sp, ip
 @ CHECK-ERRORS:                     ^
+@------------------------------------------------------------------------------
+@ WFE/WFI/YIELD - are not supported pre v6T2
+@------------------------------------------------------------------------------
+        wfe
+        wfi
+        yield
+
+@ CHECK-ERRORS: error: instruction requires: thumb2
+@ CHECK-ERRORS: wfe
+@ CHECK-ERRORS: ^
+@ CHECK-ERRORS: error: instruction requires: thumb2
+@ CHECK-ERRORS: wfi
+@ CHECK-ERRORS: ^
+@ CHECK-ERRORS: error: instruction requires: thumb2
+@ CHECK-ERRORS: yield
+@ CHECK-ERRORS: ^
+
index 625882c737fb574f0209a487aaa708df2a3823d5..2223bdcd46735716cab5f398e81acbe83174015c 100644 (file)
         nop
 @ CHECK: nop @ encoding: [0xc0,0x46]
 
-        wfe
-        wfi
-        yield
-@ CHECK: wfe                            @ encoding: [0x20,0xbf]
-@ CHECK: wfi                            @ encoding: [0x30,0xbf]
-@ CHECK: yield                          @ encoding: [0x10,0xbf]
-
         cpsie aif
 @ CHECK: cpsie aif                      @ encoding: [0x67,0xb6]
 
index 17c4bad239ef7821b38c47ae754e314f77f7af97..825b2be9150d632d95e962a904830d3b9185dcaf 100644 (file)
 
 0xd7 0xb2
 0xa1 0xb2
-
-
-#------------------------------------------------------------------------------
-# WFE/WFI/YIELD
-#------------------------------------------------------------------------------
-# CHECK: wfe
-# CHECK: wfi
-# CHECK: yield
-
-0x20 0xbf
-0x30 0xbf
-0x10 0xbf