X86 allows for the "addr32" and "addr16" address size override prefixes.
Also, these and the segment override prefixes should be recognized as
valid prefixes.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
3263–3269 | Hmm, could you capitalize the first char of "isPrefix" by the way? | |
llvm/lib/Target/X86/X86InstrSystem.td | ||
180–182 | A minor suggestion: Add tests to check the predicates "In32BitMode", "In64BitMode" for addr16/32. | |
llvm/test/MC/X86/addr16-32.s | ||
25 | Remove this line. | |
llvm/test/MC/X86/segment-prefix.s | ||
22 | Remove this line. |
Fixed variable name and removed excess test lines.
llvm/lib/Target/X86/X86InstrSystem.td | ||
---|---|---|
180–182 | The tests which include ".code16"/".code32", etc., should be doing this already. |
LGTM. Before this patch, we could only write code like
CS insl
addr32/addr16 and CS/DS/ES/FS/GS/SS are prefixes, so they should be allowed to be written before the instruction in the same line, and GNU-AS does support this syntax.
One behavior different from GNU-AS is that as rejects es and ss in 64-bit mode, but this has beyond the purpose of this patch.
Hmm, could you capitalize the first char of "isPrefix" by the way?