1; Test v2f64 rounding. 2; 3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s 4 5declare double @llvm.rint.f64(double) 6declare double @llvm.nearbyint.f64(double) 7declare double @llvm.floor.f64(double) 8declare double @llvm.ceil.f64(double) 9declare double @llvm.trunc.f64(double) 10declare double @llvm.round.f64(double) 11declare <2 x double> @llvm.rint.v2f64(<2 x double>) 12declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>) 13declare <2 x double> @llvm.floor.v2f64(<2 x double>) 14declare <2 x double> @llvm.ceil.v2f64(<2 x double>) 15declare <2 x double> @llvm.trunc.v2f64(<2 x double>) 16declare <2 x double> @llvm.round.v2f64(<2 x double>) 17 18define <2 x double> @f1(<2 x double> %val) { 19; CHECK-LABEL: f1: 20; CHECK: vfidb %v24, %v24, 0, 0 21; CHECK: br %r14 22 %res = call <2 x double> @llvm.rint.v2f64(<2 x double> %val) 23 ret <2 x double> %res 24} 25 26define <2 x double> @f2(<2 x double> %val) { 27; CHECK-LABEL: f2: 28; CHECK: vfidb %v24, %v24, 4, 0 29; CHECK: br %r14 30 %res = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %val) 31 ret <2 x double> %res 32} 33 34define <2 x double> @f3(<2 x double> %val) { 35; CHECK-LABEL: f3: 36; CHECK: vfidb %v24, %v24, 4, 7 37; CHECK: br %r14 38 %res = call <2 x double> @llvm.floor.v2f64(<2 x double> %val) 39 ret <2 x double> %res 40} 41 42define <2 x double> @f4(<2 x double> %val) { 43; CHECK-LABEL: f4: 44; CHECK: vfidb %v24, %v24, 4, 6 45; CHECK: br %r14 46 %res = call <2 x double> @llvm.ceil.v2f64(<2 x double> %val) 47 ret <2 x double> %res 48} 49 50define <2 x double> @f5(<2 x double> %val) { 51; CHECK-LABEL: f5: 52; CHECK: vfidb %v24, %v24, 4, 5 53; CHECK: br %r14 54 %res = call <2 x double> @llvm.trunc.v2f64(<2 x double> %val) 55 ret <2 x double> %res 56} 57 58define <2 x double> @f6(<2 x double> %val) { 59; CHECK-LABEL: f6: 60; CHECK: vfidb %v24, %v24, 4, 1 61; CHECK: br %r14 62 %res = call <2 x double> @llvm.round.v2f64(<2 x double> %val) 63 ret <2 x double> %res 64} 65 66define double @f7(<2 x double> %val) { 67; CHECK-LABEL: f7: 68; CHECK: wfidb %f0, %v24, 0, 0 69; CHECK: br %r14 70 %scalar = extractelement <2 x double> %val, i32 0 71 %res = call double @llvm.rint.f64(double %scalar) 72 ret double %res 73} 74 75define double @f8(<2 x double> %val) { 76; CHECK-LABEL: f8: 77; CHECK: wfidb %f0, %v24, 4, 0 78; CHECK: br %r14 79 %scalar = extractelement <2 x double> %val, i32 0 80 %res = call double @llvm.nearbyint.f64(double %scalar) 81 ret double %res 82} 83 84define double @f9(<2 x double> %val) { 85; CHECK-LABEL: f9: 86; CHECK: wfidb %f0, %v24, 4, 7 87; CHECK: br %r14 88 %scalar = extractelement <2 x double> %val, i32 0 89 %res = call double @llvm.floor.f64(double %scalar) 90 ret double %res 91} 92 93define double @f10(<2 x double> %val) { 94; CHECK-LABEL: f10: 95; CHECK: wfidb %f0, %v24, 4, 6 96; CHECK: br %r14 97 %scalar = extractelement <2 x double> %val, i32 0 98 %res = call double @llvm.ceil.f64(double %scalar) 99 ret double %res 100} 101 102define double @f11(<2 x double> %val) { 103; CHECK-LABEL: f11: 104; CHECK: wfidb %f0, %v24, 4, 5 105; CHECK: br %r14 106 %scalar = extractelement <2 x double> %val, i32 0 107 %res = call double @llvm.trunc.f64(double %scalar) 108 ret double %res 109} 110 111define double @f12(<2 x double> %val) { 112; CHECK-LABEL: f12: 113; CHECK: wfidb %f0, %v24, 4, 1 114; CHECK: br %r14 115 %scalar = extractelement <2 x double> %val, i32 0 116 %res = call double @llvm.round.f64(double %scalar) 117 ret double %res 118} 119