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: sxtb r0, r0, ror #8 13 %B = lshr i32 %A, 8 14 %C = shl i32 %A, 24 15 %D = or i32 %B, %C 16 %E = trunc i32 %D to i8 17 ret i8 %E 18 } 19 20 define signext i32 @test2(i32 %A, i32 %X) { 21 ; CHECK: test2 22 ; CHECK: sxtab r0, r1, r0 23 %B = lshr i32 %A, 8 24 %C = shl i32 %A, 24 25 %D = or i32 %B, %C 26 %E = trunc i32 %D to i8 27 %F = sext i8 %E to i32 28 %G = add i32 %F, %X 29 ret i32 %G 30 } 31