• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test conversion of floating-point values to unsigned i64s (z10 only).
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
4
5; z10 doesn't have native support for unsigned fp-to-i64 conversions;
6; they were added in z196 as the Convert to Logical family of instructions.
7; Convert via signed i64s instead.
8
9; Test f32->i64.
10define i64 @f1(float %f) {
11; CHECK-LABEL: f1:
12; CHECK: cebr
13; CHECK: sebr
14; CHECK: cgebr
15; CHECK: xihf
16; CHECK: br %r14
17  %conv = fptoui float %f to i64
18  ret i64 %conv
19}
20
21; Test f64->i64.
22define i64 @f2(double %f) {
23; CHECK-LABEL: f2:
24; CHECK: cdbr
25; CHECK: sdbr
26; CHECK: cgdbr
27; CHECK: xihf
28; CHECK: br %r14
29  %conv = fptoui double %f to i64
30  ret i64 %conv
31}
32
33; Test f128->i64.
34define i64 @f3(fp128 *%src) {
35; CHECK-LABEL: f3:
36; CHECK: cxbr
37; CHECK: sxbr
38; CHECK: cgxbr
39; CHECK: xihf
40; CHECK: br %r14
41  %f = load fp128, fp128 *%src
42  %conv = fptoui fp128 %f to i64
43  ret i64 %conv
44}
45