llvm.org GIT mirror llvm / 9d3f3c5
Fix a bug in the calculation of the VEX.B bit for FMA4 rr with the VEX.W bit set. The VEX.B was being calculated from the wrong operand. Fixes at least some portion of PR14185. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177014 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 7 years ago
3 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
445445 raw_ostream &OS) const {
446446 bool HasVEX_4V = (TSFlags >> X86II::VEXShift) & X86II::VEX_4V;
447447 bool HasVEX_4VOp3 = (TSFlags >> X86II::VEXShift) & X86II::VEX_4VOp3;
448 bool HasMemOp4 = (TSFlags >> X86II::VEXShift) & X86II::MemOp4;
448449
449450 // VEX_R: opcode externsion equivalent to REX.R in
450451 // 1's complement (inverted) form
649650 // dst(ModR/M), src1(ModR/M)
650651 // dst(ModR/M), src1(ModR/M), imm8
651652 //
653 // FMA4:
654 // dst(ModR/M.reg), src1(VEX_4V), src2(ModR/M), src3(VEX_I8IMM)
655 // dst(ModR/M.reg), src1(VEX_4V), src2(VEX_I8IMM), src3(ModR/M),
652656 if (X86II::isX86_64ExtendedReg(MI.getOperand(CurOp).getReg()))
653657 VEX_R = 0x0;
654658 CurOp++;
655659
656660 if (HasVEX_4V)
657661 VEX_4V = getVEXRegisterEncoding(MI, CurOp++);
662
663 if (HasMemOp4) // Skip second register source (encoded in I8IMM)
664 CurOp++;
665
658666 if (X86II::isX86_64ExtendedReg(MI.getOperand(CurOp).getReg()))
659667 VEX_B = 0x0;
660668 CurOp++;
815815 const MCInstrDesc *Desc) const {
816816 bool HasVEX_4V = (TSFlags >> X86II::VEXShift) & X86II::VEX_4V;
817817 bool HasVEX_4VOp3 = (TSFlags >> X86II::VEXShift) & X86II::VEX_4VOp3;
818 bool HasMemOp4 = (TSFlags >> X86II::VEXShift) & X86II::MemOp4;
818819
819820 // VEX_R: opcode externsion equivalent to REX.R in
820821 // 1's complement (inverted) form
10311032
10321033 if (HasVEX_4V)
10331034 VEX_4V = getVEXRegisterEncoding(MI, CurOp++);
1035
1036 if (MemOp4) // Skip second register source (encoded in I8IMM)
1037 CurOp++;
1038
10341039 if (X86II::isX86_64ExtendedReg(MI.getOperand(CurOp).getReg()))
10351040 VEX_B = 0x0;
10361041 CurOp++;
2424 // CHECK: encoding: [0xc4,0xe3,0xf9,0x6b,0xc2,0x10]
2525 vfmaddsd %xmm2, %xmm1, %xmm0, %xmm0
2626
27 // CHECK: vfmaddsd %xmm10, %xmm1, %xmm0, %xmm0
28 // CHECK: encoding: [0xc4,0xc3,0xf9,0x6b,0xc2,0x10]
29 vfmaddsd %xmm10, %xmm1, %xmm0, %xmm0
30
2731 // CHECK: vfmaddps (%rcx), %xmm1, %xmm0, %xmm0
2832 // CHECK: encoding: [0xc4,0xe3,0xf9,0x68,0x01,0x10]
2933 vfmaddps (%rcx), %xmm1, %xmm0, %xmm0