[PATCH] Add aliases for VAND imm to VBIC ~imm

Tim Northover t.p.northover at gmail.com
Tue Sep 9 05:36:59 PDT 2014


Hi Renato,

Have a razor, I think you've got a yak to shave...

================
Comment at: lib/Target/ARM/ARMInstrNEON.td:39
@@ +38,3 @@
+def nImmSplatNotI16 : Operand<i32> {
+  let PrintMethod = "printNEONModImmOperand";
+  let ParserMatchClass = nImmSplatNotI16AsmOperand;
----------------
PrintMethod shouldn't be needed since the aliases aren't canonical.

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:1629
@@ +1628,3 @@
+  bool isNEONi16splatNot() const {
+    return isNEONi16splat();
+  }
----------------
Is this right? From the ARM ARM it looks like the set of constants permitted is not invariant under Imm -> ~Imm.

Actually, the code above in isNEONi16Splat is wrong too (which is why your test happens to work anyway):
    $ echo "vbic.i16 d10, #0x03ff" | bin/llvm-mc -triple armv7 -show-inst
        vbic.i16 d10, #0x300

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:2409
@@ +2408,3 @@
+private:
+  unsigned validateNEONi16splatOperands(unsigned Value) const {
+    if (Value >= 256)
----------------
This isn't really a validation (which implies it might be invalid). Perhaps an "encodeNEON..."; if so, it should probably go into MCTargetDesc with the others.

http://reviews.llvm.org/D5263






More information about the llvm-commits mailing list