[PATCH] D14827: Adding support for missing variations of X86 string related instructions

Marina Yatsina via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 07:08:25 PST 2015


myatsina added a comment.

In http://reviews.llvm.org/D14827#295382, @rnk wrote:

> Can you add tests to cover the new error paths you are adding?


Do you mean the "mismatching source and destination index registers" error? 
If so, then this code is just a refactoring the logic that used "doSrcDstMatch" and returned this error if there was no match.
It should be covered by existent tests, but I can add one more just in case.


================
Comment at: test/MC/X86/intel-syntax.s:740-741
@@ +739,4 @@
+
+ins byte ptr [eax], dx
+// CHECK: insb %dx, %es:(%edi)
+outs dx, word ptr [eax]
----------------
rnk wrote:
> I'm confused. Why are these two assembly instructions equivalent? Ditto for the rest, they don't look equivalent.
If you look at the X86 spec of these instructions:

INS m8, DX - Input byte from I/O port specified in DX into memory location specified in ES:(E)DI or RDI
which is actually the same as the definition of the "insb" instruction.
The mem operand has no meaning other than distinguishing if it's insb, insw or insl (in this case it's mem8, so it should be insb).

"insb" and "ins m8, DX" are equivalent and should map to the same instruction.

Does this answer your question?




Repository:
  rL LLVM

http://reviews.llvm.org/D14827





More information about the llvm-commits mailing list