[X86] Assemble movzb 1280(%rbx, %r12), %r12 after D80608

ffmpeg/libavcodec/x86/h264_cabac.c inline assembly may produce
movzb 1280(%rbx, %r12), %r12

After D80608, llvm-mc errors:

error: unknown use of instruction mnemonic without a size suffix
This commit is contained in:
Fangrui Song 2020-05-27 09:49:08 -07:00
parent 4d6f44f5f0
commit 5b4cd2d4c4
2 changed files with 4 additions and 1 deletions

View File

@ -3471,7 +3471,7 @@ bool X86AsmParser::MatchAndEmitATTInstruction(SMLoc IDLoc, unsigned &Opcode,
for (unsigned I = 0, E = array_lengthof(Match); I != E; ++I) {
Tmp.back() = Suffixes[I];
if (MemOp)
if (MemOp && HasVectorReg)
MemOp->Mem.Size = MemSize[I];
Match[I] = Match_MnemonicFail;
if (MemOp || !HasVectorReg) {

View File

@ -869,6 +869,9 @@ movsx (%rax), %ax
// CHECK: encoding: [0x66,0x0f,0xb6,0x00]
movzx (%rax), %ax
// CHECK: movzbq 1280(%rbx,%r11), %r12
// CHECK: encoding: [0x4e,0x0f,0xb6,0xa4,0x1b,0x00,0x05,0x00,0x00]
movzb 1280(%rbx, %r11), %r12
// rdar://7873482
// CHECK: [0x65,0x8b,0x04,0x25,0x7c,0x00,0x00,0x00]