brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · df0b81f Raw
96 lines · plain
1; Test conversions between integer and float elements.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5; Test conversion of f64s to signed i64s.6define <2 x i64> @f1(<2 x double> %doubles) {7; CHECK-LABEL: f1:8; CHECK: vcgdb %v24, %v24, 0, 59; CHECK: br %r1410  %dwords = fptosi <2 x double> %doubles to <2 x i64>11  ret <2 x i64> %dwords12}13 14; Test conversion of f64s to unsigned i64s.15define <2 x i64> @f2(<2 x double> %doubles) {16; CHECK-LABEL: f2:17; CHECK: vclgdb %v24, %v24, 0, 518; CHECK: br %r1419  %dwords = fptoui <2 x double> %doubles to <2 x i64>20  ret <2 x i64> %dwords21}22 23; Test conversion of signed i64s to f64s.24define <2 x double> @f3(<2 x i64> %dwords) {25; CHECK-LABEL: f3:26; CHECK: vcdgb %v24, %v24, 0, 027; CHECK: br %r1428  %doubles = sitofp <2 x i64> %dwords to <2 x double>29  ret <2 x double> %doubles30}31 32; Test conversion of unsigned i64s to f64s.33define <2 x double> @f4(<2 x i64> %dwords) {34; CHECK-LABEL: f4:35; CHECK: vcdlgb %v24, %v24, 0, 036; CHECK: br %r1437  %doubles = uitofp <2 x i64> %dwords to <2 x double>38  ret <2 x double> %doubles39}40 41; Test conversion of f64s to signed i32s, which must compile.42define void @f5(<2 x double> %doubles, ptr %ptr) {43  %words = fptosi <2 x double> %doubles to <2 x i32>44  store <2 x i32> %words, ptr %ptr45  ret void46}47 48; Test conversion of f64s to unsigned i32s, which must compile.49define void @f6(<2 x double> %doubles, ptr %ptr) {50  %words = fptoui <2 x double> %doubles to <2 x i32>51  store <2 x i32> %words, ptr %ptr52  ret void53}54 55; Test conversion of signed i32s to f64s, which must compile.56define <2 x double> @f7(ptr %ptr) {57  %words = load <2 x i32>, ptr %ptr58  %doubles = sitofp <2 x i32> %words to <2 x double>59  ret <2 x double> %doubles60}61 62; Test conversion of unsigned i32s to f64s, which must compile.63define <2 x double> @f8(ptr %ptr) {64  %words = load <2 x i32>, ptr %ptr65  %doubles = uitofp <2 x i32> %words to <2 x double>66  ret <2 x double> %doubles67}68 69; Test conversion of f32s to signed i64s, which must compile.70define <2 x i64> @f9(ptr %ptr) {71  %floats = load <2 x float>, ptr %ptr72  %dwords = fptosi <2 x float> %floats to <2 x i64>73  ret <2 x i64> %dwords74}75 76; Test conversion of f32s to unsigned i64s, which must compile.77define <2 x i64> @f10(ptr %ptr) {78  %floats = load <2 x float>, ptr %ptr79  %dwords = fptoui <2 x float> %floats to <2 x i64>80  ret <2 x i64> %dwords81}82 83; Test conversion of signed i64s to f32, which must compile.84define void @f11(<2 x i64> %dwords, ptr %ptr) {85  %floats = sitofp <2 x i64> %dwords to <2 x float>86  store <2 x float> %floats, ptr %ptr87  ret void88}89 90; Test conversion of unsigned i64s to f32, which must compile.91define void @f12(<2 x i64> %dwords, ptr %ptr) {92  %floats = uitofp <2 x i64> %dwords to <2 x float>93  store <2 x float> %floats, ptr %ptr94  ret void95}96