File: fp-conv-08.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,245,044 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,666; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (46 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (3)
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
42
43
44
45
46
; Test conversions of unsigned i64s to floating-point values (z10 only).
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s

; Test i64->f16. For z10, this results in just a single a libcall.
define half @f0(i64 %i) {
; CHECK-LABEL: f0:
; CHECK: cegbr
; CHECK: aebr
; CHECK: brasl %r14, __truncsfhf2@PLT
; CHECK: br %r14
  %conv = uitofp i64 %i to half
  ret half %conv
}

; Test i64->f32.  There's no native support for unsigned i64-to-fp conversions,
; but we should be able to implement them using signed i64-to-fp conversions.
define float @f1(i64 %i) {
; CHECK-LABEL: f1:
; CHECK: cegbr
; CHECK: aebr
; CHECK: br %r14
  %conv = uitofp i64 %i to float
  ret float %conv
}

; Test i64->f64.
define double @f2(i64 %i) {
; CHECK-LABEL: f2:
; CHECK: ldgr
; CHECK: adbr
; CHECK: br %r14
  %conv = uitofp i64 %i to double
  ret double %conv
}

; Test i64->f128.
define void @f3(i64 %i, ptr %dst) {
; CHECK-LABEL: f3:
; CHECK: cxgbr
; CHECK: axbr
; CHECK: br %r14
  %conv = uitofp i64 %i to fp128
  store fp128 %conv, ptr %dst
  ret void
}