The following are legal according to X86 spec:
ins mem, DX
outs DX, mem
lods mem
stos mem
scas mem
cmps mem, mem
movs mem, mem
Paths
| Differential D14827
Adding support for missing variations of X86 string related instructions ClosedPublic Authored by myatsina on Nov 19 2015, 9:13 AM.
Details Summary The following are legal according to X86 spec: ins mem, DX
Diff Detail
Event TimelineComment Actions Can you add tests to cover the new error paths you are adding?
Comment Actions
Do you mean the "mismatching source and destination index registers" error?
Comment Actions
Ah, you're right. Nevermind.
Comment Actions Craig, can you give us a second opinion here? These string instructions need a memory operand size, but the encodings only support [esi]/[edi] as a memory operand. If the users asks for ins byte ptr [eax], dx and we assemble it to ins byte ptr es:[edi], dx, it seems highly likely that the user made a mistake. I'm trying to insist that we should either error or warn when the instruction that the user asked for is not encodable. Comment Actions
The intel manual even has a paragraph about this being misleading: """ """ (emphasis mine) Comment Actions Sean, if I understand correctly, you, as well as Reid, support producing a warning, though the spec explicitly mentions that the memory operand is ignored, and though MSVC and ICC do not produce such warnings, right? Comment Actions Added warning regarding the fact that these instructions use (R|E)SI or (R|E)DI instead of the specified memory operand This revision is now accepted and ready to land.Jan 13 2016, 11:21 AM Closed by commit rL258132: [X86] Adding support for missing variations of X86 string related instructions (authored by myatsina). · Explain WhyJan 19 2016, 7:41 AM This revision was automatically updated to reflect the committed changes. Comment Actions Building LibreOffice (which has some asm blocks) started to fail now with error: memory operand is only for determining the size, ES:(R|E)SI will be used for the location [-Werror,-Winline-asm] movsd (%rax), %xmm0 Comment Actions Committed a fix in revision 258312.
Revision Contents
Diff 41409 lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/X86InstrInfo.td
test/MC/X86/index-operations.s
test/MC/X86/intel-syntax.s
|
Please use a static_cast here