[llvm-commits] XOP encoding patch

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Mon Dec 12 10:28:53 PST 2011


Hi,

On Mon, Dec 12, 2011 at 3:47 PM, Jan Sjodin <jan_sjodin at yahoo.com> wrote:
> I create a new patch which has all the XOP instructions.

Ok, the XOP8, XOP9 seems fair enough for now.
Like Eli said, your patch again use tabs:

+      // If there is an additional 5th operand it must be an immediate, which
+      // is encoded in bits[3:0]
+      if(CurOp != NumOps) {
+        const MCOperand &MIMM = MI.getOperand(CurOp++);
+        if(MIMM.isImm()) {
+          unsigned Val = MIMM.getImm();
+	  assert(Val < 16 && "Immediate operand value out of range");
+	  RegNum |= Val;
+	}
+      }

Also, you're using 4 spaces instead of 2 in only a few places:

+let isAsmParserOnly = 1 in {
+    defm VPROTW : xop3opimm<0xC1, "vprotw">;
+    defm VPROTQ : xop3opimm<0xC3, "vprotq">;
+    defm VPROTD : xop3opimm<0xC2, "vprotd">;
+    defm VPROTB : xop3opimm<0xC0, "vprotb">;
+}

Fix this and the others and commit.

One last thing: commit the encoding bits and the encoder logic in a
different commit from the instructions, to make it easy to track the
encoding changes in the future if someone needs to search for it.

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc



More information about the llvm-commits mailing list