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 6 target 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" 7 target triple = "powerpc64-unknown-linux-gnu" 8 9 declare <2 x double> @llvm.floor.v2f64(<2 x double> %p) 10 define <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 19 declare <4 x double> @llvm.floor.v4f64(<4 x double> %p) 20 define <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 31 declare <2 x double> @llvm.ceil.v2f64(<2 x double> %p) 32 define <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 41 declare <4 x double> @llvm.ceil.v4f64(<4 x double> %p) 42 define <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 53 declare <2 x double> @llvm.trunc.v2f64(<2 x double> %p) 54 define <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 63 declare <4 x double> @llvm.trunc.v4f64(<4 x double> %p) 64 define <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 75 declare <2 x double> @llvm.nearbyint.v2f64(<2 x double> %p) 76 define <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 85 declare <4 x double> @llvm.nearbyint.v4f64(<4 x double> %p) 86 define <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 98 declare <4 x float> @llvm.floor.v4f32(<4 x float> %p) 99 define <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 107 declare <8 x float> @llvm.floor.v8f32(<8 x float> %p) 108 define <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 117 declare <4 x float> @llvm.ceil.v4f32(<4 x float> %p) 118 define <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 126 declare <8 x float> @llvm.ceil.v8f32(<8 x float> %p) 127 define <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 136 declare <4 x float> @llvm.trunc.v4f32(<4 x float> %p) 137 define <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 145 declare <8 x float> @llvm.trunc.v8f32(<8 x float> %p) 146 define <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 155 declare <4 x float> @llvm.nearbyint.v4f32(<4 x float> %p) 156 define <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 164 declare <8 x float> @llvm.nearbyint.v8f32(<8 x float> %p) 165 define <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