summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Thumb2/thumb2-uxt_rot.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-uxt_rot.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-uxt_rot.ll26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-uxt_rot.ll b/test/CodeGen/Thumb2/thumb2-uxt_rot.ll
index bcd4a0f..4afea89 100644
--- a/test/CodeGen/Thumb2/thumb2-uxt_rot.ll
+++ b/test/CodeGen/Thumb2/thumb2-uxt_rot.ll
@@ -24,8 +24,8 @@ define zeroext i32 @test2(i32 %A.u, i32 %B.u) {
}
define zeroext i32 @test3(i32 %A.u) {
-; A8: test3
-; A8: uxth.w r0, r0, ror #8
+; A8-LABEL: test3
+; A8: ubfx r0, r0, #8, #16
%B.u = lshr i32 %A.u, 8
%C.u = shl i32 %A.u, 24
%D.u = or i32 %B.u, %C.u
@@ -33,3 +33,25 @@ define zeroext i32 @test3(i32 %A.u) {
%F.u = zext i16 %E.u to i32
ret i32 %F.u
}
+
+define i32 @test4(i32 %A, i32 %X) {
+; A8-LABEL: test4:
+; A8: uxtab r0, r0, r1, ror #16
+ %X.hi = lshr i32 %X, 16
+ %X.trunc = trunc i32 %X.hi to i8
+ %addend = zext i8 %X.trunc to i32
+
+ %sum = add i32 %A, %addend
+ ret i32 %sum
+}
+
+define i32 @test5(i32 %A, i32 %X) {
+; A8-LABEL: test5:
+; A8: uxtah r0, r0, r1, ror #8
+ %X.hi = lshr i32 %X, 8
+ %X.trunc = trunc i32 %X.hi to i16
+ %addend = zext i16 %X.trunc to i32
+
+ %sum = add i32 %A, %addend
+ ret i32 %sum
+}