[llvm-commits] [llvm] r108984 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Tue Jul 20 20:07:42 PDT 2010
Author: bruno
Date: Tue Jul 20 22:07:42 2010
New Revision: 108984
URL: http://llvm.org/viewvc/llvm-project?rev=108984&view=rev
Log:
Add new AVX vpermilps, vpermilpd and vperm2f128 instructions
Modified:
llvm/trunk/lib/Target/X86/X86InstrSSE.td
llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s
llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s
Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=108984&r1=108983&r2=108984&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 20 22:07:42 2010
@@ -5041,4 +5041,39 @@
defm VMASKMOVPS : avx_movmask_rm<0x2C, 0x2E, "vmaskmovps">;
defm VMASKMOVPD : avx_movmask_rm<0x2D, 0x2F, "vmaskmovpd">;
+// Permute Floating-Point Values
+multiclass avx_permil<bits<8> opc_rm, bits<8> opc_rmi, string OpcodeStr,
+ RegisterClass RC, X86MemOperand x86memop> {
+ def rr : AVX8I<opc_rm, MRMSrcReg, (outs RC:$dst),
+ (ins RC:$src1, RC:$src2),
+ !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
+ []>, VEX_4V;
+ def rm : AVX8I<opc_rm, MRMSrcMem, (outs RC:$dst),
+ (ins RC:$src1, x86memop:$src2),
+ !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
+ []>, VEX_4V;
+ def ri : AVXAIi8<opc_rmi, MRMSrcReg, (outs RC:$dst),
+ (ins RC:$src1, i8imm:$src2),
+ !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
+ []>, VEX;
+ def mi : AVXAIi8<opc_rmi, MRMSrcMem, (outs RC:$dst),
+ (ins x86memop:$src1, i8imm:$src2),
+ !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
+ []>, VEX;
+}
+
+defm VPERMILPS : avx_permil<0x0C, 0x04, "vpermilps", VR128, f128mem>;
+defm VPERMILPSY : avx_permil<0x0C, 0x04, "vpermilps", VR256, f256mem>;
+defm VPERMILPD : avx_permil<0x0D, 0x05, "vpermilpd", VR128, f128mem>;
+defm VPERMILPDY : avx_permil<0x0D, 0x05, "vpermilpd", VR256, f256mem>;
+
+def VPERM2F128rr : AVXAIi8<0x06, MRMSrcReg, (outs VR256:$dst),
+ (ins VR256:$src1, VR256:$src2, i8imm:$src3),
+ "vperm2f128\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}",
+ []>, VEX_4V;
+def VPERM2F128rm : AVXAIi8<0x06, MRMSrcMem, (outs VR256:$dst),
+ (ins VR256:$src1, f256mem:$src2, i8imm:$src3),
+ "vperm2f128\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}",
+ []>, VEX_4V;
+
} // isAsmParserOnly
Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=108984&r1=108983&r2=108984&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 20 22:07:42 2010
@@ -13062,3 +13062,75 @@
// CHECK: encoding: [0xc4,0xe2,0x6d,0x2c,0x28]
vmaskmovps (%eax), %ymm2, %ymm5
+// CHECK: vpermilps $7, %xmm1, %xmm5
+// CHECK: encoding: [0xc4,0xe3,0x79,0x04,0xe9,0x07]
+ vpermilps $7, %xmm1, %xmm5
+
+// CHECK: vpermilps $7, %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe3,0x7d,0x04,0xcd,0x07]
+ vpermilps $7, %ymm5, %ymm1
+
+// CHECK: vpermilps $7, (%eax), %xmm5
+// CHECK: encoding: [0xc4,0xe3,0x79,0x04,0x28,0x07]
+ vpermilps $7, (%eax), %xmm5
+
+// CHECK: vpermilps $7, (%eax), %ymm5
+// CHECK: encoding: [0xc4,0xe3,0x7d,0x04,0x28,0x07]
+ vpermilps $7, (%eax), %ymm5
+
+// CHECK: vpermilps %xmm1, %xmm5, %xmm1
+// CHECK: encoding: [0xc4,0xe2,0x51,0x0c,0xc9]
+ vpermilps %xmm1, %xmm5, %xmm1
+
+// CHECK: vpermilps %ymm1, %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe2,0x55,0x0c,0xc9]
+ vpermilps %ymm1, %ymm5, %ymm1
+
+// CHECK: vpermilps (%eax), %xmm5, %xmm3
+// CHECK: encoding: [0xc4,0xe2,0x51,0x0c,0x18]
+ vpermilps (%eax), %xmm5, %xmm3
+
+// CHECK: vpermilps (%eax), %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe2,0x55,0x0c,0x08]
+ vpermilps (%eax), %ymm5, %ymm1
+
+// CHECK: vpermilpd $7, %xmm1, %xmm5
+// CHECK: encoding: [0xc4,0xe3,0x79,0x05,0xe9,0x07]
+ vpermilpd $7, %xmm1, %xmm5
+
+// CHECK: vpermilpd $7, %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe3,0x7d,0x05,0xcd,0x07]
+ vpermilpd $7, %ymm5, %ymm1
+
+// CHECK: vpermilpd $7, (%eax), %xmm5
+// CHECK: encoding: [0xc4,0xe3,0x79,0x05,0x28,0x07]
+ vpermilpd $7, (%eax), %xmm5
+
+// CHECK: vpermilpd $7, (%eax), %ymm5
+// CHECK: encoding: [0xc4,0xe3,0x7d,0x05,0x28,0x07]
+ vpermilpd $7, (%eax), %ymm5
+
+// CHECK: vpermilpd %xmm1, %xmm5, %xmm1
+// CHECK: encoding: [0xc4,0xe2,0x51,0x0d,0xc9]
+ vpermilpd %xmm1, %xmm5, %xmm1
+
+// CHECK: vpermilpd %ymm1, %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe2,0x55,0x0d,0xc9]
+ vpermilpd %ymm1, %ymm5, %ymm1
+
+// CHECK: vpermilpd (%eax), %xmm5, %xmm3
+// CHECK: encoding: [0xc4,0xe2,0x51,0x0d,0x18]
+ vpermilpd (%eax), %xmm5, %xmm3
+
+// CHECK: vpermilpd (%eax), %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe2,0x55,0x0d,0x08]
+ vpermilpd (%eax), %ymm5, %ymm1
+
+// CHECK: vperm2f128 $7, %ymm2, %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe3,0x55,0x06,0xca,0x07]
+ vperm2f128 $7, %ymm2, %ymm5, %ymm1
+
+// CHECK: vperm2f128 $7, (%eax), %ymm5, %ymm1
+// CHECK: encoding: [0xc4,0xe3,0x55,0x06,0x08,0x07]
+ vperm2f128 $7, (%eax), %ymm5, %ymm1
+
Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=108984&r1=108983&r2=108984&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 20 22:07:42 2010
@@ -3136,3 +3136,75 @@
// CHECK: encoding: [0xc4,0x62,0x1d,0x2c,0x10]
vmaskmovps (%rax), %ymm12, %ymm10
+// CHECK: vpermilps $7, %xmm11, %xmm10
+// CHECK: encoding: [0xc4,0x43,0x79,0x04,0xd3,0x07]
+ vpermilps $7, %xmm11, %xmm10
+
+// CHECK: vpermilps $7, %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x43,0x7d,0x04,0xda,0x07]
+ vpermilps $7, %ymm10, %ymm11
+
+// CHECK: vpermilps $7, (%rax), %xmm10
+// CHECK: encoding: [0xc4,0x63,0x79,0x04,0x10,0x07]
+ vpermilps $7, (%rax), %xmm10
+
+// CHECK: vpermilps $7, (%rax), %ymm10
+// CHECK: encoding: [0xc4,0x63,0x7d,0x04,0x10,0x07]
+ vpermilps $7, (%rax), %ymm10
+
+// CHECK: vpermilps %xmm11, %xmm10, %xmm11
+// CHECK: encoding: [0xc4,0x42,0x29,0x0c,0xdb]
+ vpermilps %xmm11, %xmm10, %xmm11
+
+// CHECK: vpermilps %ymm11, %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x42,0x2d,0x0c,0xdb]
+ vpermilps %ymm11, %ymm10, %ymm11
+
+// CHECK: vpermilps (%rax), %xmm10, %xmm13
+// CHECK: encoding: [0xc4,0x62,0x29,0x0c,0x28]
+ vpermilps (%rax), %xmm10, %xmm13
+
+// CHECK: vpermilps (%rax), %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x62,0x2d,0x0c,0x18]
+ vpermilps (%rax), %ymm10, %ymm11
+
+// CHECK: vpermilpd $7, %xmm11, %xmm10
+// CHECK: encoding: [0xc4,0x43,0x79,0x05,0xd3,0x07]
+ vpermilpd $7, %xmm11, %xmm10
+
+// CHECK: vpermilpd $7, %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x43,0x7d,0x05,0xda,0x07]
+ vpermilpd $7, %ymm10, %ymm11
+
+// CHECK: vpermilpd $7, (%rax), %xmm10
+// CHECK: encoding: [0xc4,0x63,0x79,0x05,0x10,0x07]
+ vpermilpd $7, (%rax), %xmm10
+
+// CHECK: vpermilpd $7, (%rax), %ymm10
+// CHECK: encoding: [0xc4,0x63,0x7d,0x05,0x10,0x07]
+ vpermilpd $7, (%rax), %ymm10
+
+// CHECK: vpermilpd %xmm11, %xmm10, %xmm11
+// CHECK: encoding: [0xc4,0x42,0x29,0x0d,0xdb]
+ vpermilpd %xmm11, %xmm10, %xmm11
+
+// CHECK: vpermilpd %ymm11, %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x42,0x2d,0x0d,0xdb]
+ vpermilpd %ymm11, %ymm10, %ymm11
+
+// CHECK: vpermilpd (%rax), %xmm10, %xmm13
+// CHECK: encoding: [0xc4,0x62,0x29,0x0d,0x28]
+ vpermilpd (%rax), %xmm10, %xmm13
+
+// CHECK: vpermilpd (%rax), %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x62,0x2d,0x0d,0x18]
+ vpermilpd (%rax), %ymm10, %ymm11
+
+// CHECK: vperm2f128 $7, %ymm12, %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x43,0x2d,0x06,0xdc,0x07]
+ vperm2f128 $7, %ymm12, %ymm10, %ymm11
+
+// CHECK: vperm2f128 $7, (%rax), %ymm10, %ymm11
+// CHECK: encoding: [0xc4,0x63,0x2d,0x06,0x18,0x07]
+ vperm2f128 $7, (%rax), %ymm10, %ymm11
+
More information about the llvm-commits
mailing list