From 64a0af292884ce2aff07b741cf47de4a43b7b51b Mon Sep 17 00:00:00 2001 From: Ayman Musa Date: Thu, 22 Dec 2016 08:42:46 +0000 Subject: [PATCH] [X86][AVX2] Passing the appropriate memory operand class to VPMADDWD instruction. Replacing the memory operand in the ymm version of VPMADDWD from i128mem to i256mem. Differential Revision: https://reviews.llvm.org/D28024 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290333 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 2 +- test/MC/X86/intel-syntax-x86-64-avx.s | 56 ++++++++++++++++++++++++++ test/MC/X86/x86_64-avx-encoding.s | 58 +++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 4e9c72587e1..9d6a8936304 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -3952,7 +3952,7 @@ defm VPMADDWD : PDI_binop_rm2<0xF5, "vpmaddwd", X86vpmaddwd, v4i32, v8i16, VR128 let Predicates = [HasAVX2, NoVLX_Or_NoBWI] in defm VPMADDWDY : PDI_binop_rm2<0xF5, "vpmaddwd", X86vpmaddwd, v8i32, v16i16, - VR256, loadv4i64, i128mem, SSE_PMADD, + VR256, loadv4i64, i256mem, SSE_PMADD, 0>, VEX_4V, VEX_L; let Constraints = "$src1 = $dst" in defm PMADDWD : PDI_binop_rm2<0xF5, "pmaddwd", X86vpmaddwd, v4i32, v8i16, VR128, diff --git a/test/MC/X86/intel-syntax-x86-64-avx.s b/test/MC/X86/intel-syntax-x86-64-avx.s index 3139fc431ae..3fdb758b0a0 100644 --- a/test/MC/X86/intel-syntax-x86-64-avx.s +++ b/test/MC/X86/intel-syntax-x86-64-avx.s @@ -159,3 +159,59 @@ // CHECK: vcvttpd2dq xmm0, ymmword ptr [rax] // CHECK: encoding: [0xc5,0xfd,0xe6,0x00] vcvttpd2dqy xmm0, ymmword ptr [rax] + +// CHECK: vpmaddwd xmm1, xmm2, xmm3 +// CHECK: encoding: [0xc5,0xe9,0xf5,0xcb] + vpmaddwd xmm1, xmm2, xmm3 + +// CHECK: vpmaddwd xmm1, xmm2, xmmword ptr [rcx] +// CHECK: encoding: [0xc5,0xe9,0xf5,0x09] + vpmaddwd xmm1, xmm2, xmmword ptr [rcx] + +// CHECK: vpmaddwd xmm1, xmm2, xmmword ptr [rsp - 4] +// CHECK: encoding: [0xc5,0xe9,0xf5,0x4c,0x24,0xfc] + vpmaddwd xmm1, xmm2, xmmword ptr [rsp - 4] + +// CHECK: vpmaddwd xmm1, xmm2, xmmword ptr [rsp + 4] +// CHECK: encoding: [0xc5,0xe9,0xf5,0x4c,0x24,0x04] + vpmaddwd xmm1, xmm2, xmmword ptr [rsp + 4] + +// CHECK: vpmaddwd xmm1, xmm2, xmmword ptr [rcx + 8*r14 + 268435456] +// CHECK: encoding: [0xc4,0xa1,0x69,0xf5,0x8c,0xf1,0x00,0x00,0x00,0x10] + vpmaddwd xmm1, xmm2, xmmword ptr [rcx + 8*r14 + 268435456] + +// CHECK: vpmaddwd xmm1, xmm2, xmmword ptr [rcx + 8*r14 - 536870912] +// CHECK: encoding: [0xc4,0xa1,0x69,0xf5,0x8c,0xf1,0x00,0x00,0x00,0xe0] + vpmaddwd xmm1, xmm2, xmmword ptr [rcx + 8*r14 - 536870912] + +// CHECK: vpmaddwd xmm1, xmm2, xmmword ptr [rcx + 8*r14 - 536870910] +// CHECK: encoding: [0xc4,0xa1,0x69,0xf5,0x8c,0xf1,0x02,0x00,0x00,0xe0] + vpmaddwd xmm1, xmm2, xmmword ptr [rcx + 8*r14 - 536870910] + +// CHECK: vpmaddwd ymm1, ymm2, ymm3 +// CHECK: encoding: [0xc5,0xed,0xf5,0xcb] + vpmaddwd ymm1, ymm2, ymm3 + +// CHECK: vpmaddwd ymm1, ymm2, ymmword ptr [rcx] +// CHECK: encoding: [0xc5,0xed,0xf5,0x09] + vpmaddwd ymm1, ymm2, ymmword ptr [rcx] + +// CHECK: vpmaddwd ymm1, ymm2, ymmword ptr [rsp - 4] +// CHECK: encoding: [0xc5,0xed,0xf5,0x4c,0x24,0xfc] + vpmaddwd ymm1, ymm2, ymmword ptr [rsp - 4] + +// CHECK: vpmaddwd ymm1, ymm2, ymmword ptr [rsp + 4] +// CHECK: encoding: [0xc5,0xed,0xf5,0x4c,0x24,0x04] + vpmaddwd ymm1, ymm2, ymmword ptr [rsp + 4] + +// CHECK: vpmaddwd ymm1, ymm2, ymmword ptr [rcx + 8*r14 + 268435456] +// CHECK: encoding: [0xc4,0xa1,0x6d,0xf5,0x8c,0xf1,0x00,0x00,0x00,0x10] + vpmaddwd ymm1, ymm2, ymmword ptr [rcx + 8*r14 + 268435456] + +// CHECK: vpmaddwd ymm1, ymm2, ymmword ptr [rcx + 8*r14 - 536870912] +// CHECK: encoding: [0xc4,0xa1,0x6d,0xf5,0x8c,0xf1,0x00,0x00,0x00,0xe0] + vpmaddwd ymm1, ymm2, ymmword ptr [rcx + 8*r14 - 536870912] + +// CHECK: vpmaddwd ymm1, ymm2, ymmword ptr [rcx + 8*r14 - 536870910] +// CHECK: encoding: [0xc4,0xa1,0x6d,0xf5,0x8c,0xf1,0x02,0x00,0x00,0xe0] + vpmaddwd ymm1, ymm2, ymmword ptr [rcx + 8*r14 - 536870910] diff --git a/test/MC/X86/x86_64-avx-encoding.s b/test/MC/X86/x86_64-avx-encoding.s index b9367d9d1f6..221629aa6a3 100644 --- a/test/MC/X86/x86_64-avx-encoding.s +++ b/test/MC/X86/x86_64-avx-encoding.s @@ -4245,3 +4245,61 @@ _foo2: // CHECK: vmovsd %xmm8, %xmm0, %xmm0 // CHECK: encoding: [0xc5,0x7b,0x11,0xc0] vmovsd %xmm8, %xmm0, %xmm0 + +// CHECK: vpmaddwd %xmm3, %xmm2, %xmm1 +// CHECK: encoding: [0xc5,0xe9,0xf5,0xcb] + vpmaddwd %xmm3, %xmm2, %xmm1 + +// CHECK: vpmaddwd (%rcx), %xmm2, %xmm1 +// CHECK: encoding: [0xc5,0xe9,0xf5,0x09] + vpmaddwd (%rcx), %xmm2, %xmm1 + +// CHECK: vpmaddwd -4(%rsp), %xmm2, %xmm1 +// CHECK: encoding: [0xc5,0xe9,0xf5,0x4c,0x24,0xfc] + vpmaddwd -4(%rsp), %xmm2, %xmm1 + +// CHECK: vpmaddwd 4(%rsp), %xmm2, %xmm1 +// CHECK: encoding: [0xc5,0xe9,0xf5,0x4c,0x24,0x04] + vpmaddwd 4(%rsp), %xmm2, %xmm1 + +// CHECK: vpmaddwd 268435456(%rcx,%r14,8), %xmm2, %xmm1 +// CHECK: encoding: [0xc4,0xa1,0x69,0xf5,0x8c,0xf1,0x00,0x00,0x00,0x10] + vpmaddwd 268435456(%rcx,%r14,8), %xmm2, %xmm1 + +// CHECK: vpmaddwd -536870912(%rcx,%r14,8), %xmm2, %xmm1 +// CHECK: encoding: [0xc4,0xa1,0x69,0xf5,0x8c,0xf1,0x00,0x00,0x00,0xe0] + vpmaddwd -536870912(%rcx,%r14,8), %xmm2, %xmm1 + +// CHECK: vpmaddwd -536870910(%rcx,%r14,8), %xmm2, %xmm1 +// CHECK: encoding: [0xc4,0xa1,0x69,0xf5,0x8c,0xf1,0x02,0x00,0x00,0xe0] + vpmaddwd -536870910(%rcx,%r14,8), %xmm2, %xmm1 + +// CHECK: vpmaddwd %ymm3, %ymm2, %ymm1 +// CHECK: encoding: [0xc5,0xed,0xf5,0xcb] + vpmaddwd %ymm3, %ymm2, %ymm1 + +// CHECK: vpmaddwd (%rcx), %ymm2, %ymm1 +// CHECK: encoding: [0xc5,0xed,0xf5,0x09] + vpmaddwd (%rcx), %ymm2, %ymm1 + +// CHECK: vpmaddwd -4(%rsp), %ymm2, %ymm1 +// CHECK: encoding: [0xc5,0xed,0xf5,0x4c,0x24,0xfc] + vpmaddwd -4(%rsp), %ymm2, %ymm1 + +// CHECK: vpmaddwd 4(%rsp), %ymm2, %ymm1 +// CHECK: encoding: [0xc5,0xed,0xf5,0x4c,0x24,0x04] + vpmaddwd 4(%rsp), %ymm2, %ymm1 + +// CHECK: vpmaddwd 268435456(%rcx,%r14,8), %ymm2, %ymm1 +// CHECK: encoding: [0xc4,0xa1,0x6d,0xf5,0x8c,0xf1,0x00,0x00,0x00,0x10] + vpmaddwd 268435456(%rcx,%r14,8), %ymm2, %ymm1 + +// CHECK: vpmaddwd -536870912(%rcx,%r14,8), %ymm2, %ymm1 +// CHECK: encoding: [0xc4,0xa1,0x6d,0xf5,0x8c,0xf1,0x00,0x00,0x00,0xe0] + vpmaddwd -536870912(%rcx,%r14,8), %ymm2, %ymm1 + +// CHECK: vpmaddwd -536870910(%rcx,%r14,8), %ymm2, %ymm1 +// CHECK: encoding: [0xc4,0xa1,0x6d,0xf5,0x8c,0xf1,0x02,0x00,0x00,0xe0] + vpmaddwd -536870910(%rcx,%r14,8), %ymm2, %ymm1 + +