[PATCH] D49912: [X86] MCA tests for XCHG* and CMPXCHG* instructions

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 04:36:34 PDT 2018


RKSimon added inline comments.


================
Comment at: test/tools/llvm-mca/X86/Atom/resources-x86_64.s:676-677
+xchgb %bl, %cl
+xchgb %al, (%rbx)
+xchgb %bl, (%rbx)
+
----------------
lebedev.ri wrote:
> avt77 wrote:
> > lebedev.ri wrote:
> > > http://felixcloutier.com/x86/XCHG.html suggests that memory operand can be on either side,
> > > so this needs to be repeated with swapped order.
> > In fact I checked it but decided not to include in the test because this test is not about syntax. But if you insist I'll extend the test. Is it enough to include the check in one test file only? I mean that I'd like to check this syntax construction for one cpu, OK? Or you'd like to see it inside all 10 files?
> > In fact I checked it but decided not to include in the test because this test is not about syntax.
> I agree. But the existing tests are doing exhaustive coverage - e.g. see `sub`, `add`.
> 
> > Or you'd like to see it inside all 10 files?
> All these generic files should be identical other than the CPU specified in run line.
> One can argue that it is a bad design, to have to duplicate the tests for every CPU.
> But this is what it is...
> 
> So yes, all of them, please.
Do they actually have different encodings? I just thought they were commutable in the assembly but would generate the same encoding - @craig.topper do you know?


================
Comment at: test/tools/llvm-mca/X86/Atom/resources-x86_64.s:674
 
+xchgb %al, %bl
+xchgb %bl, %cl
----------------
I don't think only byte ops have special case AL instructions? It's just ax/eax/rax according to APMv3


https://reviews.llvm.org/D49912





More information about the llvm-commits mailing list