1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
3 ; Test f128 to i128 bitcasts.
5 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 \
6 ; RUN: | FileCheck -check-prefix=Z10 %s
8 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 \
9 ; RUN: | FileCheck -check-prefix=Z14 %s
11 define i64 @extract_float_hi(fp128* %0, fp128* %1) {
12 ; Z10-LABEL: extract_float_hi:
13 ; Z10: # %bb.0: # %entry
14 ; Z10-NEXT: ld %f0, 0(%r2)
15 ; Z10-NEXT: ld %f2, 8(%r2)
16 ; Z10-NEXT: ld %f1, 0(%r3)
17 ; Z10-NEXT: ld %f3, 8(%r3)
18 ; Z10-NEXT: axbr %f1, %f0
19 ; Z10-NEXT: lgdr %r2, %f1
22 ; Z14-LABEL: extract_float_hi:
23 ; Z14: # %bb.0: # %entry
24 ; Z14-NEXT: vl %v0, 0(%r2), 3
25 ; Z14-NEXT: vl %v1, 0(%r3), 3
26 ; Z14-NEXT: wfaxb %v0, %v0, %v1
27 ; Z14-NEXT: vlgvg %r2, %v0, 0
30 %x = load fp128, fp128* %0
31 %y = load fp128, fp128* %1
32 %add = fadd fp128 %x, %y
33 %2 = bitcast fp128 %add to i128
34 %u.sroa.0.0.extract.shift = lshr i128 %2, 64
35 %u.sroa.0.0.extract.trunc = trunc i128 %u.sroa.0.0.extract.shift to i64
36 ret i64 %u.sroa.0.0.extract.trunc
39 define i64 @extract_float_lo(fp128* %0, fp128* %1) {
40 ; Z10-LABEL: extract_float_lo:
41 ; Z10: # %bb.0: # %entry
42 ; Z10-NEXT: ld %f0, 0(%r2)
43 ; Z10-NEXT: ld %f2, 8(%r2)
44 ; Z10-NEXT: ld %f1, 0(%r3)
45 ; Z10-NEXT: ld %f3, 8(%r3)
46 ; Z10-NEXT: axbr %f1, %f0
47 ; Z10-NEXT: lgdr %r2, %f3
50 ; Z14-LABEL: extract_float_lo:
51 ; Z14: # %bb.0: # %entry
52 ; Z14-NEXT: vl %v0, 0(%r2), 3
53 ; Z14-NEXT: vl %v1, 0(%r3), 3
54 ; Z14-NEXT: wfaxb %v0, %v0, %v1
55 ; Z14-NEXT: vlgvg %r2, %v0, 1
58 %x = load fp128, fp128* %0
59 %y = load fp128, fp128* %1
60 %add = fadd fp128 %x, %y
61 %2 = bitcast fp128 %add to i128
62 %u.sroa.0.0.extract.trunc = trunc i128 %2 to i64
63 ret i64 %u.sroa.0.0.extract.trunc
66 define i128 @bitcast_128(fp128* %0, fp128* %1) {
67 ; Z10-LABEL: bitcast_128:
68 ; Z10: # %bb.0: # %entry
69 ; Z10-NEXT: ld %f0, 0(%r3)
70 ; Z10-NEXT: ld %f2, 8(%r3)
71 ; Z10-NEXT: ld %f1, 0(%r4)
72 ; Z10-NEXT: ld %f3, 8(%r4)
73 ; Z10-NEXT: axbr %f1, %f0
74 ; Z10-NEXT: lgdr %r0, %f3
75 ; Z10-NEXT: lgdr %r1, %f1
76 ; Z10-NEXT: oill %r1, 1
77 ; Z10-NEXT: oill %r0, 3
78 ; Z10-NEXT: stg %r0, 8(%r2)
79 ; Z10-NEXT: stg %r1, 0(%r2)
82 ; Z14-LABEL: bitcast_128:
83 ; Z14: # %bb.0: # %entry
84 ; Z14-NEXT: vl %v0, 0(%r3), 3
85 ; Z14-NEXT: vl %v1, 0(%r4), 3
86 ; Z14-NEXT: wfaxb %v0, %v0, %v1
87 ; Z14-NEXT: vlgvg %r0, %v0, 1
88 ; Z14-NEXT: vlgvg %r1, %v0, 0
89 ; Z14-NEXT: oill %r1, 1
90 ; Z14-NEXT: oill %r0, 3
91 ; Z14-NEXT: stg %r0, 8(%r2)
92 ; Z14-NEXT: stg %r1, 0(%r2)
95 %x = load fp128, fp128* %0
96 %y = load fp128, fp128* %1
97 %add = fadd fp128 %x, %y
98 %i = bitcast fp128 %add to i128
99 %hibit = shl i128 1, 64
100 %i2 = or i128 %i, %hibit