Movdir64b is special for its mem operand, 67 prefex can not only modify its add size,
so it's mem base and index reg should be the same type as source reg, such as
movdir64b (%rdx), rcx, and could not be movdir64b (%edx), rcx.
Now llvm-mc can encode the asm 'movdir64b (%edx), rcx' but the result is the same as
'movdir64b (%edx), ecx', which offend users' intention, while gcc will object this
action and give a warning.
I add 3 new mem descriptions to let llvm-mc to report the same error.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Now llvm-mc can encode the asm 'movdir64b (%edx), rcx' but the result is the same as
'movdir64b (%edx), ecx', which offend users' intention, while gcc will object this
action and give a warning.
I am confused about this statement.
- What does the "Now" mean here? Before this patch or after this patch?
- I can only see memory operand change in this patch, why it affects the register operand?
For 1, Now means before, after this patch, we will report errors like gcc.
For 2, this instruction require the source reg operand consistent with mem base reg and index reg,
I change the mem operand to match their source register operand.
llvm/lib/Target/X86/AsmParser/X86Operand.h | ||
---|---|---|
398 | gas requires .allow_index_reg directive to enable riz/eiz parsing. |
llvm/lib/Target/X86/AsmParser/X86Operand.h | ||
---|---|---|
398 |
It worked. Will do. |
Do you need to include X86::EIP?