1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; Test conversion of floating-point values to unsigned i64s (z10 only).
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
6 ; z10 doesn't have native support for unsigned fp-to-i64 conversions;
7 ; they were added in z196 as the Convert to Logical family of instructions.
8 ; Convert via signed i64s instead.
11 define i64 @f1(float %f) {
14 ; CHECK-NEXT: larl %r1, .LCPI0_0
15 ; CHECK-NEXT: le %f1, 0(%r1)
16 ; CHECK-NEXT: cebr %f0, %f1
17 ; CHECK-NEXT: jnl .LBB0_2
18 ; CHECK-NEXT: # %bb.1:
19 ; CHECK-NEXT: cgebr %r2, 5, %f0
21 ; CHECK-NEXT: .LBB0_2:
22 ; CHECK-NEXT: sebr %f0, %f1
23 ; CHECK-NEXT: cgebr %r2, 5, %f0
24 ; CHECK-NEXT: xihf %r2, 2147483648
26 %conv = fptoui float %f to i64
31 define i64 @f2(double %f) {
34 ; CHECK-NEXT: larl %r1, .LCPI1_0
35 ; CHECK-NEXT: ldeb %f1, 0(%r1)
36 ; CHECK-NEXT: cdbr %f0, %f1
37 ; CHECK-NEXT: jnl .LBB1_2
38 ; CHECK-NEXT: # %bb.1:
39 ; CHECK-NEXT: cgdbr %r2, 5, %f0
41 ; CHECK-NEXT: .LBB1_2:
42 ; CHECK-NEXT: sdbr %f0, %f1
43 ; CHECK-NEXT: cgdbr %r2, 5, %f0
44 ; CHECK-NEXT: xihf %r2, 2147483648
46 %conv = fptoui double %f to i64
51 define i64 @f3(fp128 *%src) {
54 ; CHECK-NEXT: ld %f0, 0(%r2)
55 ; CHECK-NEXT: ld %f2, 8(%r2)
56 ; CHECK-NEXT: larl %r1, .LCPI2_0
57 ; CHECK-NEXT: lxeb %f1, 0(%r1)
58 ; CHECK-NEXT: cxbr %f0, %f1
59 ; CHECK-NEXT: jnl .LBB2_2
60 ; CHECK-NEXT: # %bb.1:
61 ; CHECK-NEXT: cgxbr %r2, 5, %f0
63 ; CHECK-NEXT: .LBB2_2:
64 ; CHECK-NEXT: sxbr %f0, %f1
65 ; CHECK-NEXT: cgxbr %r2, 5, %f0
66 ; CHECK-NEXT: xihf %r2, 2147483648
68 %f = load fp128, fp128 *%src
69 %conv = fptoui fp128 %f to i64