1 ; Test f128 floating-point conversion to/from integers on z14.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
5 ; Test signed i32->f128.
6 define void @f1(i32 %i, ptr %dst) {
8 ; CHECK: cxfbr %f0, %r2
9 ; CHECK: vmrhg %v0, %v0, %v2
10 ; CHECK: vst %v0, 0(%r3)
12 %conv = sitofp i32 %i to fp128
13 store fp128 %conv, ptr %dst
17 ; Test signed i64->f128.
18 define void @f2(i64 %i, ptr %dst) {
20 ; CHECK: cxgbr %f0, %r2
21 ; CHECK: vmrhg %v0, %v0, %v2
22 ; CHECK: vst %v0, 0(%r3)
24 %conv = sitofp i64 %i to fp128
25 store fp128 %conv, ptr %dst
29 ; Test unsigned i32->f128.
30 define void @f3(i32 %i, ptr %dst) {
32 ; CHECK: cxlfbr %f0, 0, %r2, 0
33 ; CHECK: vmrhg %v0, %v0, %v2
34 ; CHECK: vst %v0, 0(%r3)
36 %conv = uitofp i32 %i to fp128
37 store fp128 %conv, ptr %dst
41 ; Test unsigned i64->f128.
42 define void @f4(i64 %i, ptr %dst) {
44 ; CHECK: cxlgbr %f0, 0, %r2, 0
45 ; CHECK: vmrhg %v0, %v0, %v2
46 ; CHECK: vst %v0, 0(%r3)
48 %conv = uitofp i64 %i to fp128
49 store fp128 %conv, ptr %dst
53 ; Test signed f128->i32.
54 define i32 @f5(ptr %src) {
56 ; CHECK: vl %v0, 0(%r2)
57 ; CHECK: vrepg %v2, %v0, 1
58 ; CHECK: cfxbr %r2, 5, %f0
60 %f = load fp128, ptr %src
61 %conv = fptosi fp128 %f to i32
65 ; Test signed f128->i64.
66 define i64 @f6(ptr %src) {
68 ; CHECK: vl %v0, 0(%r2)
69 ; CHECK: vrepg %v2, %v0, 1
70 ; CHECK: cgxbr %r2, 5, %f0
72 %f = load fp128, ptr %src
73 %conv = fptosi fp128 %f to i64
77 ; Test unsigned f128->i32.
78 define i32 @f7(ptr %src) {
80 ; CHECK: vl %v0, 0(%r2)
81 ; CHECK: vrepg %v2, %v0, 1
82 ; CHECK: clfxbr %r2, 5, %f0, 0
84 %f = load fp128, ptr %src
85 %conv = fptoui fp128 %f to i32
89 ; Test unsigned f128->i64.
90 define i64 @f8(ptr %src) {
92 ; CHECK: vl %v0, 0(%r2)
93 ; CHECK: vrepg %v2, %v0, 1
94 ; CHECK: clgxbr %r2, 5, %f0, 0
96 %f = load fp128, ptr %src
97 %conv = fptoui fp128 %f to i64