[PATCH] D23273: [ARM] Improve tests for sxta{b|h} and uxta{b|h} instructions for Thumb

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 11:26:32 PDT 2016


t.p.northover added a subscriber: t.p.northover.

================
Comment at: lib/Target/ARM/ARMInstrThumb2.td:1993
@@ +1992,3 @@
+                       (t2SXTAH rGPR:$Rn, rGPR:$Rm, rot_imm:$rot)>;
+def : Thumb2ExtractPat<(add rGPR:$Rn, (sra (shl (srl rGPR:$Rm, rot_imm:$rot),
+                                                (i32 16)),
----------------
Shouldn't `rot_imm` be `imm8_or_16` since we're producing an `SXTAH`? Specifically, we're only matching an `srl` not a `rol` so an shifting by 24 will give the wrong answer.

================
Comment at: test/CodeGen/Thumb2/thumb2-sxt-uxt.ll:32
@@ +31,3 @@
+
+define i32 @test5(i32 %a, i8 %b) {
+; CHECK-LABEL: test5:
----------------
None of these tests are hitting the non-zero rotation cases.


https://reviews.llvm.org/D23273





More information about the llvm-commits mailing list