[PATCH] [ARM64] Add proper bounds checking/diagnostics to logical shifts

Tim Northover t.p.northover at gmail.com
Fri May 9 11:20:25 PDT 2014


Hi Bradley,

I've got one nit-pick here. Not a correctness issue or anything...

================
Comment at: lib/Target/ARM64/ARM64InstrFormats.td:553-557
@@ -536,7 +552,7 @@
   let PrintMethod = "printShiftedRegister";
-  let MIOperandInfo = (ops regclass, logical_shift);
+  let MIOperandInfo = (ops regclass, !cast<Operand>("logical_shift" # width));
 }
 
-def logical_shifted_reg32 : logical_shifted_reg<i32, GPR32>;
-def logical_shifted_reg64 : logical_shifted_reg<i64, GPR64>;
+def logical_shifted_reg32 : logical_shifted_reg<i32, GPR32, 32>;
+def logical_shifted_reg64 : logical_shifted_reg<i64, GPR64, 64>;
 
----------------
I think it'd be better to pass the entire logical_shiftXY operand through here.

I view casting strings to particular Record types as a last ditch solution when you'd otherwise have to pass dozens of them up the hierarchy.

http://reviews.llvm.org/D3701






More information about the llvm-commits mailing list