[PowerPC] Add the 'attn' instruction
authorHal Finkel <hfinkel@anl.gov>
Tue, 25 Nov 2014 00:30:11 +0000 (00:30 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 25 Nov 2014 00:30:11 +0000 (00:30 +0000)
The attn instruction is not part of the Power ISA, but is documented in the A2
user manual, and is accepted by the GNU assembler for the A2 and the POWER4+.
Reported as part of PR21650.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222712 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCInstrFormats.td
lib/Target/PowerPC/PPCInstrInfo.td
test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt
test/MC/PowerPC/ppc64-encoding-ext.s

index aa6849744d248f7ec3616d27b59c2f108e373cf0..99b266d336549e4b53c92e86beca73863529a715 100644 (file)
@@ -385,6 +385,12 @@ class XForm_tlb<bits<10> xo, dag OOL, dag IOL, string asmstr,
   let RST = 0;
 }
 
+class XForm_attn<bits<6> opcode, bits<10> xo, dag OOL, dag IOL, string asmstr,
+                 InstrItinClass itin>
+  : I<opcode, OOL, IOL, asmstr, itin> {
+  let Inst{21-30} = xo;
+}
+
 // This is the same as XForm_base_r3xo, but the first two operands are swapped
 // when code is emitted.
 class XForm_base_r3xo_swapped
index 8c76c46980d8b3988e30eceabf4f22b42a213c4a..2ba32a83e66847e03ef452ca7fe7939de667bc1c 100644 (file)
@@ -3232,6 +3232,8 @@ def MFDCR : XFXForm_1<31, 323, (outs gprc:$RT), (ins i32imm:$SPR),
 def MTDCR : XFXForm_1<31, 451, (outs), (ins gprc:$RT, i32imm:$SPR),
                       "mtdcr $SPR, $RT", IIC_SprMTSPR>, Requires<[IsPPC4xx]>;
 
+def ATTN : XForm_attn<0, 256, (outs), (ins), "attn", IIC_BrB>;
+
 //===----------------------------------------------------------------------===//
 // PowerPC Assembler Instruction Aliases
 //
index 3c2f935714e81688b4fe402e680b402cb3af7376..24d8fd176f15cb92fd3800b15134c365c1a27061 100644 (file)
 
 # CHECK: rfid
 0x4c 0x00 0x00 0x24
+
+# CHECK: attn
+0x00 0x00 0x02 0x00
+
index 0ffe0bf6b7c23b15d0c7488468718ad2398f408a..41711cdc912bb897d2f160081c96f1b46c58f95b 100644 (file)
 # CHECK-BE: mtspr 280, 2                     # encoding: [0x7c,0x58,0x43,0xa6]
 # CHECK-LE: mtspr 280, 2                     # encoding: [0xa6,0x43,0x58,0x7c]
             mtasr 2
+
+# Processor-Specific Instructions
+# CHECK-BE: attn                             # encoding: [0x00,0x00,0x02,0x00]
+# CHECK-LE: attn                             # encoding: [0x00,0x02,0x00,0x00]
+            attn
+