1; RUN: llc -mcpu=pwr6 -mattr=+altivec < %s | FileCheck %s 2 3; Check vector round to single-precision toward -infinity (vrfim) 4; instruction generation using Altivec. 5 6target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64" 7target triple = "powerpc64-unknown-linux-gnu" 8 9declare <2 x double> @llvm.floor.v2f64(<2 x double> %p) 10define <2 x double> @floor_v2f64(<2 x double> %p) 11{ 12 %t = call <2 x double> @llvm.floor.v2f64(<2 x double> %p) 13 ret <2 x double> %t 14} 15; CHECK-LABEL: floor_v2f64: 16; CHECK: frim 17; CHECK: frim 18 19declare <4 x double> @llvm.floor.v4f64(<4 x double> %p) 20define <4 x double> @floor_v4f64(<4 x double> %p) 21{ 22 %t = call <4 x double> @llvm.floor.v4f64(<4 x double> %p) 23 ret <4 x double> %t 24} 25; CHECK-LABEL: floor_v4f64: 26; CHECK: frim 27; CHECK: frim 28; CHECK: frim 29; CHECK: frim 30 31declare <2 x double> @llvm.ceil.v2f64(<2 x double> %p) 32define <2 x double> @ceil_v2f64(<2 x double> %p) 33{ 34 %t = call <2 x double> @llvm.ceil.v2f64(<2 x double> %p) 35 ret <2 x double> %t 36} 37; CHECK-LABEL: ceil_v2f64: 38; CHECK: frip 39; CHECK: frip 40 41declare <4 x double> @llvm.ceil.v4f64(<4 x double> %p) 42define <4 x double> @ceil_v4f64(<4 x double> %p) 43{ 44 %t = call <4 x double> @llvm.ceil.v4f64(<4 x double> %p) 45 ret <4 x double> %t 46} 47; CHECK-LABEL: ceil_v4f64: 48; CHECK: frip 49; CHECK: frip 50; CHECK: frip 51; CHECK: frip 52 53declare <2 x double> @llvm.trunc.v2f64(<2 x double> %p) 54define <2 x double> @trunc_v2f64(<2 x double> %p) 55{ 56 %t = call <2 x double> @llvm.trunc.v2f64(<2 x double> %p) 57 ret <2 x double> %t 58} 59; CHECK-LABEL: trunc_v2f64: 60; CHECK: friz 61; CHECK: friz 62 63declare <4 x double> @llvm.trunc.v4f64(<4 x double> %p) 64define <4 x double> @trunc_v4f64(<4 x double> %p) 65{ 66 %t = call <4 x double> @llvm.trunc.v4f64(<4 x double> %p) 67 ret <4 x double> %t 68} 69; CHECK-LABEL: trunc_v4f64: 70; CHECK: friz 71; CHECK: friz 72; CHECK: friz 73; CHECK: friz 74 75declare <2 x double> @llvm.nearbyint.v2f64(<2 x double> %p) 76define <2 x double> @nearbyint_v2f64(<2 x double> %p) 77{ 78 %t = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %p) 79 ret <2 x double> %t 80} 81; CHECK-LABEL: nearbyint_v2f64: 82; CHECK: bl nearbyint 83; CHECK: bl nearbyint 84 85declare <4 x double> @llvm.nearbyint.v4f64(<4 x double> %p) 86define <4 x double> @nearbyint_v4f64(<4 x double> %p) 87{ 88 %t = call <4 x double> @llvm.nearbyint.v4f64(<4 x double> %p) 89 ret <4 x double> %t 90} 91; CHECK-LABEL: nearbyint_v4f64: 92; CHECK: bl nearbyint 93; CHECK: bl nearbyint 94; CHECK: bl nearbyint 95; CHECK: bl nearbyint 96 97 98declare <4 x float> @llvm.floor.v4f32(<4 x float> %p) 99define <4 x float> @floor_v4f32(<4 x float> %p) 100{ 101 %t = call <4 x float> @llvm.floor.v4f32(<4 x float> %p) 102 ret <4 x float> %t 103} 104; CHECK-LABEL: floor_v4f32: 105; CHECK: vrfim 106 107declare <8 x float> @llvm.floor.v8f32(<8 x float> %p) 108define <8 x float> @floor_v8f32(<8 x float> %p) 109{ 110 %t = call <8 x float> @llvm.floor.v8f32(<8 x float> %p) 111 ret <8 x float> %t 112} 113; CHECK-LABEL: floor_v8f32: 114; CHECK: vrfim 115; CHECK: vrfim 116 117declare <4 x float> @llvm.ceil.v4f32(<4 x float> %p) 118define <4 x float> @ceil_v4f32(<4 x float> %p) 119{ 120 %t = call <4 x float> @llvm.ceil.v4f32(<4 x float> %p) 121 ret <4 x float> %t 122} 123; CHECK-LABEL: ceil_v4f32: 124; CHECK: vrfip 125 126declare <8 x float> @llvm.ceil.v8f32(<8 x float> %p) 127define <8 x float> @ceil_v8f32(<8 x float> %p) 128{ 129 %t = call <8 x float> @llvm.ceil.v8f32(<8 x float> %p) 130 ret <8 x float> %t 131} 132; CHECK-LABEL: ceil_v8f32: 133; CHECK: vrfip 134; CHECK: vrfip 135 136declare <4 x float> @llvm.trunc.v4f32(<4 x float> %p) 137define <4 x float> @trunc_v4f32(<4 x float> %p) 138{ 139 %t = call <4 x float> @llvm.trunc.v4f32(<4 x float> %p) 140 ret <4 x float> %t 141} 142; CHECK-LABEL: trunc_v4f32: 143; CHECK: vrfiz 144 145declare <8 x float> @llvm.trunc.v8f32(<8 x float> %p) 146define <8 x float> @trunc_v8f32(<8 x float> %p) 147{ 148 %t = call <8 x float> @llvm.trunc.v8f32(<8 x float> %p) 149 ret <8 x float> %t 150} 151; CHECK-LABEL: trunc_v8f32: 152; CHECK: vrfiz 153; CHECK: vrfiz 154 155declare <4 x float> @llvm.nearbyint.v4f32(<4 x float> %p) 156define <4 x float> @nearbyint_v4f32(<4 x float> %p) 157{ 158 %t = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> %p) 159 ret <4 x float> %t 160} 161; CHECK-LABEL: nearbyint_v4f32: 162; CHECK: vrfin 163 164declare <8 x float> @llvm.nearbyint.v8f32(<8 x float> %p) 165define <8 x float> @nearbyint_v8f32(<8 x float> %p) 166{ 167 %t = call <8 x float> @llvm.nearbyint.v8f32(<8 x float> %p) 168 ret <8 x float> %t 169} 170; CHECK-LABEL: nearbyint_v8f32: 171; CHECK: vrfin 172; CHECK: vrfin 173