1 ; RUN: llc -mtriple=arm-eabi -mattr=+v6 %s -o - | FileCheck %s 2 3 define i32 @test0(i8 %A) { 4 ; CHECK: test0 5 ; CHECK: sxtb r0, r0 6 %B = sext i8 %A to i32 7 ret i32 %B 8 } 9 10 define signext i8 @test1(i32 %A) { 11 ; CHECK: test1 12 ; CHECK: lsr r0, r0, #8 13 ; CHECK: sxtb r0, r0 14 %B = lshr i32 %A, 8 15 %C = shl i32 %A, 24 16 %D = or i32 %B, %C 17 %E = trunc i32 %D to i8 18 ret i8 %E 19 } 20 21 define signext i32 @test2(i32 %A, i32 %X) { 22 ; CHECK: test2 23 ; CHECK: sxtab r0, r1, r0 24 %B = lshr i32 %A, 8 25 %C = shl i32 %A, 24 26 %D = or i32 %B, %C 27 %E = trunc i32 %D to i8 28 %F = sext i8 %E to i32 29 %G = add i32 %F, %X 30 ret i32 %G 31 } 32