Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | 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.w 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: lsrs r0, r0, #8
     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