2014-04-04 07:47:24 +08:00
|
|
|
; RUN: llc -mtriple=thumb-eabi %s -o - | FileCheck %s
|
2009-06-24 14:36:07 +08:00
|
|
|
|
|
|
|
define i32 @test1(i32 %X) {
|
|
|
|
entry:
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test1:
|
2009-07-11 14:43:01 +08:00
|
|
|
; CHECK: lsrs r0, r0, #31
|
2009-06-24 14:36:07 +08:00
|
|
|
icmp slt i32 %X, 0 ; <i1>:0 [#uses=1]
|
|
|
|
zext i1 %0 to i32 ; <i32>:1 [#uses=1]
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
|
2017-03-22 23:09:30 +08:00
|
|
|
define i32 @test2(i32 %X) {
|
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: test2:
|
|
|
|
; CHECK: lsls r1, r1, #31
|
|
|
|
; CHECK-NEXT: adds
|
|
|
|
%tmp1 = sub i32 %X, 2147483648
|
|
|
|
ret i32 %tmp1
|
|
|
|
}
|
|
|
|
|