Skip to content

Commit 816cc9d

Browse files
authored
[X86][MC] Support Enc/Dec for NF BMI instructions (#76709)
Promoted BMI instructions were supported in #73899
1 parent a6161a2 commit 816cc9d

22 files changed

+649
-22
lines changed

llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,27 @@ static int getInstructionIDWithAttrMask(uint16_t *instructionID,
11341134
return 0;
11351135
}
11361136

1137+
static bool isNF(InternalInstruction *insn) {
1138+
if (!nfFromEVEX4of4(insn->vectorExtensionPrefix[3]))
1139+
return false;
1140+
if (insn->opcodeType == MAP4)
1141+
return true;
1142+
// Below NF instructions are not in map4.
1143+
if (insn->opcodeType == THREEBYTE_38 &&
1144+
ppFromEVEX3of4(insn->vectorExtensionPrefix[2]) == VEX_PREFIX_NONE) {
1145+
switch (insn->opcode) {
1146+
case 0xf2: // ANDN
1147+
case 0xf3: // BLSI, BLSR, BLSMSK
1148+
case 0xf5: // BZHI
1149+
case 0xf7: // BEXTR
1150+
return true;
1151+
default:
1152+
break;
1153+
}
1154+
}
1155+
return false;
1156+
}
1157+
11371158
// Determine the ID of an instruction, consuming the ModR/M byte as appropriate
11381159
// for extended and escape opcodes. Determines the attributes and context for
11391160
// the instruction before doing so.
@@ -1169,9 +1190,7 @@ static int getInstructionID(struct InternalInstruction *insn,
11691190
attrMask |= ATTR_EVEXKZ;
11701191
if (bFromEVEX4of4(insn->vectorExtensionPrefix[3]))
11711192
attrMask |= ATTR_EVEXB;
1172-
// nf bit is the MSB of aaa
1173-
if (nfFromEVEX4of4(insn->vectorExtensionPrefix[3]) &&
1174-
insn->opcodeType == MAP4)
1193+
if (isNF(insn)) // NF bit is the MSB of aaa.
11751194
attrMask |= ATTR_EVEXNF;
11761195
else if (aaaFromEVEX4of4(insn->vectorExtensionPrefix[3]))
11771196
attrMask |= ATTR_EVEXK;

llvm/lib/Target/X86/X86InstrArithmetic.td

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,30 +1312,30 @@ def : Pat<(X86testpat (loadi64 addr:$src1), i64relocImmSExt32_su:$src2),
13121312
//===----------------------------------------------------------------------===//
13131313
// ANDN Instruction
13141314
//
1315-
multiclass AndN<X86TypeInfo t, string suffix> {
1315+
multiclass AndN<X86TypeInfo t, SDPatternOperator node, string suffix = ""> {
13161316
defvar andn_rr_p =
1317-
[(set t.RegClass:$dst, EFLAGS, (X86and_flag (not t.RegClass:$src1),
1317+
[(set t.RegClass:$dst, EFLAGS, (node (not t.RegClass:$src1),
13181318
t.RegClass:$src2))];
13191319
defvar andn_rm_p =
1320-
[(set t.RegClass:$dst, EFLAGS, (X86and_flag (not t.RegClass:$src1),
1320+
[(set t.RegClass:$dst, EFLAGS, (node (not t.RegClass:$src1),
13211321
(t.LoadNode addr:$src2)))];
13221322
def rr#suffix : ITy<0xF2, MRMSrcReg, t, (outs t.RegClass:$dst),
13231323
(ins t.RegClass:$src1, t.RegClass:$src2), "andn",
1324-
binop_ndd_args, andn_rr_p>, VVVV, Sched<[WriteALU]>,
1325-
T8, DefEFLAGS;
1324+
binop_ndd_args, andn_rr_p>, VVVV, Sched<[WriteALU]>, T8;
13261325
def rm#suffix : ITy<0xF2, MRMSrcMem, t, (outs t.RegClass:$dst),
13271326
(ins t.RegClass:$src1, t.MemOperand:$src2), "andn",
13281327
binop_ndd_args, andn_rm_p>, VVVV,
1329-
Sched<[WriteALU.Folded, WriteALU.ReadAfterFold]>,
1330-
T8, DefEFLAGS;
1328+
Sched<[WriteALU.Folded, WriteALU.ReadAfterFold]>, T8;
13311329
}
13321330

13331331
// Complexity is reduced to give and with immediate a chance to match first.
13341332
let AddedComplexity = -6 in {
1335-
defm ANDN32 : AndN<Xi32, "">, VEX, Requires<[HasBMI, NoEGPR]>;
1336-
defm ANDN64 : AndN<Xi64, "">, VEX, REX_W, Requires<[HasBMI, NoEGPR]>;
1337-
defm ANDN32 : AndN<Xi32, "_EVEX">, EVEX, Requires<[HasBMI, HasEGPR, In64BitMode]>;
1338-
defm ANDN64 : AndN<Xi64, "_EVEX">, EVEX, REX_W, Requires<[HasBMI, HasEGPR, In64BitMode]>;
1333+
defm ANDN32 : AndN<Xi32, X86and_flag>, VEX, Requires<[HasBMI, NoEGPR]>, DefEFLAGS;
1334+
defm ANDN64 : AndN<Xi64, X86and_flag>, VEX, Requires<[HasBMI, NoEGPR]>, DefEFLAGS;
1335+
defm ANDN32 : AndN<Xi32, X86and_flag, "_EVEX">, EVEX, Requires<[HasBMI, HasEGPR, In64BitMode]>, DefEFLAGS;
1336+
defm ANDN64 : AndN<Xi64, X86and_flag, "_EVEX">, EVEX, Requires<[HasBMI, HasEGPR, In64BitMode]>, DefEFLAGS;
1337+
defm ANDN32 : AndN<Xi32, null_frag, "_NF">, EVEX, EVEX_NF, Requires<[In64BitMode]>;
1338+
defm ANDN64 : AndN<Xi64, null_frag, "_NF">, EVEX, EVEX_NF, Requires<[In64BitMode]>;
13391339
}
13401340

13411341
multiclass Andn_Pats<string suffix> {

llvm/lib/Target/X86/X86InstrMisc.td

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ multiclass Bls<string m, Format RegMRM, Format MemMRM, X86TypeInfo t, string Suf
12231223
(outs t.RegClass:$dst), []>, T8, VVVV;
12241224
}
12251225

1226-
let Predicates = [HasBMI], Defs = [EFLAGS] in {
1226+
let Defs = [EFLAGS] in {
12271227
defm BLSR32 : Bls<"blsr", MRM1r, MRM1m, Xi32>, VEX;
12281228
defm BLSR64 : Bls<"blsr", MRM1r, MRM1m, Xi64>, VEX;
12291229
defm BLSMSK32 : Bls<"blsmsk", MRM2r, MRM2m, Xi32>, VEX;
@@ -1232,7 +1232,7 @@ let Predicates = [HasBMI], Defs = [EFLAGS] in {
12321232
defm BLSI64 : Bls<"blsi", MRM3r, MRM3m, Xi64>, VEX;
12331233
}
12341234

1235-
let Predicates = [HasBMI, In64BitMode], Defs = [EFLAGS] in {
1235+
let Predicates = [In64BitMode], Defs = [EFLAGS] in {
12361236
defm BLSR32 : Bls<"blsr", MRM1r, MRM1m, Xi32, "_EVEX">, EVEX;
12371237
defm BLSR64 : Bls<"blsr", MRM1r, MRM1m, Xi64, "_EVEX">, EVEX;
12381238
defm BLSMSK32 : Bls<"blsmsk", MRM2r, MRM2m, Xi32, "_EVEX">, EVEX;
@@ -1241,6 +1241,15 @@ let Predicates = [HasBMI, In64BitMode], Defs = [EFLAGS] in {
12411241
defm BLSI64 : Bls<"blsi", MRM3r, MRM3m, Xi64, "_EVEX">, EVEX;
12421242
}
12431243

1244+
let Predicates = [In64BitMode] in {
1245+
defm BLSR32 : Bls<"blsr", MRM1r, MRM1m, Xi32, "_NF">, EVEX, EVEX_NF;
1246+
defm BLSR64 : Bls<"blsr", MRM1r, MRM1m, Xi64, "_NF">, EVEX, EVEX_NF;
1247+
defm BLSMSK32 : Bls<"blsmsk", MRM2r, MRM2m, Xi32, "_NF">, EVEX, EVEX_NF;
1248+
defm BLSMSK64 : Bls<"blsmsk", MRM2r, MRM2m, Xi64, "_NF">, EVEX, EVEX_NF;
1249+
defm BLSI32 : Bls<"blsi", MRM3r, MRM3m, Xi32, "_NF">, EVEX, EVEX_NF;
1250+
defm BLSI64 : Bls<"blsi", MRM3r, MRM3m, Xi64, "_NF">, EVEX, EVEX_NF;
1251+
}
1252+
12441253
multiclass Bls_Pats<string suffix> {
12451254
// FIXME(1): patterns for the load versions are not implemented
12461255
// FIXME(2): By only matching `add_su` and `ineg_su` we may emit
@@ -1315,6 +1324,13 @@ let Predicates = [HasBMI2, HasEGPR, In64BitMode], Defs = [EFLAGS] in {
13151324
defm BZHI64 : Bmi4VOp3<0xF5, "bzhi", Xi64, X86bzhi, WriteBZHI, "_EVEX">, EVEX;
13161325
}
13171326

1327+
let Predicates = [In64BitMode] in {
1328+
defm BEXTR32 : Bmi4VOp3<0xF7, "bextr", Xi32, null_frag, WriteBEXTR, "_NF">, EVEX, EVEX_NF;
1329+
defm BEXTR64 : Bmi4VOp3<0xF7, "bextr", Xi64, null_frag, WriteBEXTR, "_NF">, EVEX, EVEX_NF;
1330+
defm BZHI32 : Bmi4VOp3<0xF5, "bzhi", Xi32, null_frag, WriteBZHI, "_NF">, EVEX, EVEX_NF;
1331+
defm BZHI64 : Bmi4VOp3<0xF5, "bzhi", Xi64, null_frag, WriteBZHI, "_NF">, EVEX, EVEX_NF;
1332+
}
1333+
13181334
def CountTrailingOnes : SDNodeXForm<imm, [{
13191335
// Count the trailing ones in the immediate.
13201336
return getI8Imm(llvm::countr_one(N->getZExtValue()), SDLoc(N));

llvm/test/MC/Disassembler/X86/apx/andn.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
22
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
33

4+
# ATT: {nf} andnl %ecx, %edx, %r10d
5+
# INTEL: {nf} andn r10d, edx, ecx
6+
0x62,0x72,0x6c,0x0c,0xf2,0xd1
7+
8+
# ATT: andnl %ecx, %edx, %r10d
9+
# INTEL: andn r10d, edx, ecx
10+
0x62,0x72,0x6c,0x08,0xf2,0xd1
11+
12+
# ATT: {nf} andnq %r9, %r15, %r11
13+
# INTEL: {nf} andn r11, r15, r9
14+
0x62,0x52,0x84,0x0c,0xf2,0xd9
15+
16+
# ATT: andnq %r9, %r15, %r11
17+
# INTEL: andn r11, r15, r9
18+
0x62,0x52,0x84,0x08,0xf2,0xd9
19+
20+
# ATT: {nf} andnl 123(%rax,%rbx,4), %ecx, %edx
21+
# INTEL: {nf} andn edx, ecx, dword ptr [rax + 4*rbx + 123]
22+
0x62,0xf2,0x74,0x0c,0xf2,0x54,0x98,0x7b
23+
24+
# ATT: andnl 123(%rax,%rbx,4), %ecx, %edx
25+
# INTEL: andn edx, ecx, dword ptr [rax + 4*rbx + 123]
26+
0x62,0xf2,0x74,0x08,0xf2,0x54,0x98,0x7b
27+
28+
# ATT: {nf} andnq 123(%rax,%rbx,4), %r9, %r15
29+
# INTEL: {nf} andn r15, r9, qword ptr [rax + 4*rbx + 123]
30+
0x62,0x72,0xb4,0x0c,0xf2,0x7c,0x98,0x7b
31+
32+
# ATT: andnq 123(%rax,%rbx,4), %r9, %r15
33+
# INTEL: andn r15, r9, qword ptr [rax + 4*rbx + 123]
34+
0x62,0x72,0xb4,0x08,0xf2,0x7c,0x98,0x7b
35+
436
# ATT: andnl %r18d, %r22d, %r26d
537
# INTEL: andn r26d, r22d, r18d
638
0x62,0x6a,0x4c,0x00,0xf2,0xd2

llvm/test/MC/Disassembler/X86/apx/bextr.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
22
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
33

4+
# ATT: {nf} bextrl %ecx, %edx, %r10d
5+
# INTEL: {nf} bextr r10d, edx, ecx
6+
0x62,0x72,0x74,0x0c,0xf7,0xd2
7+
8+
# ATT: bextrl %ecx, %edx, %r10d
9+
# INTEL: bextr r10d, edx, ecx
10+
0x62,0x72,0x74,0x08,0xf7,0xd2
11+
12+
# ATT: {nf} bextrl %ecx, 123(%rax,%rbx,4), %edx
13+
# INTEL: {nf} bextr edx, dword ptr [rax + 4*rbx + 123], ecx
14+
0x62,0xf2,0x74,0x0c,0xf7,0x54,0x98,0x7b
15+
16+
# ATT: bextrl %ecx, 123(%rax,%rbx,4), %edx
17+
# INTEL: bextr edx, dword ptr [rax + 4*rbx + 123], ecx
18+
0x62,0xf2,0x74,0x08,0xf7,0x54,0x98,0x7b
19+
20+
# ATT: {nf} bextrq %r9, %r15, %r11
21+
# INTEL: {nf} bextr r11, r15, r9
22+
0x62,0x52,0xb4,0x0c,0xf7,0xdf
23+
24+
# ATT: bextrq %r9, %r15, %r11
25+
# INTEL: bextr r11, r15, r9
26+
0x62,0x52,0xb4,0x08,0xf7,0xdf
27+
28+
# ATT: {nf} bextrq %r9, 123(%rax,%rbx,4), %r15
29+
# INTEL: {nf} bextr r15, qword ptr [rax + 4*rbx + 123], r9
30+
0x62,0x72,0xb4,0x0c,0xf7,0x7c,0x98,0x7b
31+
32+
# ATT: bextrq %r9, 123(%rax,%rbx,4), %r15
33+
# INTEL: bextr r15, qword ptr [rax + 4*rbx + 123], r9
34+
0x62,0x72,0xb4,0x08,0xf7,0x7c,0x98,0x7b
35+
436
# ATT: bextrl %r18d, %r22d, %r26d
537
# INTEL: bextr r26d, r22d, r18d
638
0x62,0x6a,0x6c,0x00,0xf7,0xd6

llvm/test/MC/Disassembler/X86/apx/blsi.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
22
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
33

4+
# ATT: {nf} blsil %ecx, %edx
5+
# INTEL: {nf} blsi edx, ecx
6+
0x62,0xf2,0x6c,0x0c,0xf3,0xd9
7+
8+
# ATT: blsil %ecx, %edx
9+
# INTEL: blsi edx, ecx
10+
0x62,0xf2,0x6c,0x08,0xf3,0xd9
11+
12+
# ATT: {nf} blsiq %r9, %r15
13+
# INTEL: {nf} blsi r15, r9
14+
0x62,0xd2,0x84,0x0c,0xf3,0xd9
15+
16+
# ATT: blsiq %r9, %r15
17+
# INTEL: blsi r15, r9
18+
0x62,0xd2,0x84,0x08,0xf3,0xd9
19+
20+
# ATT: {nf} blsil 123(%rax,%rbx,4), %ecx
21+
# INTEL: {nf} blsi ecx, dword ptr [rax + 4*rbx + 123]
22+
0x62,0xf2,0x74,0x0c,0xf3,0x5c,0x98,0x7b
23+
24+
# ATT: blsil 123(%rax,%rbx,4), %ecx
25+
# INTEL: blsi ecx, dword ptr [rax + 4*rbx + 123]
26+
0x62,0xf2,0x74,0x08,0xf3,0x5c,0x98,0x7b
27+
28+
# ATT: {nf} blsiq 123(%rax,%rbx,4), %r9
29+
# INTEL: {nf} blsi r9, qword ptr [rax + 4*rbx + 123]
30+
0x62,0xf2,0xb4,0x0c,0xf3,0x5c,0x98,0x7b
31+
32+
# ATT: blsiq 123(%rax,%rbx,4), %r9
33+
# INTEL: blsi r9, qword ptr [rax + 4*rbx + 123]
34+
0x62,0xf2,0xb4,0x08,0xf3,0x5c,0x98,0x7b
35+
436
# ATT: blsil %r18d, %r22d
537
# INTEL: blsi r22d, r18d
638
0x62,0xfa,0x4c,0x00,0xf3,0xda

llvm/test/MC/Disassembler/X86/apx/blsmsk.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
22
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
33

4+
# ATT: {nf} blsmskl %ecx, %edx
5+
# INTEL: {nf} blsmsk edx, ecx
6+
0x62,0xf2,0x6c,0x0c,0xf3,0xd1
7+
8+
# ATT: blsmskl %ecx, %edx
9+
# INTEL: blsmsk edx, ecx
10+
0x62,0xf2,0x6c,0x08,0xf3,0xd1
11+
12+
# ATT: {nf} blsmskq %r9, %r15
13+
# INTEL: {nf} blsmsk r15, r9
14+
0x62,0xd2,0x84,0x0c,0xf3,0xd1
15+
16+
# ATT: blsmskq %r9, %r15
17+
# INTEL: blsmsk r15, r9
18+
0x62,0xd2,0x84,0x08,0xf3,0xd1
19+
20+
# ATT: {nf} blsmskl 123(%rax,%rbx,4), %ecx
21+
# INTEL: {nf} blsmsk ecx, dword ptr [rax + 4*rbx + 123]
22+
0x62,0xf2,0x74,0x0c,0xf3,0x54,0x98,0x7b
23+
24+
# ATT: blsmskl 123(%rax,%rbx,4), %ecx
25+
# INTEL: blsmsk ecx, dword ptr [rax + 4*rbx + 123]
26+
0x62,0xf2,0x74,0x08,0xf3,0x54,0x98,0x7b
27+
28+
# ATT: {nf} blsmskq 123(%rax,%rbx,4), %r9
29+
# INTEL: {nf} blsmsk r9, qword ptr [rax + 4*rbx + 123]
30+
0x62,0xf2,0xb4,0x0c,0xf3,0x54,0x98,0x7b
31+
32+
# ATT: blsmskq 123(%rax,%rbx,4), %r9
33+
# INTEL: blsmsk r9, qword ptr [rax + 4*rbx + 123]
34+
0x62,0xf2,0xb4,0x08,0xf3,0x54,0x98,0x7b
35+
436
# ATT: blsmskl %r18d, %r22d
537
# INTEL: blsmsk r22d, r18d
638
0x62,0xfa,0x4c,0x00,0xf3,0xd2

llvm/test/MC/Disassembler/X86/apx/blsr.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
22
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
33

4+
# ATT: {nf} blsrl %ecx, %edx
5+
# INTEL: {nf} blsr edx, ecx
6+
0x62,0xf2,0x6c,0x0c,0xf3,0xc9
7+
8+
# ATT: blsrl %ecx, %edx
9+
# INTEL: blsr edx, ecx
10+
0x62,0xf2,0x6c,0x08,0xf3,0xc9
11+
12+
# ATT: {nf} blsrq %r9, %r15
13+
# INTEL: {nf} blsr r15, r9
14+
0x62,0xd2,0x84,0x0c,0xf3,0xc9
15+
16+
# ATT: blsrq %r9, %r15
17+
# INTEL: blsr r15, r9
18+
0x62,0xd2,0x84,0x08,0xf3,0xc9
19+
20+
# ATT: {nf} blsrl 123(%rax,%rbx,4), %ecx
21+
# INTEL: {nf} blsr ecx, dword ptr [rax + 4*rbx + 123]
22+
0x62,0xf2,0x74,0x0c,0xf3,0x4c,0x98,0x7b
23+
24+
# ATT: blsrl 123(%rax,%rbx,4), %ecx
25+
# INTEL: blsr ecx, dword ptr [rax + 4*rbx + 123]
26+
0x62,0xf2,0x74,0x08,0xf3,0x4c,0x98,0x7b
27+
28+
# ATT: {nf} blsrq 123(%rax,%rbx,4), %r9
29+
# INTEL: {nf} blsr r9, qword ptr [rax + 4*rbx + 123]
30+
0x62,0xf2,0xb4,0x0c,0xf3,0x4c,0x98,0x7b
31+
32+
# ATT: blsrq 123(%rax,%rbx,4), %r9
33+
# INTEL: blsr r9, qword ptr [rax + 4*rbx + 123]
34+
0x62,0xf2,0xb4,0x08,0xf3,0x4c,0x98,0x7b
35+
436
# ATT: blsrl %r18d, %r22d
537
# INTEL: blsr r22d, r18d
638
0x62,0xfa,0x4c,0x00,0xf3,0xca

llvm/test/MC/Disassembler/X86/apx/bzhi.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
22
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
33

4+
# ATT: {nf} bzhil %ecx, %edx, %r10d
5+
# INTEL: {nf} bzhi r10d, edx, ecx
6+
0x62,0x72,0x74,0x0c,0xf5,0xd2
7+
8+
# ATT: bzhil %ecx, %edx, %r10d
9+
# INTEL: bzhi r10d, edx, ecx
10+
0x62,0x72,0x74,0x08,0xf5,0xd2
11+
12+
# ATT: {nf} bzhil %ecx, 123(%rax,%rbx,4), %edx
13+
# INTEL: {nf} bzhi edx, dword ptr [rax + 4*rbx + 123], ecx
14+
0x62,0xf2,0x74,0x0c,0xf5,0x54,0x98,0x7b
15+
16+
# ATT: bzhil %ecx, 123(%rax,%rbx,4), %edx
17+
# INTEL: bzhi edx, dword ptr [rax + 4*rbx + 123], ecx
18+
0x62,0xf2,0x74,0x08,0xf5,0x54,0x98,0x7b
19+
20+
# ATT: {nf} bzhiq %r9, %r15, %r11
21+
# INTEL: {nf} bzhi r11, r15, r9
22+
0x62,0x52,0xb4,0x0c,0xf5,0xdf
23+
24+
# ATT: bzhiq %r9, %r15, %r11
25+
# INTEL: bzhi r11, r15, r9
26+
0x62,0x52,0xb4,0x08,0xf5,0xdf
27+
28+
# ATT: {nf} bzhiq %r9, 123(%rax,%rbx,4), %r15
29+
# INTEL: {nf} bzhi r15, qword ptr [rax + 4*rbx + 123], r9
30+
0x62,0x72,0xb4,0x0c,0xf5,0x7c,0x98,0x7b
31+
32+
# ATT: bzhiq %r9, 123(%rax,%rbx,4), %r15
33+
# INTEL: bzhi r15, qword ptr [rax + 4*rbx + 123], r9
34+
0x62,0x72,0xb4,0x08,0xf5,0x7c,0x98,0x7b
35+
36+
# ATT: bzhiq %r9, 123(%rax,%rbx,4), %r15
37+
# INTEL: bzhi r15, qword ptr [rax + 4*rbx + 123], r9
38+
0x62,0x72,0xb4,0x08,0xf5,0xbc,0x98,0x7b,0x00,0x00,0x00
39+
440
# ATT: bzhil %r18d, %r22d, %r26d
541
# INTEL: bzhi r26d, r22d, r18d
642
0x62,0x6a,0x6c,0x00,0xf5,0xd6

0 commit comments

Comments
 (0)