1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s 2 3 define i32 @sbfx1(i32 %a) { 4 ; CHECK: sbfx1 5 ; CHECK: sbfx r0, r0, #7, #11 6 %t1 = lshr i32 %a, 7 7 %t2 = trunc i32 %t1 to i11 8 %t3 = sext i11 %t2 to i32 9 ret i32 %t3 10 } 11 12 define i32 @ubfx1(i32 %a) { 13 ; CHECK: ubfx1 14 ; CHECK: ubfx r0, r0, #7, #11 15 %t1 = lshr i32 %a, 7 16 %t2 = trunc i32 %t1 to i11 17 %t3 = zext i11 %t2 to i32 18 ret i32 %t3 19 } 20 21 define i32 @ubfx2(i32 %a) { 22 ; CHECK: ubfx2 23 ; CHECK: ubfx r0, r0, #7, #11 24 %t1 = lshr i32 %a, 7 25 %t2 = and i32 %t1, 2047 26 ret i32 %t2 27 } 28 29