1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -march=sparc | FileCheck %s
3 ; RUN: llc < %s -march=sparcel | FileCheck %s --check-prefix=CHECK-LE
5 ;; Bitcast should not do a runtime conversion, but rather emit a
6 ;; constant into integer registers directly.
8 define <2 x i32> @bitcast() nounwind {
9 ; CHECK-LABEL: bitcast:
11 ; CHECK-NEXT: sethi 1049856, %o0
13 ; CHECK-NEXT: mov %g0, %o1
15 ; CHECK-LE-LABEL: bitcast:
17 ; CHECK-LE-NEXT: sethi 1049856, %o1
19 ; CHECK-LE-NEXT: mov %g0, %o0
20 %1 = bitcast double 5.0 to <2 x i32>
24 ;; Same thing for a call using a double (which gets passed in integer
27 declare void @a(double)
28 define void @test_call() nounwind {
29 ; CHECK-LABEL: test_call:
31 ; CHECK-NEXT: save %sp, -96, %sp
32 ; CHECK-NEXT: sethi 1049856, %o0
34 ; CHECK-NEXT: mov %g0, %o1
38 ; CHECK-LE-LABEL: test_call:
40 ; CHECK-LE-NEXT: save %sp, -96, %sp
41 ; CHECK-LE-NEXT: sethi 1049856, %o1
42 ; CHECK-LE-NEXT: call a
43 ; CHECK-LE-NEXT: mov %g0, %o0
45 ; CHECK-LE-NEXT: restore
46 call void @a(double 5.0)
50 ;; And for a libcall emitted from the pow intrinsic. (libcall
51 ;; emission happens after SelectionDAG type legalization, so is a bit
52 ;; different than a normal function call. This was crashing before,
53 ;; due to an earlier broken workaround for this issue.)
55 declare double @llvm.pow.f64(double, double)
56 define double @test_intrins_call() nounwind {
57 ; CHECK-LABEL: test_intrins_call:
59 ; CHECK-NEXT: save %sp, -96, %sp
60 ; CHECK-NEXT: sethi 1048576, %o0
61 ; CHECK-NEXT: mov %g0, %o1
62 ; CHECK-NEXT: mov %o0, %o2
63 ; CHECK-NEXT: call pow
64 ; CHECK-NEXT: mov %g0, %o3
68 ; CHECK-LE-LABEL: test_intrins_call:
70 ; CHECK-LE-NEXT: save %sp, -96, %sp
71 ; CHECK-LE-NEXT: sethi 1048576, %o1
72 ; CHECK-LE-NEXT: mov %g0, %o0
73 ; CHECK-LE-NEXT: mov %g0, %o2
74 ; CHECK-LE-NEXT: call pow
75 ; CHECK-LE-NEXT: mov %o1, %o3
77 ; CHECK-LE-NEXT: restore
78 %1 = call double @llvm.pow.f64(double 2.0, double 2.0)