Skip to content

Commit fbb0f2d

Browse files
authored
[PowerPC] Implement vector uncompress instructions (#150702)
Implement the set of vector uncompress instructions: * vucmprhh * vucmprlh * vucmprhn * vucmprln * vucmprhb * vucmprlb
1 parent 3e0b91b commit fbb0f2d

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

llvm/lib/Target/PowerPC/PPCInstrFuture.td

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ class VXForm_VRTB5_UIM3<bits<11> xo, bits<2> R, dag OOL, dag IOL, string asmstr,
106106
let Inst{21 -31} = xo;
107107
}
108108

109+
class VXForm_VRTAB5<bits<11> xo, dag OOL, dag IOL, string asmstr,
110+
list<dag> pattern> : I<4, OOL, IOL, asmstr, NoItinerary> {
111+
bits<5> VRT;
112+
bits<5> VRA;
113+
bits<5> VRB;
114+
115+
let Pattern = pattern;
116+
117+
let Inst{6 -10} = VRT;
118+
let Inst{11 -15} = VRA;
119+
let Inst{16 -20} = VRB;
120+
let Inst{21 -31} = xo;
121+
}
122+
109123
let Predicates = [IsISAFuture] in {
110124
defm SUBFUS : XOForm_RTAB5_L1r<31, 72, (outs g8rc:$RT),
111125
(ins g8rc:$RA, g8rc:$RB, u1imm:$L),
@@ -159,4 +173,21 @@ let Predicates = [HasVSX, IsISAFuture] in {
159173
def VUPKINT4TOFP32
160174
: VXForm_VRTB5_UIM3<387, 2, (outs vrrc:$VRT), (ins vrrc:$VRB, u3imm:$UIM),
161175
"vupkint4tofp32 $VRT, $VRB, $UIM", []>;
176+
177+
def VUCMPRHN : VXForm_VRTAB5<3, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
178+
"vucmprhn $VRT, $VRA, $VRB", []>;
179+
def VUCMPRLN : VXForm_VRTAB5<67, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
180+
"vucmprln $VRT, $VRA, $VRB", []>;
181+
def VUCMPRHB
182+
: VXForm_VRTAB5<131, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
183+
"vucmprhb $VRT, $VRA, $VRB", []>;
184+
def VUCMPRLB
185+
: VXForm_VRTAB5<195, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
186+
"vucmprlb $VRT, $VRA, $VRB", []>;
187+
def VUCMPRHH
188+
: VXForm_VRTAB5<259, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
189+
"vucmprhh $VRT, $VRA, $VRB", []>;
190+
def VUCMPRLH
191+
: VXForm_VRTAB5<323, (outs vrrc:$VRT), (ins vrrc:$VRA, vrrc:$VRB),
192+
"vucmprlh $VRT, $VRA, $VRB", []>;
162193
}

llvm/test/MC/Disassembler/PowerPC/ppc-encoding-ISAFuture.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,21 @@
213213

214214
#CHECK: vupkint8tofp32 3, 5, 2
215215
0x10,0x6e,0x29,0x83
216+
217+
#CHECK: vucmprhn 0, 2, 3
218+
0x10,0x02,0x18,0x03
219+
220+
#CHECK: vucmprln 3, 5, 6
221+
0x10,0x65,0x30,0x43
222+
223+
#CHECK: vucmprhb 1, 3, 6
224+
0x10,0x23,0x30,0x83
225+
226+
#CHECK: vucmprlb 2, 4, 5
227+
0x10,0x44,0x28,0xC3
228+
229+
#CHECK: vucmprlh 2, 4, 5
230+
0x10,0x44,0x29,0x43
231+
232+
#CHECK: vucmprhh 1, 3, 6
233+
0x10,0x23,0x31,0x03

llvm/test/MC/Disassembler/PowerPC/ppc64le-encoding-ISAFuture.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,21 @@
207207

208208
#CHECK: vupkint8tofp32 3, 5, 2
209209
0x83,0x29,0x6e,0x10
210+
211+
#CHECK: vucmprhn 0, 2, 3
212+
0x03,0x18,0x02,0x10
213+
214+
#CHECK: vucmprln 3, 5, 6
215+
0x43,0x30,0x65,0x10
216+
217+
#CHECK: vucmprhb 1, 3, 6
218+
0x83,0x30,0x23,0x10
219+
220+
#CHECK: vucmprlb 2, 4, 5
221+
0xC3,0x28,0x44,0x10
222+
223+
#CHECK: vucmprlh 2, 4, 5
224+
0x43,0x29,0x44,0x10
225+
226+
#CHECK: vucmprhh 1, 3, 6
227+
0x03,0x31,0x23,0x10

llvm/test/MC/PowerPC/ppc-encoding-ISAFuture.s

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,27 @@
306306
vupkint8tofp32 3, 5, 2
307307
#CHECK-BE: vupkint8tofp32 3, 5, 2 # encoding: [0x10,0x6e,0x29,0x83]
308308
#CHECK-LE: vupkint8tofp32 3, 5, 2 # encoding: [0x83,0x29,0x6e,0x10]
309+
310+
vucmprhn 0, 2, 3
311+
#CHECK-BE: vucmprhn 0, 2, 3 # encoding: [0x10,0x02,0x18,0x03]
312+
#CHECK-LE: vucmprhn 0, 2, 3 # encoding: [0x03,0x18,0x02,0x10]
313+
314+
vucmprln 3, 5, 6
315+
#CHECK-BE: vucmprln 3, 5, 6 # encoding: [0x10,0x65,0x30,0x43]
316+
#CHECK-LE: vucmprln 3, 5, 6 # encoding: [0x43,0x30,0x65,0x10]
317+
318+
vucmprhb 1, 3, 6
319+
#CHECK-BE: vucmprhb 1, 3, 6 # encoding: [0x10,0x23,0x30,0x83]
320+
#CHECK-LE: vucmprhb 1, 3, 6 # encoding: [0x83,0x30,0x23,0x10]
321+
322+
vucmprlb 2, 4, 5
323+
#CHECK-BE: vucmprlb 2, 4, 5 # encoding: [0x10,0x44,0x28,0xc3]
324+
#CHECK-LE: vucmprlb 2, 4, 5 # encoding: [0xc3,0x28,0x44,0x10]
325+
326+
vucmprlh 2, 4, 5
327+
#CHECK-BE: vucmprlh 2, 4, 5 # encoding: [0x10,0x44,0x29,0x43]
328+
#CHECK-LE: vucmprlh 2, 4, 5 # encoding: [0x43,0x29,0x44,0x10]
329+
330+
vucmprhh 1, 3, 6
331+
#CHECK-BE: vucmprhh 1, 3, 6 # encoding: [0x10,0x23,0x31,0x03]
332+
#CHECK-LE: vucmprhh 1, 3, 6 # encoding: [0x03,0x31,0x23,0x10]

0 commit comments

Comments
 (0)