2014-05-24 12:50:23 +00:00
|
|
|
; RUN: llc -verify-machineinstrs -o - %s -mtriple=arm64-apple-ios7.0 | FileCheck %s --check-prefix=CHECK
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
define i64 @test0() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test0:
|
2013-01-31 12:12:40 +00:00
|
|
|
; Not produced by move wide instructions, but good to make sure we can return 0 anyway:
|
|
|
|
; CHECK: mov x0, xzr
|
|
|
|
ret i64 0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test1() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test1:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr w0, wzr, #0x1
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test2() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test2:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr w0, wzr, #0xffff
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 65535
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test3() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test3:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr w0, wzr, #0x10000
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 65536
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test4() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test4:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr w0, wzr, #0xffff0000
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 4294901760
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test5() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test5:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr x0, xzr, #0x100000000
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 4294967296
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test6() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test6:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr x0, xzr, #0xffff00000000
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 281470681743360
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test7() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test7:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr x0, xzr, #0x1000000000000
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 281474976710656
|
|
|
|
}
|
|
|
|
|
|
|
|
; A 32-bit MOVN can generate some 64-bit patterns that a 64-bit one
|
|
|
|
; couldn't. Useful even for i64
|
|
|
|
define i64 @test8() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test8:
|
2014-04-30 11:19:40 +00:00
|
|
|
; CHECK: movn w0, #{{60875|0xedcb}}
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 4294906420
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test9() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test9:
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: movn x0, #0
|
|
|
|
ret i64 -1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test10() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test10:
|
2014-04-30 11:19:40 +00:00
|
|
|
; CHECK: movn x0, #{{60875|0xedcb}}, lsl #16
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 18446744069720047615
|
|
|
|
}
|
|
|
|
|
|
|
|
; For reasonably legitimate reasons returning an i32 results in the
|
|
|
|
; selection of an i64 constant, so we need a different idiom to test that selection
|
|
|
|
@var32 = global i32 0
|
|
|
|
|
|
|
|
define void @test11() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test11:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: str wzr
|
2013-01-31 12:12:40 +00:00
|
|
|
store i32 0, i32* @var32
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test12() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test12:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr {{w[0-9]+}}, wzr, #0x1
|
2013-01-31 12:12:40 +00:00
|
|
|
store i32 1, i32* @var32
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test13() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test13:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr {{w[0-9]+}}, wzr, #0xffff
|
2013-01-31 12:12:40 +00:00
|
|
|
store i32 65535, i32* @var32
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test14() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test14:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr {{w[0-9]+}}, wzr, #0x10000
|
2013-01-31 12:12:40 +00:00
|
|
|
store i32 65536, i32* @var32
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test15() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test15:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr {{w[0-9]+}}, wzr, #0xffff0000
|
2013-01-31 12:12:40 +00:00
|
|
|
store i32 4294901760, i32* @var32
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test16() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test16:
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: movn {{w[0-9]+}}, #0
|
|
|
|
store i32 -1, i32* @var32
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test17() {
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test17:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; Mustn't MOVN w0 here.
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: orr x0, xzr, #0xfffffffffffffffd
|
2013-01-31 12:12:40 +00:00
|
|
|
ret i64 -3
|
|
|
|
}
|