File: float-constants.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (41 lines) | stat: -rw-r--r-- 1,195 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
; RUN: llc < %s -march=sparc | FileCheck %s

; TODO: actually fix the codegen to be optimal. At least we don't
; crash for now, though...

;; Bitcast should not do a runtime conversion, but rather emit a
;; constant into integer registers directly.

; CHECK-LABEL: bitcast:
; TODO-CHECK: sethi 1049856, %o0
; TODO-CHECK: sethi 0, %o1
define <2 x i32> @bitcast() {
  %1 = bitcast double 5.0 to <2 x i32>
  ret <2 x i32> %1
}

;; Same thing for a call using a double (which gets passed in integer
;; registers)

; CHECK-LABEL: test_call
; TODO-CHECK: sethi 1049856, %o0
; TODO-CHECK: sethi 0, %o1
declare void @a(double)
define void @test_call() {
  call void @a(double 5.0)
  ret void
}

;; And for a libcall emitted from the pow intrinsic.  (libcall
;; emission happens after SelectionDAG type legalization, so is a bit
;; different than a normal function call. This was crashing before,
;; due to an earlier broken workaround for this issue.)

; CHECK-LABEL: test_intrins_call
; TODO-CHECK: sethi 1049856, %o0
; TODO-CHECK: sethi 0, %o1
declare double @llvm.pow.f64(double, double)
define double @test_intrins_call() {
  %1 = call double @llvm.pow.f64(double 2.0, double 2.0)
  ret double %1
}