From eb1c5a9862b62fbb20fa52542aef0497ed107f65 Mon Sep 17 00:00:00 2001 From: Stefan Pintilie Date: Tue, 22 Feb 2022 15:17:18 -0600 Subject: [PATCH] [PowerPC] Add the Power10 LXVKQ instrution. Add the Power 10 instruction LXVKQ. This patch was taken from an original patch by: Yi-Hong Lyu Reviewed By: lei Differential Revision: https://reviews.llvm.org/D117507 --- llvm/lib/Target/PowerPC/P10InstrResources.td | 1 + llvm/lib/Target/PowerPC/PPCInstrP10.td | 18 ++++++++++++++++++ .../MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt | 3 +++ llvm/test/MC/PowerPC/ppc64-encoding-ISA31.s | 3 +++ 4 files changed, 25 insertions(+) diff --git a/llvm/lib/Target/PowerPC/P10InstrResources.td b/llvm/lib/Target/PowerPC/P10InstrResources.td index c4f0a24..7aaac73 100644 --- a/llvm/lib/Target/PowerPC/P10InstrResources.td +++ b/llvm/lib/Target/PowerPC/P10InstrResources.td @@ -1625,6 +1625,7 @@ def : InstRW<[P10W_PM_4C, P10W_DISP_ANY, P10PM_Read], (instrs LVSL, LVSR, + LXVKQ, MFVSRLD, MTVSRWS, VCLZLSBB, diff --git a/llvm/lib/Target/PowerPC/PPCInstrP10.td b/llvm/lib/Target/PowerPC/PPCInstrP10.td index 2056532..4a7483c 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrP10.td +++ b/llvm/lib/Target/PowerPC/PPCInstrP10.td @@ -655,6 +655,22 @@ class XForm_AT3 opcode, bits<5> xo2, bits<10> xo, dag OOL, dag IOL, let Inst{31} = 0; } +// X-Form: [ PO T EO UIM XO TX ] +class XForm_XT6_IMM5 opcode, bits<5> eo, bits<10> xo, dag OOL, dag IOL, + string asmstr, InstrItinClass itin, list pattern> + : I { + bits<6> XT; + bits<5> UIM; + + let Pattern = pattern; + + let Inst{6-10} = XT{4-0}; + let Inst{11-15} = eo; + let Inst{16-20} = UIM; + let Inst{21-30} = xo; + let Inst{31} = XT{5}; +} + class XX3Form_AT3_XAB6 opcode, bits<8> xo, dag OOL, dag IOL, string asmstr, InstrItinClass itin, list pattern> @@ -2393,6 +2409,8 @@ let Predicates = [IsISA3_1] in { def XSCVQPSQZ : X_VT5_XO5_VB5<63, 8, 836, "xscvqpsqz", []>; def XSCVUQQP : X_VT5_XO5_VB5<63, 3, 836, "xscvuqqp", []>; def XSCVSQQP : X_VT5_XO5_VB5<63, 11, 836, "xscvsqqp", []>; + def LXVKQ : XForm_XT6_IMM5<60, 31, 360, (outs vsrc:$XT), (ins u5imm:$UIM), + "lxvkq $XT, $UIM", IIC_VecGeneral, []>; } let Predicates = [IsISA3_1, HasVSX] in { diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt index 1ac3c26..730b4b8 100644 --- a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt +++ b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt @@ -364,6 +364,9 @@ # CHECK: xxeval 32, 1, 2, 3, 2 0x05 0x00 0x00 0x02 0x88 0x01 0x10 0xd1 +# CHECK: lxvkq 63, 31 +0xf3 0xff 0xfa 0xd1 + # CHECK: vclzdm 1, 2, 3 0x10 0x22 0x1f 0x84 diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-ISA31.s b/llvm/test/MC/PowerPC/ppc64-encoding-ISA31.s index 27638ae..06c5b49 100644 --- a/llvm/test/MC/PowerPC/ppc64-encoding-ISA31.s +++ b/llvm/test/MC/PowerPC/ppc64-encoding-ISA31.s @@ -528,6 +528,9 @@ # CHECK-LE: xxeval 32, 1, 2, 3, 2 # encoding: [0x02,0x00,0x00,0x05, # CHECK-LE-SAME: 0xd1,0x10,0x01,0x88] xxeval 32, 1, 2, 3, 2 +# CHECK-BE: lxvkq 63, 31 # encoding: [0xf3,0xff,0xfa,0xd1] +# CHECK-LE: lxvkq 63, 31 # encoding: [0xd1,0xfa,0xff,0xf3] + lxvkq 63, 31 # CHECK-BE: vclzdm 1, 2, 3 # encoding: [0x10,0x22,0x1f,0x84] # CHECK-LE: vclzdm 1, 2, 3 # encoding: [0x84,0x1f,0x22,0x10] vclzdm 1, 2, 3 -- 2.7.4