62 lines · plain
1; RUN: llc -mtriple=thumb-eabi -mattr=+v6t2 %s -o - | FileCheck %s2 3%struct.F = type { [3 x i8], i8 }4 5@X = common global %struct.F zeroinitializer, align 4 ; <ptr> [#uses=1]6 7define void @f1([1 x i32] %f.coerce0) nounwind {8entry:9; CHECK: f110; CHECK: movs r2, #1011; CHECK: bfi r1, r2, #22, #412 %0 = load i32, ptr @X, align 4 ; <i32> [#uses=1]13 %1 = and i32 %0, -62914561 ; <i32> [#uses=1]14 %2 = or i32 %1, 41943040 ; <i32> [#uses=1]15 store i32 %2, ptr @X, align 416 ret void17}18 19define i32 @f2(i32 %A, i32 %B) nounwind readnone optsize {20entry:21; CHECK: f222; CHECK: lsrs r1, r1, #723; CHECK: bfi r0, r1, #7, #1624 %and = and i32 %A, -8388481 ; <i32> [#uses=1]25 %and2 = and i32 %B, 8388480 ; <i32> [#uses=1]26 %or = or i32 %and2, %and ; <i32> [#uses=1]27 ret i32 %or28}29 30define i32 @f3(i32 %A, i32 %B) nounwind readnone optsize {31entry:32; CHECK: f333; CHECK: lsrs {{.*}}, #734; CHECK: bfi {{.*}}, #7, #1635 %and = and i32 %A, 8388480 ; <i32> [#uses=1]36 %and2 = and i32 %B, -8388481 ; <i32> [#uses=1]37 %or = or i32 %and2, %and ; <i32> [#uses=1]38 ret i32 %or39}40 41; rdar://875205642define i32 @f4(i32 %a) nounwind {43; CHECK: f444; CHECK: movw [[R1:r[0-9]+]], #313745; CHECK: bfi [[R1]], {{.*}}, #15, #546 %1 = shl i32 %a, 1547 %ins7 = and i32 %1, 101580848 %ins12 = or i32 %ins7, 313749 ret i32 %ins1250}51 52; rdar://917750253define i32 @f5(i32 %a, i32 %b) nounwind readnone {54entry:55; CHECK: f556; CHECK-NOT: bfi r0, r2, #0, #157%and = and i32 %a, 258%b.masked = and i32 %b, -259%and3 = or i32 %b.masked, %and60ret i32 %and361}62