diff options
author | Ahsan Saghir <saghir.ibm@gmail.com> | 2020-05-22 14:35:13 -0500 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2020-06-22 14:58:57 -0700 |
commit | 3428405fc4ec18b566d64bb1478acd631ccd40f4 (patch) | |
tree | bc103ae5a5d09f2b6762d22195b0f2069412b16d | |
parent | 6f71678ecd293c35435f7f3f313bdaf337ed798a (diff) | |
download | bcm5719-llvm-3428405fc4ec18b566d64bb1478acd631ccd40f4.tar.gz bcm5719-llvm-3428405fc4ec18b566d64bb1478acd631ccd40f4.zip |
[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 a28e9f1208608f8d18750bb88ca74722fb0bcce4)
-rw-r--r-- | llvm/include/llvm/IR/IntrinsicsPowerPC.td | 3 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/P9InstrResources.td | 1 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrAltivec.td | 4 | ||||
-rw-r--r-- | llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt | 3 | ||||
-rw-r--r-- | llvm/test/MC/PowerPC/ppc64-encoding-vmx.s | 3 |
5 files changed, 14 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/IntrinsicsPowerPC.td b/llvm/include/llvm/IR/IntrinsicsPowerPC.td index f8731744575..fc9fa2153ae 100644 --- a/llvm/include/llvm/IR/IntrinsicsPowerPC.td +++ b/llvm/include/llvm/IR/IntrinsicsPowerPC.td @@ -488,6 +488,9 @@ let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". def int_ppc_altivec_vmsumuhm : GCCBuiltin<"__builtin_altivec_vmsumuhm">, Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty], [IntrNoMem]>; + def int_ppc_altivec_vmsumudm : GCCBuiltin<"__builtin_altivec_vmsumudm">, + Intrinsic<[llvm_v1i128_ty], [llvm_v2i64_ty, llvm_v2i64_ty, + llvm_v1i128_ty], [IntrNoMem]>; def int_ppc_altivec_vmsumuhs : GCCBuiltin<"__builtin_altivec_vmsumuhs">, Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty], [IntrNoMem]>; diff --git a/llvm/lib/Target/PowerPC/P9InstrResources.td b/llvm/lib/Target/PowerPC/P9InstrResources.td index 9b3d13989ee..d7e3519d553 100644 --- a/llvm/lib/Target/PowerPC/P9InstrResources.td +++ b/llvm/lib/Target/PowerPC/P9InstrResources.td @@ -373,6 +373,7 @@ def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C], VMSUMSHS, VMSUMUBM, VMSUMUHM, + VMSUMUDM, VMSUMUHS, VMULESB, VMULESH, diff --git a/llvm/lib/Target/PowerPC/PPCInstrAltivec.td b/llvm/lib/Target/PowerPC/PPCInstrAltivec.td index f94816a35f7..6e8635f2413 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrAltivec.td +++ b/llvm/lib/Target/PowerPC/PPCInstrAltivec.td @@ -1342,6 +1342,10 @@ def VSBOX : VXBX_Int_Ty<1480, "vsbox", int_ppc_altivec_crypto_vsbox, v2i64>; def HasP9Altivec : Predicate<"PPCSubTarget->hasP9Altivec()">; let Predicates = [HasP9Altivec] in { +// Vector Multiply-Sum +def VMSUMUDM : VA1a_Int_Ty3<35, "vmsumudm", int_ppc_altivec_vmsumudm, + v1i128, v2i64, v1i128>; + // i8 element comparisons. def VCMPNEB : VCMP < 7, "vcmpneb $vD, $vA, $vB" , v16i8>; def VCMPNEB_rec : VCMPo < 7, "vcmpneb. $vD, $vA, $vB" , v16i8>; diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt index cb43a7c479a..4780c3a4fae 100644 --- a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt +++ b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt @@ -333,6 +333,9 @@ # CHECK: vmsumuhm 2, 3, 4, 5 0x10 0x43 0x21 0x66 +# CHECK: vmsumudm 2, 3, 4, 5 +0x10 0x43 0x21 0x63 + # CHECK: vmsumuhs 2, 3, 4, 5 0x10 0x43 0x21 0x67 diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-vmx.s b/llvm/test/MC/PowerPC/ppc64-encoding-vmx.s index 62851e4082d..b2b7b3d9d6a 100644 --- a/llvm/test/MC/PowerPC/ppc64-encoding-vmx.s +++ b/llvm/test/MC/PowerPC/ppc64-encoding-vmx.s @@ -366,6 +366,9 @@ # CHECK-BE: vmsumuhm 2, 3, 4, 5 # encoding: [0x10,0x43,0x21,0x66] # CHECK-LE: vmsumuhm 2, 3, 4, 5 # encoding: [0x66,0x21,0x43,0x10] vmsumuhm 2, 3, 4, 5 +# CHECK-BE: vmsumudm 2, 3, 4, 5 # encoding: [0x10,0x43,0x21,0x63] +# CHECK-LE: vmsumudm 2, 3, 4, 5 # encoding: [0x63,0x21,0x43,0x10] + vmsumudm 2, 3, 4, 5 # CHECK-BE: vmsumuhs 2, 3, 4, 5 # encoding: [0x10,0x43,0x21,0x67] # CHECK-LE: vmsumuhs 2, 3, 4, 5 # encoding: [0x67,0x21,0x43,0x10] vmsumuhs 2, 3, 4, 5 |