From b932ed3c3d9ed660019e766df39b182952588bd5 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Tue, 25 Nov 2014 00:30:11 +0000 Subject: [PATCH] [PowerPC] Add the 'attn' instruction 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 | 6 ++++++ lib/Target/PowerPC/PPCInstrInfo.td | 2 ++ test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt | 4 ++++ test/MC/PowerPC/ppc64-encoding-ext.s | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/lib/Target/PowerPC/PPCInstrFormats.td b/lib/Target/PowerPC/PPCInstrFormats.td index aa6849744d2..99b266d3365 100644 --- a/lib/Target/PowerPC/PPCInstrFormats.td +++ b/lib/Target/PowerPC/PPCInstrFormats.td @@ -385,6 +385,12 @@ class XForm_tlb xo, dag OOL, dag IOL, string asmstr, let RST = 0; } +class XForm_attn opcode, bits<10> xo, dag OOL, dag IOL, string asmstr, + InstrItinClass itin> + : I { + 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 diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index 8c76c46980d..2ba32a83e66 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -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 // diff --git a/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt b/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt index 3c2f935714e..24d8fd176f1 100644 --- a/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt +++ b/test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt @@ -2274,3 +2274,7 @@ # CHECK: rfid 0x4c 0x00 0x00 0x24 + +# CHECK: attn +0x00 0x00 0x02 0x00 + diff --git a/test/MC/PowerPC/ppc64-encoding-ext.s b/test/MC/PowerPC/ppc64-encoding-ext.s index 0ffe0bf6b7c..41711cdc912 100644 --- a/test/MC/PowerPC/ppc64-encoding-ext.s +++ b/test/MC/PowerPC/ppc64-encoding-ext.s @@ -3633,3 +3633,9 @@ # 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 + -- 2.34.1