1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple armv6-- -filetype asm -o - %s | FileCheck %s
4 define i32 @test1(i32 %x) {
7 ; CHECK-NEXT: uxtb16 r0, r0
9 %tmp1 = and i32 %x, 16711935
13 define i32 @test2(i32 %x) {
16 ; CHECK-NEXT: uxtb16 r0, r0, ror #8
18 %tmp1 = lshr i32 %x, 8
19 %tmp2 = and i32 %tmp1, 16711935
23 define i32 @test3(i32 %x) {
26 ; CHECK-NEXT: uxtb16 r0, r0, ror #8
28 %tmp1 = lshr i32 %x, 8
29 %tmp2 = and i32 %tmp1, 16711935
33 define i32 @test4(i32 %x) {
36 ; CHECK-NEXT: uxtb16 r0, r0, ror #8
38 %tmp1 = lshr i32 %x, 8
39 %tmp6 = and i32 %tmp1, 16711935
43 define i32 @test5(i32 %x) {
46 ; CHECK-NEXT: uxtb16 r0, r0, ror #8
48 %tmp1 = lshr i32 %x, 8
49 %tmp2 = and i32 %tmp1, 16711935
53 define i32 @test6(i32 %x) {
56 ; CHECK-NEXT: uxtb16 r0, r0, ror #16
58 %tmp1 = lshr i32 %x, 16
59 %tmp2 = and i32 %tmp1, 255
60 %tmp4 = shl i32 %x, 16
61 %tmp5 = and i32 %tmp4, 16711680
62 %tmp6 = or i32 %tmp2, %tmp5
66 define i32 @test7(i32 %x) {
69 ; CHECK-NEXT: uxtb16 r0, r0, ror #16
71 %tmp1 = lshr i32 %x, 16
72 %tmp2 = and i32 %tmp1, 255
73 %tmp4 = shl i32 %x, 16
74 %tmp5 = and i32 %tmp4, 16711680
75 %tmp6 = or i32 %tmp2, %tmp5
79 define i32 @test8(i32 %x) {
82 ; CHECK-NEXT: uxtb16 r0, r0, ror #24
85 %tmp2 = and i32 %tmp1, 16711680
86 %tmp5 = lshr i32 %x, 24
87 %tmp6 = or i32 %tmp2, %tmp5
91 define i32 @test9(i32 %x) {
94 ; CHECK-NEXT: uxtb16 r0, r0, ror #24
96 %tmp1 = lshr i32 %x, 24
98 %tmp5 = and i32 %tmp4, 16711680
99 %tmp6 = or i32 %tmp5, %tmp1
103 ; FIXME: Failed to match uxtb16
104 define i32 @test10(i32 %p0) {
105 ; CHECK-LABEL: test10:
107 ; CHECK-NEXT: mov r1, #248
108 ; CHECK-NEXT: mov r2, #7
109 ; CHECK-NEXT: orr r1, r1, #16252928
110 ; CHECK-NEXT: orr r2, r2, #458752
111 ; CHECK-NEXT: and r1, r1, r0, lsr #7
112 ; CHECK-NEXT: and r0, r2, r0, lsr #12
113 ; CHECK-NEXT: orr r0, r0, r1
115 %tmp1 = lshr i32 %p0, 7
116 %tmp2 = and i32 %tmp1, 16253176
117 %tmp4 = lshr i32 %p0, 12
118 %tmp5 = and i32 %tmp4, 458759
119 %tmp7 = or i32 %tmp5, %tmp2
123 define i32 @test11(i32 %p0) {
124 ; CHECK-LABEL: test11:
126 ; CHECK-NEXT: mov r1, #1
127 ; CHECK-NEXT: and r0, r0, #3
128 ; CHECK-NEXT: orr r1, r1, #65536
129 ; CHECK-NEXT: lsl r0, r1, r0
130 ; CHECK-NEXT: lsr r0, r0, #1
131 ; CHECK-NEXT: uxtb16 r0, r0
134 %a = shl i32 65537, %p
136 %tmp7 = and i32 %b, 458759