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

Renato Golin renato.golin at linaro.org
Tue Sep 9 13:05:09 PDT 2014


Thanks for the review, Tim. I'll refactor the names and types and start working on the acceptable cases and errors.

cheers,
--renato

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:1653-1654
@@ +1652,4 @@
+  bool isNEONi32splatNot() const {
+    if (isNEONByteReplicate(4))
+      return false; // Leave that for bytes replication and forbid by default.
+    if (!isImm())
----------------
t.p.northover wrote:
> Is this right? I don't know what it's trying to exclude for VBIC, but I'd be slightly surprised if just these 4 aliases also make it work for VAND too.
Honestly, I don't know. Until now, it was more like copy&paste than anything else. I'll start paying attention to the edge cases when the names and locations are correct and some of the cases can be dealt with, so it becomes easier to debug and trace the paths.

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:2434-2435
@@ +2433,4 @@
+    const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
+    unsigned Value = CE->getValue();
+    Value = ~Value & 0xffff;
+    Value = ARM_AM::encodeNEONi16splatOperands(Value);
----------------
t.p.northover wrote:
> It'd be nice if there was some consistency between the i16 and i32 variants here (int/int64_t/unsigned/...). It feels like there ought to be a good canonical representation.
The reason why one is unsigned and the other is uint64_t is because on the 32-bit case, there's a warning on a comparison with the sign bit in isNEONi32splat. I'll see if I can make it less confusing...

http://reviews.llvm.org/D5263






More information about the llvm-commits mailing list