[PATCH] D37184: [X86] Add constant pool decoding to more instructions

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 10:01:27 PDT 2017


RKSimon added a comment.

In https://reviews.llvm.org/D37184#853393, @chandlerc wrote:

> 1. I think we should just print hex everywhere, always. I keep trying to think of why we *shouldn't* print in hex, and I've got nothing...


+1 Definitely hex, not sure whether we should use leading zeros as well - will bulk things but will also makes things consistent.

> 2. I don't feel strongly about byte vs. other granualarity for AND/OR/XOR... Maybe byte-digit-separated single integer? So, `0xFF'FF'FF'FF'FF'FF...`. Dunno, don't feel strongly about any of this

No preference here, just not too dissimilar to what is being done everywhere else. Bytes are probably the most readable?

> 3. We should probably change the movdqa and such printing to use the same code for formatting the integers?

+1 Although not sure if it'll cause a massive number of test changes?



================
Comment at: lib/Target/X86/X86MCInstLower.cpp:1396-1405
+  for (unsigned i = 0; i < Vec.size(); ++i) {
+    if (i != 0)
+      CS << ",";
+    if (UndefElts[i])
+      CS << 'u';
+    else
+      CS << Vec[i];
----------------
spatel wrote:
> Can you detect a splat here and print something like "[0x1234 splat]"? That would greatly improve readability in the common case IMO, and make it clear in the odd case when the constant is not a splat.
This may work especially well for avx512 broadcast source instructions?


================
Comment at: lib/Target/X86/X86MCInstLower.cpp:1880
+    break;
+
+  case X86::ANDPDrm:
----------------
Add a TODO for other instructions (CMPs, MULs + SHIFTSs come to mind)?


https://reviews.llvm.org/D37184





More information about the llvm-commits mailing list