2014-08-13 21:42:19 +00:00
|
|
|
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=false -mtriple=armv7-apple-ios < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
|
|
|
|
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=false -mtriple=armv7-linux-gnueabi < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
|
2014-08-19 19:05:24 +00:00
|
|
|
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=false -mtriple=thumbv7-apple-ios < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
|
|
|
|
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=true -mtriple=thumbv7-apple-ios < %s | FileCheck %s --check-prefix=CHECK --check-prefix=THUMB
|
|
|
|
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=true -mtriple=armv7-apple-ios < %s | FileCheck %s --check-prefix=MOVT
|
2011-11-11 00:36:21 +00:00
|
|
|
; rdar://10412592
|
|
|
|
|
|
|
|
define void @t1() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t1
|
|
|
|
; CHECK: mvn r0, #0
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @foo(i32)
|
|
|
|
|
|
|
|
define void @t2() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t2
|
|
|
|
; CHECK: mvn r0, #233
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -234)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @t3() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t3
|
|
|
|
; CHECK: mvn r0, #256
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -257)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Load from constant pool
|
|
|
|
define void @t4() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; ARM-LABEL: t4
|
|
|
|
; ARM: ldr r0
|
|
|
|
; THUMB-LABEL: t4
|
|
|
|
; THUMB: movw r0, #65278
|
|
|
|
; THUMB: movt r0, #65535
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -258)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @t5() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t5
|
|
|
|
; CHECK: mvn r0, #65280
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -65281)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @t6() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t6
|
|
|
|
; CHECK: mvn r0, #978944
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -978945)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @t7() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t7
|
|
|
|
; CHECK: mvn r0, #267386880
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -267386881)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @t8() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t8
|
|
|
|
; CHECK: mvn r0, #65280
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -65281)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @t9() nounwind {
|
|
|
|
entry:
|
2014-08-19 19:05:24 +00:00
|
|
|
; CHECK-LABEL: t9
|
|
|
|
; CHECK: mvn r0, #2130706432
|
2011-11-11 00:36:21 +00:00
|
|
|
call void @foo(i32 -2130706433)
|
|
|
|
ret void
|
2011-12-20 18:26:50 +00:00
|
|
|
}
|
2014-08-14 23:29:49 +00:00
|
|
|
|
|
|
|
; Load from constant pool.
|
|
|
|
define i32 @t10(i32 %a) {
|
2014-08-15 17:23:20 +00:00
|
|
|
; MOVT-LABEL: t10
|
|
|
|
; MOVT: ldr
|
2014-08-14 23:29:49 +00:00
|
|
|
%1 = xor i32 -1998730207, %a
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
|