blob: 8b38eee7001977e6c5e30d4cfe18cd8c0d2388f7 [file] [log] [blame]
James Y Knight692e0372015-10-09 21:36:19 +00001; RUN: llc < %s -march=sparc | FileCheck %s
Daniel Cederman92dadc02018-08-27 07:14:53 +00002; RUN: llc < %s -march=sparcel | FileCheck %s --check-prefix=CHECK-LE
James Y Knight692e0372015-10-09 21:36:19 +00003
4;; Bitcast should not do a runtime conversion, but rather emit a
5;; constant into integer registers directly.
6
7; CHECK-LABEL: bitcast:
Daniel Cederman92dadc02018-08-27 07:14:53 +00008; CHECK: sethi 1049856, %o0
9; CHECK: mov %g0, %o1
10; CHECK-LE: mov %g0, %o0
11; CHECK-LE: sethi 1049856, %o1
James Y Knight692e0372015-10-09 21:36:19 +000012define <2 x i32> @bitcast() {
13 %1 = bitcast double 5.0 to <2 x i32>
14 ret <2 x i32> %1
15}
16
17;; Same thing for a call using a double (which gets passed in integer
18;; registers)
19
20; CHECK-LABEL: test_call
Daniel Cederman92dadc02018-08-27 07:14:53 +000021; CHECK: sethi 1049856, %o0
22; CHECK: mov %g0, %o1
23; CHECK-LE: mov %g0, %o0
24; CHECK-LE: sethi 1049856, %o1
James Y Knight692e0372015-10-09 21:36:19 +000025declare void @a(double)
26define void @test_call() {
27 call void @a(double 5.0)
28 ret void
29}
30
31;; And for a libcall emitted from the pow intrinsic. (libcall
32;; emission happens after SelectionDAG type legalization, so is a bit
33;; different than a normal function call. This was crashing before,
34;; due to an earlier broken workaround for this issue.)
35
36; CHECK-LABEL: test_intrins_call
Daniel Cederman92dadc02018-08-27 07:14:53 +000037; CHECK: sethi 1048576, %o0
38; CHECK: mov %g0, %o1
39; CHECK: mov %o0, %o2
40; CHECK: mov %o1, %o3
41; CHECK-LE: mov %g0, %o0
42; CHECK-LE: sethi 1048576, %o1
James Y Knight692e0372015-10-09 21:36:19 +000043declare double @llvm.pow.f64(double, double)
44define double @test_intrins_call() {
45 %1 = call double @llvm.pow.f64(double 2.0, double 2.0)
46 ret double %1
47}