1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -mattr=+d,+experimental-zfh,+experimental-v -target-abi=ilp32d \
; RUN: -riscv-v-vector-bits-min=128 -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -mtriple=riscv64 -mattr=+d,+experimental-zfh,+experimental-v -target-abi=lp64d \
; RUN: -riscv-v-vector-bits-min=128 -verify-machineinstrs < %s | FileCheck %s
declare <2 x half> @llvm.minnum.v2f16(<2 x half>, <2 x half>)
define <2 x half> @vfmin_v2f16_vv(<2 x half> %a, <2 x half> %b) {
; CHECK-LABEL: vfmin_v2f16_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v9
; CHECK-NEXT: ret
%v = call <2 x half> @llvm.minnum.v2f16(<2 x half> %a, <2 x half> %b)
ret <2 x half> %v
}
define <2 x half> @vfmin_v2f16_vf(<2 x half> %a, half %b) {
; CHECK-LABEL: vfmin_v2f16_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <2 x half> undef, half %b, i32 0
%splat = shufflevector <2 x half> %head, <2 x half> undef, <2 x i32> zeroinitializer
%v = call <2 x half> @llvm.minnum.v2f16(<2 x half> %a, <2 x half> %splat)
ret <2 x half> %v
}
declare <4 x half> @llvm.minnum.v4f16(<4 x half>, <4 x half>)
define <4 x half> @vfmin_v4f16_vv(<4 x half> %a, <4 x half> %b) {
; CHECK-LABEL: vfmin_v4f16_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v9
; CHECK-NEXT: ret
%v = call <4 x half> @llvm.minnum.v4f16(<4 x half> %a, <4 x half> %b)
ret <4 x half> %v
}
define <4 x half> @vfmin_v4f16_vf(<4 x half> %a, half %b) {
; CHECK-LABEL: vfmin_v4f16_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <4 x half> undef, half %b, i32 0
%splat = shufflevector <4 x half> %head, <4 x half> undef, <4 x i32> zeroinitializer
%v = call <4 x half> @llvm.minnum.v4f16(<4 x half> %a, <4 x half> %splat)
ret <4 x half> %v
}
declare <8 x half> @llvm.minnum.v8f16(<8 x half>, <8 x half>)
define <8 x half> @vfmin_v8f16_vv(<8 x half> %a, <8 x half> %b) {
; CHECK-LABEL: vfmin_v8f16_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v9
; CHECK-NEXT: ret
%v = call <8 x half> @llvm.minnum.v8f16(<8 x half> %a, <8 x half> %b)
ret <8 x half> %v
}
define <8 x half> @vfmin_v8f16_vf(<8 x half> %a, half %b) {
; CHECK-LABEL: vfmin_v8f16_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <8 x half> undef, half %b, i32 0
%splat = shufflevector <8 x half> %head, <8 x half> undef, <8 x i32> zeroinitializer
%v = call <8 x half> @llvm.minnum.v8f16(<8 x half> %a, <8 x half> %splat)
ret <8 x half> %v
}
declare <16 x half> @llvm.minnum.v16f16(<16 x half>, <16 x half>)
define <16 x half> @vfmin_v16f16_vv(<16 x half> %a, <16 x half> %b) {
; CHECK-LABEL: vfmin_v16f16_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v10
; CHECK-NEXT: ret
%v = call <16 x half> @llvm.minnum.v16f16(<16 x half> %a, <16 x half> %b)
ret <16 x half> %v
}
define <16 x half> @vfmin_v16f16_vf(<16 x half> %a, half %b) {
; CHECK-LABEL: vfmin_v16f16_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <16 x half> undef, half %b, i32 0
%splat = shufflevector <16 x half> %head, <16 x half> undef, <16 x i32> zeroinitializer
%v = call <16 x half> @llvm.minnum.v16f16(<16 x half> %a, <16 x half> %splat)
ret <16 x half> %v
}
declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>)
define <2 x float> @vfmin_v2f32_vv(<2 x float> %a, <2 x float> %b) {
; CHECK-LABEL: vfmin_v2f32_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v9
; CHECK-NEXT: ret
%v = call <2 x float> @llvm.minnum.v2f32(<2 x float> %a, <2 x float> %b)
ret <2 x float> %v
}
define <2 x float> @vfmin_v2f32_vf(<2 x float> %a, float %b) {
; CHECK-LABEL: vfmin_v2f32_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <2 x float> undef, float %b, i32 0
%splat = shufflevector <2 x float> %head, <2 x float> undef, <2 x i32> zeroinitializer
%v = call <2 x float> @llvm.minnum.v2f32(<2 x float> %a, <2 x float> %splat)
ret <2 x float> %v
}
declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)
define <4 x float> @vfmin_v4f32_vv(<4 x float> %a, <4 x float> %b) {
; CHECK-LABEL: vfmin_v4f32_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v9
; CHECK-NEXT: ret
%v = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %b)
ret <4 x float> %v
}
define <4 x float> @vfmin_v4f32_vf(<4 x float> %a, float %b) {
; CHECK-LABEL: vfmin_v4f32_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <4 x float> undef, float %b, i32 0
%splat = shufflevector <4 x float> %head, <4 x float> undef, <4 x i32> zeroinitializer
%v = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %splat)
ret <4 x float> %v
}
declare <8 x float> @llvm.minnum.v8f32(<8 x float>, <8 x float>)
define <8 x float> @vfmin_v8f32_vv(<8 x float> %a, <8 x float> %b) {
; CHECK-LABEL: vfmin_v8f32_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v10
; CHECK-NEXT: ret
%v = call <8 x float> @llvm.minnum.v8f32(<8 x float> %a, <8 x float> %b)
ret <8 x float> %v
}
define <8 x float> @vfmin_v8f32_vf(<8 x float> %a, float %b) {
; CHECK-LABEL: vfmin_v8f32_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <8 x float> undef, float %b, i32 0
%splat = shufflevector <8 x float> %head, <8 x float> undef, <8 x i32> zeroinitializer
%v = call <8 x float> @llvm.minnum.v8f32(<8 x float> %a, <8 x float> %splat)
ret <8 x float> %v
}
declare <16 x float> @llvm.minnum.v16f32(<16 x float>, <16 x float>)
define <16 x float> @vfmin_v16f32_vv(<16 x float> %a, <16 x float> %b) {
; CHECK-LABEL: vfmin_v16f32_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e32, m4, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v12
; CHECK-NEXT: ret
%v = call <16 x float> @llvm.minnum.v16f32(<16 x float> %a, <16 x float> %b)
ret <16 x float> %v
}
define <16 x float> @vfmin_v16f32_vf(<16 x float> %a, float %b) {
; CHECK-LABEL: vfmin_v16f32_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e32, m4, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <16 x float> undef, float %b, i32 0
%splat = shufflevector <16 x float> %head, <16 x float> undef, <16 x i32> zeroinitializer
%v = call <16 x float> @llvm.minnum.v16f32(<16 x float> %a, <16 x float> %splat)
ret <16 x float> %v
}
declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
define <2 x double> @vfmin_v2f64_vv(<2 x double> %a, <2 x double> %b) {
; CHECK-LABEL: vfmin_v2f64_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v9
; CHECK-NEXT: ret
%v = call <2 x double> @llvm.minnum.v2f64(<2 x double> %a, <2 x double> %b)
ret <2 x double> %v
}
define <2 x double> @vfmin_v2f64_vf(<2 x double> %a, double %b) {
; CHECK-LABEL: vfmin_v2f64_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <2 x double> undef, double %b, i32 0
%splat = shufflevector <2 x double> %head, <2 x double> undef, <2 x i32> zeroinitializer
%v = call <2 x double> @llvm.minnum.v2f64(<2 x double> %a, <2 x double> %splat)
ret <2 x double> %v
}
declare <4 x double> @llvm.minnum.v4f64(<4 x double>, <4 x double>)
define <4 x double> @vfmin_v4f64_vv(<4 x double> %a, <4 x double> %b) {
; CHECK-LABEL: vfmin_v4f64_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v10
; CHECK-NEXT: ret
%v = call <4 x double> @llvm.minnum.v4f64(<4 x double> %a, <4 x double> %b)
ret <4 x double> %v
}
define <4 x double> @vfmin_v4f64_vf(<4 x double> %a, double %b) {
; CHECK-LABEL: vfmin_v4f64_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <4 x double> undef, double %b, i32 0
%splat = shufflevector <4 x double> %head, <4 x double> undef, <4 x i32> zeroinitializer
%v = call <4 x double> @llvm.minnum.v4f64(<4 x double> %a, <4 x double> %splat)
ret <4 x double> %v
}
declare <8 x double> @llvm.minnum.v8f64(<8 x double>, <8 x double>)
define <8 x double> @vfmin_v8f64_vv(<8 x double> %a, <8 x double> %b) {
; CHECK-LABEL: vfmin_v8f64_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e64, m4, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v12
; CHECK-NEXT: ret
%v = call <8 x double> @llvm.minnum.v8f64(<8 x double> %a, <8 x double> %b)
ret <8 x double> %v
}
define <8 x double> @vfmin_v8f64_vf(<8 x double> %a, double %b) {
; CHECK-LABEL: vfmin_v8f64_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e64, m4, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <8 x double> undef, double %b, i32 0
%splat = shufflevector <8 x double> %head, <8 x double> undef, <8 x i32> zeroinitializer
%v = call <8 x double> @llvm.minnum.v8f64(<8 x double> %a, <8 x double> %splat)
ret <8 x double> %v
}
declare <16 x double> @llvm.minnum.v16f64(<16 x double>, <16 x double>)
define <16 x double> @vfmin_v16f64_vv(<16 x double> %a, <16 x double> %b) {
; CHECK-LABEL: vfmin_v16f64_vv:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, mu
; CHECK-NEXT: vfmin.vv v8, v8, v16
; CHECK-NEXT: ret
%v = call <16 x double> @llvm.minnum.v16f64(<16 x double> %a, <16 x double> %b)
ret <16 x double> %v
}
define <16 x double> @vfmin_v16f64_vf(<16 x double> %a, double %b) {
; CHECK-LABEL: vfmin_v16f64_vf:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, mu
; CHECK-NEXT: vfmin.vf v8, v8, fa0
; CHECK-NEXT: ret
%head = insertelement <16 x double> undef, double %b, i32 0
%splat = shufflevector <16 x double> %head, <16 x double> undef, <16 x i32> zeroinitializer
%v = call <16 x double> @llvm.minnum.v16f64(<16 x double> %a, <16 x double> %splat)
ret <16 x double> %v
}
|