Skip to content

Commit 3428405

Browse files
ahsansaghirtstellar
authored andcommitted
[PowerPC] Add support for vmsumudm
This patch adds support for Vector Multiply-Sum Unsigned Doubleword Modulo instruction; vmsumudm. Differential Revision: https://reviews.llvm.org/D80294 (cherry picked from commit a28e9f1)
1 parent 6f71678 commit 3428405

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

llvm/include/llvm/IR/IntrinsicsPowerPC.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.".
488488
def int_ppc_altivec_vmsumuhm : GCCBuiltin<"__builtin_altivec_vmsumuhm">,
489489
Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
490490
llvm_v4i32_ty], [IntrNoMem]>;
491+
def int_ppc_altivec_vmsumudm : GCCBuiltin<"__builtin_altivec_vmsumudm">,
492+
Intrinsic<[llvm_v1i128_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
493+
llvm_v1i128_ty], [IntrNoMem]>;
491494
def int_ppc_altivec_vmsumuhs : GCCBuiltin<"__builtin_altivec_vmsumuhs">,
492495
Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
493496
llvm_v4i32_ty], [IntrNoMem]>;

llvm/lib/Target/PowerPC/P9InstrResources.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
373373
VMSUMSHS,
374374
VMSUMUBM,
375375
VMSUMUHM,
376+
VMSUMUDM,
376377
VMSUMUHS,
377378
VMULESB,
378379
VMULESH,

llvm/lib/Target/PowerPC/PPCInstrAltivec.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,10 @@ def VSBOX : VXBX_Int_Ty<1480, "vsbox", int_ppc_altivec_crypto_vsbox, v2i64>;
13421342
def HasP9Altivec : Predicate<"PPCSubTarget->hasP9Altivec()">;
13431343
let Predicates = [HasP9Altivec] in {
13441344

1345+
// Vector Multiply-Sum
1346+
def VMSUMUDM : VA1a_Int_Ty3<35, "vmsumudm", int_ppc_altivec_vmsumudm,
1347+
v1i128, v2i64, v1i128>;
1348+
13451349
// i8 element comparisons.
13461350
def VCMPNEB : VCMP < 7, "vcmpneb $vD, $vA, $vB" , v16i8>;
13471351
def VCMPNEB_rec : VCMPo < 7, "vcmpneb. $vD, $vA, $vB" , v16i8>;

llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@
333333
# CHECK: vmsumuhm 2, 3, 4, 5
334334
0x10 0x43 0x21 0x66
335335

336+
# CHECK: vmsumudm 2, 3, 4, 5
337+
0x10 0x43 0x21 0x63
338+
336339
# CHECK: vmsumuhs 2, 3, 4, 5
337340
0x10 0x43 0x21 0x67
338341

llvm/test/MC/PowerPC/ppc64-encoding-vmx.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@
366366
# CHECK-BE: vmsumuhm 2, 3, 4, 5 # encoding: [0x10,0x43,0x21,0x66]
367367
# CHECK-LE: vmsumuhm 2, 3, 4, 5 # encoding: [0x66,0x21,0x43,0x10]
368368
vmsumuhm 2, 3, 4, 5
369+
# CHECK-BE: vmsumudm 2, 3, 4, 5 # encoding: [0x10,0x43,0x21,0x63]
370+
# CHECK-LE: vmsumudm 2, 3, 4, 5 # encoding: [0x63,0x21,0x43,0x10]
371+
vmsumudm 2, 3, 4, 5
369372
# CHECK-BE: vmsumuhs 2, 3, 4, 5 # encoding: [0x10,0x43,0x21,0x67]
370373
# CHECK-LE: vmsumuhs 2, 3, 4, 5 # encoding: [0x67,0x21,0x43,0x10]
371374
vmsumuhs 2, 3, 4, 5

0 commit comments

Comments
 (0)