[PATCH] D59398: [X86] Remove the _alt forms of XOP VPCOM instructions. Use a combination of custom printing and custom parsing to achieve the same result and more

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 09:52:48 PDT 2019


craig.topper marked 3 inline comments as done.
craig.topper added inline comments.


================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:2517
+  // Push the immediate if we extracted one from the mnemonic.
+  if (ComparisonCode != ~0U && !isParsingIntelSyntax()) {
+    const MCExpr *ImmOp = MCConstantExpr::create(ComparisonCode,
----------------
RKSimon wrote:
> Is the plan to reuse this for the upcoming vcmpps/pd/ss/sd support?
Yes.


================
Comment at: test/tools/llvm-mca/X86/BdVer2/resources-xop.s:242
 # CHECK-NEXT:  2      7     1.00    *                   vpcmov	%ymm0, (%rax), %ymm1, %ymm3
-# CHECK-NEXT:  1      2     0.50                        vpcomb	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomb	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomd	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomd	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomq	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomq	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomub	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomub	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomud	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomud	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomuq	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomuq	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomuw	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomuw	$0, (%rax), %xmm0, %xmm3
-# CHECK-NEXT:  1      2     0.50                        vpcomw	$0, %xmm0, %xmm1, %xmm3
-# CHECK-NEXT:  1      7     0.50    *                   vpcomw	$0, (%rax), %xmm0, %xmm3
+# CHECK-NEXT:  1      2     0.50                        vpcomltb	%xmm0, %xmm1, %xmm3
+# CHECK-NEXT:  1      7     0.50    *                   vpcomltb	(%rax), %xmm0, %xmm3
----------------
lebedev.ri wrote:
> RKSimon wrote:
> > lebedev.ri wrote:
> > > So now that the immediate matters, should i add back these tests for the rest of immediates?
> > You can if you want, although IIRC the only thing that could show different behaviour is true/false - and we don't emit those.
> What i mean is, there does not seem to be other test changes other than these,
> so is there test coverage for printing the VPCOM with imm != `0`?
> I'm guessing no, and that is why i think the tests should be added.
There are MC tests for immediates other than 0, but they all used a special mnemonic and we verify the special mnemonic gets printed back out.

The only observable change in this patch is that if you use an explicit immediate of 0-7, that will now be printed with the special mnemonic.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59398/new/

https://reviews.llvm.org/D59398





More information about the llvm-commits mailing list