• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=sparc | FileCheck %s
2
3; TODO: actually fix the codegen to be optimal. At least we don't
4; crash for now, though...
5
6;; Bitcast should not do a runtime conversion, but rather emit a
7;; constant into integer registers directly.
8
9; CHECK-LABEL: bitcast:
10; TODO-CHECK: sethi 1049856, %o0
11; TODO-CHECK: sethi 0, %o1
12define <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
21; TODO-CHECK: sethi 1049856, %o0
22; TODO-CHECK: sethi 0, %o1
23declare void @a(double)
24define void @test_call() {
25  call void @a(double 5.0)
26  ret void
27}
28
29;; And for a libcall emitted from the pow intrinsic.  (libcall
30;; emission happens after SelectionDAG type legalization, so is a bit
31;; different than a normal function call. This was crashing before,
32;; due to an earlier broken workaround for this issue.)
33
34; CHECK-LABEL: test_intrins_call
35; TODO-CHECK: sethi 1049856, %o0
36; TODO-CHECK: sethi 0, %o1
37declare double @llvm.pow.f64(double, double)
38define double @test_intrins_call() {
39  %1 = call double @llvm.pow.f64(double 2.0, double 2.0)
40  ret double %1
41}
42