[llvm] 5b4cd2d - [X86] Assemble movzb 1280(%rbx, %r12), %r12 after D80608
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed May 27 09:56:14 PDT 2020
Author: Fangrui Song
Date: 2020-05-27T09:55:55-07:00
New Revision: 5b4cd2d4c42360469ccc9f59aa04a1a24b290df9
URL: https://github.com/llvm/llvm-project/commit/5b4cd2d4c42360469ccc9f59aa04a1a24b290df9
DIFF: https://github.com/llvm/llvm-project/commit/5b4cd2d4c42360469ccc9f59aa04a1a24b290df9.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/MC/X86/x86-64.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index a842a91bbb06..91edc1a81c3f 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -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) {
diff --git a/llvm/test/MC/X86/x86-64.s b/llvm/test/MC/X86/x86-64.s
index a1c7e431cef7..1b73aced06c7 100644
--- a/llvm/test/MC/X86/x86-64.s
+++ b/llvm/test/MC/X86/x86-64.s
@@ -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]
More information about the llvm-commits
mailing list