Reverse assembler/disassembler operand order for gather instructions.

llvm-svn: 159983
This commit is contained in:
Craig Topper 2012-07-10 06:38:33 +00:00
parent e18614dd17
commit be41e2daa6
3 changed files with 27 additions and 52 deletions

View File

@ -8037,51 +8037,26 @@ defm VPSRAVD : avx2_var_shift<0x46, "vpsravd", sra, v4i32, v8i32>;
//===----------------------------------------------------------------------===//
// VGATHER - GATHER Operations
multiclass avx2_gather<bits<8> opc, string OpcodeStr,
RegisterClass RC256, X86MemOperand memop256,
Intrinsic IntGather128, Intrinsic IntGather256> {
RegisterClass RC256, X86MemOperand memop256> {
def rm : AVX28I<opc, MRMSrcMem, (outs VR128:$dst),
(ins VR128:$src1, v128mem:$src2, VR128:$mask),
!strconcat(OpcodeStr,
"\t{$src1, $src2, $mask|$mask, $src2, $src1}"),
"\t{$mask, $src2, $dst|$dst, $src2, $mask}"),
[]>, VEX_4VOp3;
def Yrm : AVX28I<opc, MRMSrcMem, (outs RC256:$dst),
(ins RC256:$src1, memop256:$src2, RC256:$mask),
!strconcat(OpcodeStr,
"\t{$src1, $src2, $mask|$mask, $src2, $src1}"),
"\t{$mask, $src2, $dst|$dst, $src2, $mask}"),
[]>, VEX_4VOp3, VEX_L;
}
let Constraints = "$src1 = $dst" in {
defm VGATHERDPD : avx2_gather<0x92, "vgatherdpd",
VR256, v128mem,
int_x86_avx2_gather_d_pd,
int_x86_avx2_gather_d_pd_256>, VEX_W;
defm VGATHERQPD : avx2_gather<0x93, "vgatherqpd",
VR256, v256mem,
int_x86_avx2_gather_q_pd,
int_x86_avx2_gather_q_pd_256>, VEX_W;
defm VGATHERDPS : avx2_gather<0x92, "vgatherdps",
VR256, v256mem,
int_x86_avx2_gather_d_ps,
int_x86_avx2_gather_d_ps_256>;
defm VGATHERQPS : avx2_gather<0x93, "vgatherqps",
VR128, v256mem,
int_x86_avx2_gather_q_ps,
int_x86_avx2_gather_q_ps_256>;
defm VPGATHERDQ : avx2_gather<0x90, "vpgatherdq",
VR256, v128mem,
int_x86_avx2_gather_d_q,
int_x86_avx2_gather_d_q_256>, VEX_W;
defm VPGATHERQQ : avx2_gather<0x91, "vpgatherqq",
VR256, v256mem,
int_x86_avx2_gather_q_q,
int_x86_avx2_gather_q_q_256>, VEX_W;
defm VPGATHERDD : avx2_gather<0x90, "vpgatherdd",
VR256, v256mem,
int_x86_avx2_gather_d_d,
int_x86_avx2_gather_d_d_256>;
defm VPGATHERQD : avx2_gather<0x91, "vpgatherqd",
VR128, v256mem,
int_x86_avx2_gather_q_d,
int_x86_avx2_gather_q_d_256>;
defm VGATHERDPD : avx2_gather<0x92, "vgatherdpd", VR256, v128mem>, VEX_W;
defm VGATHERQPD : avx2_gather<0x93, "vgatherqpd", VR256, v256mem>, VEX_W;
defm VGATHERDPS : avx2_gather<0x92, "vgatherdps", VR256, v256mem>;
defm VGATHERQPS : avx2_gather<0x93, "vgatherqps", VR128, v256mem>;
defm VPGATHERDQ : avx2_gather<0x90, "vpgatherdq", VR256, v128mem>, VEX_W;
defm VPGATHERQQ : avx2_gather<0x91, "vpgatherqq", VR256, v256mem>, VEX_W;
defm VPGATHERDD : avx2_gather<0x90, "vpgatherdd", VR256, v256mem>;
defm VPGATHERQD : avx2_gather<0x91, "vpgatherqd", VR128, v256mem>;
}

View File

@ -726,28 +726,28 @@
0xc4 0xe3 0xe1 0x48 0x40 0x04 0x21
# CHECK: vgatherdpd %xmm0, (%rdi,%xmm1,2), %xmm2
0xc4 0xe2 0xe9 0x92 0x04 0x4f
0xc4 0xe2 0xf9 0x92 0x14 0x4f
# CHECK: vgatherdpd %ymm0, (%rdi,%xmm1,2), %ymm2
0xc4 0xe2 0xed 0x92 0x04 0x4f
0xc4 0xe2 0xfd 0x92 0x14 0x4f
# CHECK: vgatherqps %xmm8, (%r15,%xmm9,2), %xmm10
0xc4 0x02 0x29 0x93 0x04 0x4f
0xc4 0x02 0x39 0x93 0x14 0x4f
# CHECK: vgatherqps %xmm8, (%r15,%ymm9,2), %xmm10
0xc4 0x02 0x2d 0x93 0x04 0x4f
0xc4 0x02 0x3d 0x93 0x14 0x4f
# CHECK: vpgatherdq %xmm0, (%rdi,%xmm1,2), %xmm2
0xc4 0xe2 0xe9 0x90 0x04 0x4f
0xc4 0xe2 0xf9 0x90 0x14 0x4f
# CHECK: vpgatherdq %ymm0, (%rdi,%xmm1,2), %ymm2
0xc4 0xe2 0xed 0x90 0x04 0x4f
0xc4 0xe2 0xfd 0x90 0x14 0x4f
# CHECK: vpgatherqd %xmm8, (%r15,%xmm9,2), %xmm10
0xc4 0x02 0x29 0x91 0x04 0x4f
0xc4 0x02 0x39 0x91 0x14 0x4f
# CHECK: vpgatherqd %xmm8, (%r15,%ymm9,2), %xmm10
0xc4 0x02 0x2d 0x91 0x04 0x4f
0xc4 0x02 0x3d 0x91 0x14 0x4f
# rdar://8812056 lldb doesn't print the x86 lock prefix when disassembling
# CHECK: lock

View File

@ -4123,33 +4123,33 @@ _foo2:
vblendvps %ymm1, _foo2(%rip), %ymm0, %ymm0
// CHECK: vgatherdpd %xmm0, (%rdi,%xmm1,2), %xmm2
// CHECK: encoding: [0xc4,0xe2,0xe9,0x92,0x04,0x4f]
// CHECK: encoding: [0xc4,0xe2,0xf9,0x92,0x14,0x4f]
vgatherdpd %xmm0, (%rdi,%xmm1,2), %xmm2
// CHECK: vgatherdpd %ymm0, (%rdi,%xmm1,2), %ymm2
// CHECK: encoding: [0xc4,0xe2,0xed,0x92,0x04,0x4f]
// CHECK: encoding: [0xc4,0xe2,0xfd,0x92,0x14,0x4f]
vgatherdpd %ymm0, (%rdi,%xmm1,2), %ymm2
// CHECK: vgatherqps %xmm8, (%r15,%xmm9,2), %xmm10
// CHECK: encoding: [0xc4,0x02,0x29,0x93,0x04,0x4f]
// CHECK: encoding: [0xc4,0x02,0x39,0x93,0x14,0x4f]
vgatherqps %xmm8, (%r15,%xmm9,2), %xmm10
// CHECK: vgatherqps %xmm8, (%r15,%ymm9,2), %xmm10
// CHECK: encoding: [0xc4,0x02,0x2d,0x93,0x04,0x4f]
// CHECK: encoding: [0xc4,0x02,0x3d,0x93,0x14,0x4f]
vgatherqps %xmm8, (%r15,%ymm9,2), %xmm10
// CHECK: vpgatherdq %xmm0, (%rdi,%xmm1,2), %xmm2
// CHECK: encoding: [0xc4,0xe2,0xe9,0x90,0x04,0x4f]
// CHECK: encoding: [0xc4,0xe2,0xf9,0x90,0x14,0x4f]
vpgatherdq %xmm0, (%rdi,%xmm1,2), %xmm2
// CHECK: vpgatherdq %ymm0, (%rdi,%xmm1,2), %ymm2
// CHECK: encoding: [0xc4,0xe2,0xed,0x90,0x04,0x4f]
// CHECK: encoding: [0xc4,0xe2,0xfd,0x90,0x14,0x4f]
vpgatherdq %ymm0, (%rdi,%xmm1,2), %ymm2
// CHECK: vpgatherqd %xmm8, (%r15,%xmm9,2), %xmm10
// CHECK: encoding: [0xc4,0x02,0x29,0x91,0x04,0x4f]
// CHECK: encoding: [0xc4,0x02,0x39,0x91,0x14,0x4f]
vpgatherqd %xmm8, (%r15,%xmm9,2), %xmm10
// CHECK: vpgatherqd %xmm8, (%r15,%ymm9,2), %xmm10
// CHECK: encoding: [0xc4,0x02,0x2d,0x91,0x04,0x4f]
// CHECK: encoding: [0xc4,0x02,0x3d,0x91,0x14,0x4f]
vpgatherqd %xmm8, (%r15,%ymm9,2), %xmm10