• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test conversion of floating-point values to signed i32s.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5; Test f32->i32.
6define i32 @f1(float %f) {
7; CHECK-LABEL: f1:
8; CHECK: cfebr %r2, 5, %f0
9; CHECK: br %r14
10  %conv = fptosi float %f to i32
11  ret i32 %conv
12}
13
14; Test f64->i32.
15define i32 @f2(double %f) {
16; CHECK-LABEL: f2:
17; CHECK: cfdbr %r2, 5, %f0
18; CHECK: br %r14
19  %conv = fptosi double %f to i32
20  ret i32 %conv
21}
22
23; Test f128->i32.
24define i32 @f3(fp128 *%src) {
25; CHECK-LABEL: f3:
26; CHECK: ld %f0, 0(%r2)
27; CHECK: ld %f2, 8(%r2)
28; CHECK: cfxbr %r2, 5, %f0
29; CHECK: br %r14
30  %f = load fp128, fp128 *%src
31  %conv = fptosi fp128 %f to i32
32  ret i32 %conv
33}
34