1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s --check-prefix=KNL 2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s --check-prefix=SKX 3 4 ;SKX-LABEL: zext_8x8mem_to_8x16: 5 ;SKX: ## BB#0: 6 ;SKX-NEXT: vpmovw2m %xmm0, %k1 7 ;SKX-NEXT: vpmovzxbw (%rdi), %xmm0 {%k1} {z} 8 ;SKX-NEXT: retq 9 define <8 x i16> @zext_8x8mem_to_8x16(<8 x i8> *%i , <8 x i1> %mask) nounwind readnone { 10 %a = load <8 x i8>,<8 x i8> *%i,align 1 11 %x = zext <8 x i8> %a to <8 x i16> 12 %ret = select <8 x i1> %mask, <8 x i16> %x, <8 x i16> zeroinitializer 13 ret <8 x i16> %ret 14 } 15 16 ;SKX-LABEL: sext_8x8mem_to_8x16: 17 ;SKX: ## BB#0: 18 ;SKX-NEXT: vpmovw2m %xmm0, %k1 19 ;SKX-NEXT: vpmovsxbw (%rdi), %xmm0 {%k1} {z} 20 ;SKX-NEXT: retq 21 define <8 x i16> @sext_8x8mem_to_8x16(<8 x i8> *%i , <8 x i1> %mask) nounwind readnone { 22 %a = load <8 x i8>,<8 x i8> *%i,align 1 23 %x = sext <8 x i8> %a to <8 x i16> 24 %ret = select <8 x i1> %mask, <8 x i16> %x, <8 x i16> zeroinitializer 25 ret <8 x i16> %ret 26 } 27 28 ;SKX-LABEL: zext_16x8mem_to_16x16: 29 ;SKX: ## BB#0: 30 ;SKX-NEXT: vpmovb2m %xmm0, %k1 31 ;SKX-NEXT: vpmovzxbw (%rdi), %ymm0 {%k1} {z} 32 ;SKX-NEXT: retq 33 define <16 x i16> @zext_16x8mem_to_16x16(<16 x i8> *%i , <16 x i1> %mask) nounwind readnone { 34 %a = load <16 x i8>,<16 x i8> *%i,align 1 35 %x = zext <16 x i8> %a to <16 x i16> 36 %ret = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> zeroinitializer 37 ret <16 x i16> %ret 38 } 39 40 ;SKX-LABEL: sext_16x8mem_to_16x16: 41 ;SKX: ## BB#0: 42 ;SKX-NEXT: vpmovb2m %xmm0, %k1 43 ;SKX-NEXT: vpmovsxbw (%rdi), %ymm0 {%k1} {z} 44 ;SKX-NEXT: retq 45 define <16 x i16> @sext_16x8mem_to_16x16(<16 x i8> *%i , <16 x i1> %mask) nounwind readnone { 46 %a = load <16 x i8>,<16 x i8> *%i,align 1 47 %x = sext <16 x i8> %a to <16 x i16> 48 %ret = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> zeroinitializer 49 ret <16 x i16> %ret 50 } 51 52 ;SKX-LABEL: zext_16x8_to_16x16: 53 ;SKX: ## BB#0: 54 ;SKX-NEXT: vpmovzxbw %xmm0, %ymm0 55 ;SKX-NEXT: retq 56 define <16 x i16> @zext_16x8_to_16x16(<16 x i8> %a ) nounwind readnone { 57 %x = zext <16 x i8> %a to <16 x i16> 58 ret <16 x i16> %x 59 } 60 61 ;SKX-LABEL: zext_16x8_to_16x16_mask: 62 ;SKX: ## BB#0: 63 ;SKX-NEXT: vpmovb2m %xmm1, %k1 64 ;SKX-NEXT: vpmovzxbw %xmm0, %ymm0 {%k1} {z} 65 ;SKX-NEXT: retq 66 define <16 x i16> @zext_16x8_to_16x16_mask(<16 x i8> %a ,<16 x i1> %mask) nounwind readnone { 67 %x = zext <16 x i8> %a to <16 x i16> 68 %ret = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> zeroinitializer 69 ret <16 x i16> %ret 70 } 71 72 ;SKX-LABEL: sext_16x8_to_16x16: 73 ;SKX: ## BB#0: 74 ;SKX-NEXT: vpmovsxbw %xmm0, %ymm0 75 ;SKX-NEXT: retq 76 define <16 x i16> @sext_16x8_to_16x16(<16 x i8> %a ) nounwind readnone { 77 %x = sext <16 x i8> %a to <16 x i16> 78 ret <16 x i16> %x 79 } 80 81 ;SKX-LABEL: sext_16x8_to_16x16_mask: 82 ;SKX: ## BB#0: 83 ;SKX-NEXT: vpmovb2m %xmm1, %k1 84 ;SKX-NEXT: vpmovsxbw %xmm0, %ymm0 {%k1} {z} 85 ;SKX-NEXT: retq 86 define <16 x i16> @sext_16x8_to_16x16_mask(<16 x i8> %a ,<16 x i1> %mask) nounwind readnone { 87 %x = sext <16 x i8> %a to <16 x i16> 88 %ret = select <16 x i1> %mask, <16 x i16> %x, <16 x i16> zeroinitializer 89 ret <16 x i16> %ret 90 } 91 92 ;SKX-LABEL: zext_32x8mem_to_32x16: 93 ;SKX: ## BB#0: 94 ;SKX-NEXT: vpmovb2m %ymm0, %k1 95 ;SKX-NEXT: vpmovzxbw (%rdi), %zmm0 {%k1} {z} 96 ;SKX-NEXT: retq 97 define <32 x i16> @zext_32x8mem_to_32x16(<32 x i8> *%i , <32 x i1> %mask) nounwind readnone { 98 %a = load <32 x i8>,<32 x i8> *%i,align 1 99 %x = zext <32 x i8> %a to <32 x i16> 100 %ret = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer 101 ret <32 x i16> %ret 102 } 103 104 ;SKX-LABEL: sext_32x8mem_to_32x16: 105 ;SKX: ## BB#0: 106 ;SKX-NEXT: vpmovb2m %ymm0, %k1 107 ;SKX-NEXT: vpmovsxbw (%rdi), %zmm0 {%k1} {z} 108 ;SKX-NEXT: retq 109 define <32 x i16> @sext_32x8mem_to_32x16(<32 x i8> *%i , <32 x i1> %mask) nounwind readnone { 110 %a = load <32 x i8>,<32 x i8> *%i,align 1 111 %x = sext <32 x i8> %a to <32 x i16> 112 %ret = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer 113 ret <32 x i16> %ret 114 } 115 116 ;SKX-LABEL: zext_32x8_to_32x16: 117 ;SKX: ## BB#0: 118 ;SKX-NEXT: vpmovzxbw %ymm0, %zmm0 119 ;SKX-NEXT: retq 120 define <32 x i16> @zext_32x8_to_32x16(<32 x i8> %a ) nounwind readnone { 121 %x = zext <32 x i8> %a to <32 x i16> 122 ret <32 x i16> %x 123 } 124 125 ;SKX-LABEL: zext_32x8_to_32x16_mask: 126 ;SKX: ## BB#0: 127 ;SKX-NEXT: vpmovb2m %ymm1, %k1 128 ;SKX-NEXT: vpmovzxbw %ymm0, %zmm0 {%k1} {z} 129 ;SKX-NEXT: retq 130 define <32 x i16> @zext_32x8_to_32x16_mask(<32 x i8> %a ,<32 x i1> %mask) nounwind readnone { 131 %x = zext <32 x i8> %a to <32 x i16> 132 %ret = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer 133 ret <32 x i16> %ret 134 } 135 136 ;SKX-LABEL: sext_32x8_to_32x16: 137 ;SKX: ## BB#0: 138 ;SKX-NEXT: vpmovsxbw %ymm0, %zmm0 139 ;SKX-NEXT: retq 140 define <32 x i16> @sext_32x8_to_32x16(<32 x i8> %a ) nounwind readnone { 141 %x = sext <32 x i8> %a to <32 x i16> 142 ret <32 x i16> %x 143 } 144 145 ;SKX-LABEL: sext_32x8_to_32x16_mask: 146 ;SKX: ## BB#0: 147 ;SKX-NEXT: vpmovb2m %ymm1, %k1 148 ;SKX-NEXT: vpmovsxbw %ymm0, %zmm0 {%k1} {z} 149 ;SKX-NEXT: retq 150 define <32 x i16> @sext_32x8_to_32x16_mask(<32 x i8> %a ,<32 x i1> %mask) nounwind readnone { 151 %x = sext <32 x i8> %a to <32 x i16> 152 %ret = select <32 x i1> %mask, <32 x i16> %x, <32 x i16> zeroinitializer 153 ret <32 x i16> %ret 154 } 155 156 ;SKX-LABEL: zext_4x8mem_to_4x32: 157 ;SKX: ## BB#0: 158 ;SKX-NEXT: vpmovd2m %xmm0, %k1 159 ;SKX-NEXT: vpmovzxbd (%rdi), %xmm0 {%k1} {z} 160 ;SKX-NEXT: retq 161 define <4 x i32> @zext_4x8mem_to_4x32(<4 x i8> *%i , <4 x i1> %mask) nounwind readnone { 162 %a = load <4 x i8>,<4 x i8> *%i,align 1 163 %x = zext <4 x i8> %a to <4 x i32> 164 %ret = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> zeroinitializer 165 ret <4 x i32> %ret 166 } 167 168 ;SKX-LABEL: sext_4x8mem_to_4x32: 169 ;SKX: ## BB#0: 170 ;SKX-NEXT: vpmovd2m %xmm0, %k1 171 ;SKX-NEXT: vpmovsxbd (%rdi), %xmm0 {%k1} {z} 172 ;SKX-NEXT: retq 173 define <4 x i32> @sext_4x8mem_to_4x32(<4 x i8> *%i , <4 x i1> %mask) nounwind readnone { 174 %a = load <4 x i8>,<4 x i8> *%i,align 1 175 %x = sext <4 x i8> %a to <4 x i32> 176 %ret = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> zeroinitializer 177 ret <4 x i32> %ret 178 } 179 180 ;SKX-LABEL: zext_8x8mem_to_8x32: 181 ;SKX: ## BB#0: 182 ;SKX-NEXT: vpmovw2m %xmm0, %k1 183 ;SKX-NEXT: vpmovzxbd (%rdi), %ymm0 {%k1} {z} 184 ;SKX-NEXT: retq 185 define <8 x i32> @zext_8x8mem_to_8x32(<8 x i8> *%i , <8 x i1> %mask) nounwind readnone { 186 %a = load <8 x i8>,<8 x i8> *%i,align 1 187 %x = zext <8 x i8> %a to <8 x i32> 188 %ret = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> zeroinitializer 189 ret <8 x i32> %ret 190 } 191 192 ;SKX-LABEL: sext_8x8mem_to_8x32: 193 ;SKX: ## BB#0: 194 ;SKX-NEXT: vpmovw2m %xmm0, %k1 195 ;SKX-NEXT: vpmovsxbd (%rdi), %ymm0 {%k1} {z} 196 ;SKX-NEXT: retq 197 define <8 x i32> @sext_8x8mem_to_8x32(<8 x i8> *%i , <8 x i1> %mask) nounwind readnone { 198 %a = load <8 x i8>,<8 x i8> *%i,align 1 199 %x = sext <8 x i8> %a to <8 x i32> 200 %ret = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> zeroinitializer 201 ret <8 x i32> %ret 202 } 203 204 ;KNL-LABEL: zext_16x8mem_to_16x32: 205 ;KNL: vpmovzxbd (%rdi), %zmm0 {%k1} {z} 206 ;KNL-NEXT: retq 207 define <16 x i32> @zext_16x8mem_to_16x32(<16 x i8> *%i , <16 x i1> %mask) nounwind readnone { 208 %a = load <16 x i8>,<16 x i8> *%i,align 1 209 %x = zext <16 x i8> %a to <16 x i32> 210 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 211 ret <16 x i32> %ret 212 } 213 214 ;KNL-LABEL: sext_16x8mem_to_16x32: 215 ;KNL: vpmovsxbd (%rdi), %zmm0 {%k1} {z} 216 ;KNL-NEXT: retq 217 define <16 x i32> @sext_16x8mem_to_16x32(<16 x i8> *%i , <16 x i1> %mask) nounwind readnone { 218 %a = load <16 x i8>,<16 x i8> *%i,align 1 219 %x = sext <16 x i8> %a to <16 x i32> 220 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 221 ret <16 x i32> %ret 222 } 223 224 ;KNL-LABEL: zext_16x8_to_16x32_mask: 225 ;KNL: vpmovzxbd %xmm0, %zmm0 {%k1} {z} 226 ;KNL-NEXT: retq 227 define <16 x i32> @zext_16x8_to_16x32_mask(<16 x i8> %a , <16 x i1> %mask) nounwind readnone { 228 %x = zext <16 x i8> %a to <16 x i32> 229 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 230 ret <16 x i32> %ret 231 } 232 233 ;KNL-LABEL: sext_16x8_to_16x32_mask: 234 ;KNL: vpmovsxbd %xmm0, %zmm0 {%k1} {z} 235 ;KNL-NEXT: retq 236 define <16 x i32> @sext_16x8_to_16x32_mask(<16 x i8> %a , <16 x i1> %mask) nounwind readnone { 237 %x = sext <16 x i8> %a to <16 x i32> 238 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 239 ret <16 x i32> %ret 240 } 241 242 ; KNL-LABEL: zext_16x8_to_16x32 243 ; KNL: vpmovzxbd {{.*}}%zmm 244 ; KNL: ret 245 define <16 x i32> @zext_16x8_to_16x32(<16 x i8> %i) nounwind readnone { 246 %x = zext <16 x i8> %i to <16 x i32> 247 ret <16 x i32> %x 248 } 249 250 ; KNL-LABEL: sext_16x8_to_16x32 251 ; KNL: vpmovsxbd {{.*}}%zmm 252 ; KNL: ret 253 define <16 x i32> @sext_16x8_to_16x32(<16 x i8> %i) nounwind readnone { 254 %x = sext <16 x i8> %i to <16 x i32> 255 ret <16 x i32> %x 256 } 257 258 ;SKX-LABEL: zext_2x8mem_to_2x64: 259 ;SKX: ## BB#0: 260 ;SKX-NEXT: vpmovq2m %xmm0, %k1 261 ;SKX-NEXT: vpmovzxbq (%rdi), %xmm0 {%k1} {z} 262 ;SKX-NEXT: retq 263 define <2 x i64> @zext_2x8mem_to_2x64(<2 x i8> *%i , <2 x i1> %mask) nounwind readnone { 264 %a = load <2 x i8>,<2 x i8> *%i,align 1 265 %x = zext <2 x i8> %a to <2 x i64> 266 %ret = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> zeroinitializer 267 ret <2 x i64> %ret 268 } 269 ;SKX-LABEL: sext_2x8mem_to_2x64mask: 270 ;SKX: ## BB#0: 271 ;SKX-NEXT: vpmovq2m %xmm0, %k1 272 ;SKX-NEXT: vpmovsxbq (%rdi), %xmm0 {%k1} {z} 273 ;SKX-NEXT: retq 274 define <2 x i64> @sext_2x8mem_to_2x64mask(<2 x i8> *%i , <2 x i1> %mask) nounwind readnone { 275 %a = load <2 x i8>,<2 x i8> *%i,align 1 276 %x = sext <2 x i8> %a to <2 x i64> 277 %ret = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> zeroinitializer 278 ret <2 x i64> %ret 279 } 280 ;SKX-LABEL: sext_2x8mem_to_2x64: 281 ;SKX: ## BB#0: 282 ;SKX-NEXT: vpmovsxbq (%rdi), %xmm0 283 ;SKX-NEXT: retq 284 define <2 x i64> @sext_2x8mem_to_2x64(<2 x i8> *%i) nounwind readnone { 285 %a = load <2 x i8>,<2 x i8> *%i,align 1 286 %x = sext <2 x i8> %a to <2 x i64> 287 ret <2 x i64> %x 288 } 289 290 ;SKX-LABEL: zext_4x8mem_to_4x64: 291 ;SKX: ## BB#0: 292 ;SKX-NEXT: vpmovd2m %xmm0, %k1 293 ;SKX-NEXT: vpmovzxbq (%rdi), %ymm0 {%k1} {z} 294 ;SKX-NEXT: retq 295 define <4 x i64> @zext_4x8mem_to_4x64(<4 x i8> *%i , <4 x i1> %mask) nounwind readnone { 296 %a = load <4 x i8>,<4 x i8> *%i,align 1 297 %x = zext <4 x i8> %a to <4 x i64> 298 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 299 ret <4 x i64> %ret 300 } 301 302 ;SKX-LABEL: sext_4x8mem_to_4x64mask: 303 ;SKX: ## BB#0: 304 ;SKX-NEXT: vpmovd2m %xmm0, %k1 305 ;SKX-NEXT: vpmovsxbq (%rdi), %ymm0 {%k1} {z} 306 ;SKX-NEXT: retq 307 define <4 x i64> @sext_4x8mem_to_4x64mask(<4 x i8> *%i , <4 x i1> %mask) nounwind readnone { 308 %a = load <4 x i8>,<4 x i8> *%i,align 1 309 %x = sext <4 x i8> %a to <4 x i64> 310 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 311 ret <4 x i64> %ret 312 } 313 314 ;SKX-LABEL: sext_4x8mem_to_4x64: 315 ;SKX: ## BB#0: 316 ;SKX-NEXT: vpmovsxbq (%rdi), %ymm0 317 ;SKX-NEXT: retq 318 define <4 x i64> @sext_4x8mem_to_4x64(<4 x i8> *%i) nounwind readnone { 319 %a = load <4 x i8>,<4 x i8> *%i,align 1 320 %x = sext <4 x i8> %a to <4 x i64> 321 ret <4 x i64> %x 322 } 323 324 ;KNL-LABEL: zext_8x8mem_to_8x64: 325 ;KNL: vpmovzxbq (%rdi), %zmm0 {%k1} {z} 326 ;KNL-NEXT: retq 327 define <8 x i64> @zext_8x8mem_to_8x64(<8 x i8> *%i , <8 x i1> %mask) nounwind readnone { 328 %a = load <8 x i8>,<8 x i8> *%i,align 1 329 %x = zext <8 x i8> %a to <8 x i64> 330 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 331 ret <8 x i64> %ret 332 } 333 334 ;KNL-LABEL: sext_8x8mem_to_8x64mask: 335 ;KNL: vpmovsxbq (%rdi), %zmm0 {%k1} {z} 336 ;KNL-NEXT: retq 337 define <8 x i64> @sext_8x8mem_to_8x64mask(<8 x i8> *%i , <8 x i1> %mask) nounwind readnone { 338 %a = load <8 x i8>,<8 x i8> *%i,align 1 339 %x = sext <8 x i8> %a to <8 x i64> 340 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 341 ret <8 x i64> %ret 342 } 343 344 ;KNL-LABEL: sext_8x8mem_to_8x64: 345 ;KNL: vpmovsxbq (%rdi), %zmm0 346 ;KNL-NEXT: retq 347 define <8 x i64> @sext_8x8mem_to_8x64(<8 x i8> *%i) nounwind readnone { 348 %a = load <8 x i8>,<8 x i8> *%i,align 1 349 %x = sext <8 x i8> %a to <8 x i64> 350 ret <8 x i64> %x 351 } 352 353 ;SKX-LABEL: zext_4x16mem_to_4x32: 354 ;SKX: ## BB#0: 355 ;SKX-NEXT: vpmovd2m %xmm0, %k1 356 ;SKX-NEXT: vpmovzxwd (%rdi), %xmm0 {%k1} {z} 357 ;SKX-NEXT: retq 358 define <4 x i32> @zext_4x16mem_to_4x32(<4 x i16> *%i , <4 x i1> %mask) nounwind readnone { 359 %a = load <4 x i16>,<4 x i16> *%i,align 1 360 %x = zext <4 x i16> %a to <4 x i32> 361 %ret = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> zeroinitializer 362 ret <4 x i32> %ret 363 } 364 365 ;SKX-LABEL: sext_4x16mem_to_4x32mask: 366 ;SKX: ## BB#0: 367 ;SKX-NEXT: vpmovd2m %xmm0, %k1 368 ;SKX-NEXT: vpmovsxwd (%rdi), %xmm0 {%k1} {z} 369 ;SKX-NEXT: retq 370 define <4 x i32> @sext_4x16mem_to_4x32mask(<4 x i16> *%i , <4 x i1> %mask) nounwind readnone { 371 %a = load <4 x i16>,<4 x i16> *%i,align 1 372 %x = sext <4 x i16> %a to <4 x i32> 373 %ret = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> zeroinitializer 374 ret <4 x i32> %ret 375 } 376 377 ;SKX-LABEL: sext_4x16mem_to_4x32: 378 ;SKX: ## BB#0: 379 ;SKX-NEXT: vpmovsxwd (%rdi), %xmm0 380 ;SKX-NEXT: retq 381 define <4 x i32> @sext_4x16mem_to_4x32(<4 x i16> *%i) nounwind readnone { 382 %a = load <4 x i16>,<4 x i16> *%i,align 1 383 %x = sext <4 x i16> %a to <4 x i32> 384 ret <4 x i32> %x 385 } 386 387 388 ;SKX-LABEL: zext_8x16mem_to_8x32: 389 ;SKX: ## BB#0: 390 ;SKX-NEXT: vpmovw2m %xmm0, %k1 391 ;SKX-NEXT: vpmovzxwd (%rdi), %ymm0 {%k1} {z} 392 ;SKX-NEXT: retq 393 define <8 x i32> @zext_8x16mem_to_8x32(<8 x i16> *%i , <8 x i1> %mask) nounwind readnone { 394 %a = load <8 x i16>,<8 x i16> *%i,align 1 395 %x = zext <8 x i16> %a to <8 x i32> 396 %ret = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> zeroinitializer 397 ret <8 x i32> %ret 398 } 399 400 ;SKX-LABEL: sext_8x16mem_to_8x32mask: 401 ;SKX: ## BB#0: 402 ;SKX-NEXT: vpmovw2m %xmm0, %k1 403 ;SKX-NEXT: vpmovsxwd (%rdi), %ymm0 {%k1} {z} 404 ;SKX-NEXT: retq 405 define <8 x i32> @sext_8x16mem_to_8x32mask(<8 x i16> *%i , <8 x i1> %mask) nounwind readnone { 406 %a = load <8 x i16>,<8 x i16> *%i,align 1 407 %x = sext <8 x i16> %a to <8 x i32> 408 %ret = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> zeroinitializer 409 ret <8 x i32> %ret 410 } 411 412 ;SKX-LABEL: sext_8x16mem_to_8x32: 413 ;SKX: ## BB#0: 414 ;SKX-NEXT: vpmovsxwd (%rdi), %ymm0 415 ;SKX-NEXT: retq 416 define <8 x i32> @sext_8x16mem_to_8x32(<8 x i16> *%i) nounwind readnone { 417 %a = load <8 x i16>,<8 x i16> *%i,align 1 418 %x = sext <8 x i16> %a to <8 x i32> 419 ret <8 x i32> %x 420 } 421 422 ;SKX-LABEL: zext_8x16_to_8x32mask: 423 ;SKX: ## BB#0: 424 ;SKX-NEXT: vpmovw2m %xmm1, %k1 425 ;SKX-NEXT: vpmovzxwd %xmm0, %ymm0 {%k1} {z} 426 ;SKX-NEXT: retq 427 define <8 x i32> @zext_8x16_to_8x32mask(<8 x i16> %a , <8 x i1> %mask) nounwind readnone { 428 %x = zext <8 x i16> %a to <8 x i32> 429 %ret = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> zeroinitializer 430 ret <8 x i32> %ret 431 } 432 433 ;SKX-LABEL: zext_8x16_to_8x32: 434 ;SKX: ## BB#0: 435 ;SKX-NEXT: vpmovzxwd %xmm0, %ymm0 436 ;SKX-NEXT: retq 437 define <8 x i32> @zext_8x16_to_8x32(<8 x i16> %a ) nounwind readnone { 438 %x = zext <8 x i16> %a to <8 x i32> 439 ret <8 x i32> %x 440 } 441 442 ;SKX-LABEL: zext_16x16mem_to_16x32: 443 ;KNL-LABEL: zext_16x16mem_to_16x32: 444 ;SKX: ## BB#0: 445 ;SKX-NEXT: vpmovb2m %xmm0, %k1 446 ;SKX-NEXT: vpmovzxwd (%rdi), %zmm0 {%k1} {z} 447 ;KNL: vpmovzxwd (%rdi), %zmm0 {%k1} {z} 448 ;SKX-NEXT: retq 449 define <16 x i32> @zext_16x16mem_to_16x32(<16 x i16> *%i , <16 x i1> %mask) nounwind readnone { 450 %a = load <16 x i16>,<16 x i16> *%i,align 1 451 %x = zext <16 x i16> %a to <16 x i32> 452 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 453 ret <16 x i32> %ret 454 } 455 456 ;SKX-LABEL: sext_16x16mem_to_16x32mask: 457 ;KNL-LABEL: sext_16x16mem_to_16x32mask: 458 ;SKX: ## BB#0: 459 ;SKX-NEXT: vpmovb2m %xmm0, %k1 460 ;SKX-NEXT: vpmovsxwd (%rdi), %zmm0 {%k1} {z} 461 ;KNL: vpmovsxwd (%rdi), %zmm0 {%k1} {z} 462 ;SKX-NEXT: retq 463 define <16 x i32> @sext_16x16mem_to_16x32mask(<16 x i16> *%i , <16 x i1> %mask) nounwind readnone { 464 %a = load <16 x i16>,<16 x i16> *%i,align 1 465 %x = sext <16 x i16> %a to <16 x i32> 466 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 467 ret <16 x i32> %ret 468 } 469 470 ;SKX-LABEL: sext_16x16mem_to_16x32: 471 ;KNL-LABEL: sext_16x16mem_to_16x32: 472 ;SKX: ## BB#0: 473 ;SKX-NEXT: vpmovsxwd (%rdi), %zmm0 474 ;KNL: vpmovsxwd (%rdi), %zmm0 475 ;SKX-NEXT: retq 476 define <16 x i32> @sext_16x16mem_to_16x32(<16 x i16> *%i) nounwind readnone { 477 %a = load <16 x i16>,<16 x i16> *%i,align 1 478 %x = sext <16 x i16> %a to <16 x i32> 479 ret <16 x i32> %x 480 } 481 ;SKX-LABEL: zext_16x16_to_16x32mask: 482 ;KNL-LABEL: zext_16x16_to_16x32mask: 483 ;SKX: ## BB#0: 484 ;SKX-NEXT: vpmovb2m %xmm1, %k1 485 ;SKX-NEXT: vpmovzxwd %ymm0, %zmm0 {%k1} {z} 486 ;KNL: vpmovzxwd %ymm0, %zmm0 {%k1} {z} 487 ;SKX-NEXT: retq 488 define <16 x i32> @zext_16x16_to_16x32mask(<16 x i16> %a , <16 x i1> %mask) nounwind readnone { 489 %x = zext <16 x i16> %a to <16 x i32> 490 %ret = select <16 x i1> %mask, <16 x i32> %x, <16 x i32> zeroinitializer 491 ret <16 x i32> %ret 492 } 493 494 ;SKX-LABEL: zext_16x16_to_16x32: 495 ;KNL-LABEL: zext_16x16_to_16x32: 496 ;SKX: ## BB#0: 497 ;SKX-NEXT: vpmovzxwd %ymm0, %zmm0 498 ;KNL: vpmovzxwd %ymm0, %zmm0 499 ;SKX-NEXT: retq 500 define <16 x i32> @zext_16x16_to_16x32(<16 x i16> %a ) nounwind readnone { 501 %x = zext <16 x i16> %a to <16 x i32> 502 ret <16 x i32> %x 503 } 504 505 ;SKX-LABEL: zext_2x16mem_to_2x64: 506 ;SKX: ## BB#0: 507 ;SKX-NEXT: vpmovq2m %xmm0, %k1 508 ;SKX-NEXT: vpmovzxwq (%rdi), %xmm0 {%k1} {z} 509 ;SKX-NEXT: retq 510 define <2 x i64> @zext_2x16mem_to_2x64(<2 x i16> *%i , <2 x i1> %mask) nounwind readnone { 511 %a = load <2 x i16>,<2 x i16> *%i,align 1 512 %x = zext <2 x i16> %a to <2 x i64> 513 %ret = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> zeroinitializer 514 ret <2 x i64> %ret 515 } 516 517 ;SKX-LABEL: sext_2x16mem_to_2x64mask: 518 ;SKX: ## BB#0: 519 ;SKX-NEXT: vpmovq2m %xmm0, %k1 520 ;SKX-NEXT: vpmovsxwq (%rdi), %xmm0 {%k1} {z} 521 ;SKX-NEXT: retq 522 define <2 x i64> @sext_2x16mem_to_2x64mask(<2 x i16> *%i , <2 x i1> %mask) nounwind readnone { 523 %a = load <2 x i16>,<2 x i16> *%i,align 1 524 %x = sext <2 x i16> %a to <2 x i64> 525 %ret = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> zeroinitializer 526 ret <2 x i64> %ret 527 } 528 529 ;SKX-LABEL: sext_2x16mem_to_2x64: 530 ;SKX: ## BB#0: 531 ;SKX-NEXT: vpmovsxwq (%rdi), %xmm0 532 ;SKX-NEXT: retq 533 define <2 x i64> @sext_2x16mem_to_2x64(<2 x i16> *%i) nounwind readnone { 534 %a = load <2 x i16>,<2 x i16> *%i,align 1 535 %x = sext <2 x i16> %a to <2 x i64> 536 ret <2 x i64> %x 537 } 538 539 ;SKX-LABEL: zext_4x16mem_to_4x64: 540 ;SKX: ## BB#0: 541 ;SKX-NEXT: vpmovd2m %xmm0, %k1 542 ;SKX-NEXT: vpmovzxwq (%rdi), %ymm0 {%k1} {z} 543 ;SKX-NEXT: retq 544 define <4 x i64> @zext_4x16mem_to_4x64(<4 x i16> *%i , <4 x i1> %mask) nounwind readnone { 545 %a = load <4 x i16>,<4 x i16> *%i,align 1 546 %x = zext <4 x i16> %a to <4 x i64> 547 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 548 ret <4 x i64> %ret 549 } 550 551 ;SKX-LABEL: sext_4x16mem_to_4x64mask: 552 ;SKX: ## BB#0: 553 ;SKX-NEXT: vpmovd2m %xmm0, %k1 554 ;SKX-NEXT: vpmovsxwq (%rdi), %ymm0 {%k1} {z} 555 ;SKX-NEXT: retq 556 define <4 x i64> @sext_4x16mem_to_4x64mask(<4 x i16> *%i , <4 x i1> %mask) nounwind readnone { 557 %a = load <4 x i16>,<4 x i16> *%i,align 1 558 %x = sext <4 x i16> %a to <4 x i64> 559 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 560 ret <4 x i64> %ret 561 } 562 563 ;SKX-LABEL: sext_4x16mem_to_4x64: 564 ;SKX: ## BB#0: 565 ;SKX-NEXT: vpmovsxwq (%rdi), %ymm0 566 ;SKX-NEXT: retq 567 define <4 x i64> @sext_4x16mem_to_4x64(<4 x i16> *%i) nounwind readnone { 568 %a = load <4 x i16>,<4 x i16> *%i,align 1 569 %x = sext <4 x i16> %a to <4 x i64> 570 ret <4 x i64> %x 571 } 572 573 ;SKX-LABEL: zext_8x16mem_to_8x64: 574 ;KNL-LABEL: zext_8x16mem_to_8x64: 575 ;SKX: ## BB#0: 576 ;SKX-NEXT: vpmovw2m %xmm0, %k1 577 ;SKX-NEXT: vpmovzxwq (%rdi), %zmm0 {%k1} {z} 578 ;KNL: vpmovzxwq (%rdi), %zmm0 {%k1} {z} 579 ;SKX-NEXT: retq 580 define <8 x i64> @zext_8x16mem_to_8x64(<8 x i16> *%i , <8 x i1> %mask) nounwind readnone { 581 %a = load <8 x i16>,<8 x i16> *%i,align 1 582 %x = zext <8 x i16> %a to <8 x i64> 583 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 584 ret <8 x i64> %ret 585 } 586 587 ;SKX-LABEL: sext_8x16mem_to_8x64mask: 588 ;KNL-LABEL: sext_8x16mem_to_8x64mask: 589 ;SKX: ## BB#0: 590 ;SKX-NEXT: vpmovw2m %xmm0, %k1 591 ;SKX-NEXT: vpmovsxwq (%rdi), %zmm0 {%k1} {z} 592 ;KNL: vpmovsxwq (%rdi), %zmm0 {%k1} {z} 593 ;SKX-NEXT: retq 594 define <8 x i64> @sext_8x16mem_to_8x64mask(<8 x i16> *%i , <8 x i1> %mask) nounwind readnone { 595 %a = load <8 x i16>,<8 x i16> *%i,align 1 596 %x = sext <8 x i16> %a to <8 x i64> 597 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 598 ret <8 x i64> %ret 599 } 600 601 ;SKX-LABEL: sext_8x16mem_to_8x64: 602 ;KNL-LABEL: sext_8x16mem_to_8x64: 603 ;SKX: ## BB#0: 604 ;SKX-NEXT: vpmovsxwq (%rdi), %zmm0 605 ;KNL: vpmovsxwq (%rdi), %zmm0 606 ;SKX-NEXT: retq 607 define <8 x i64> @sext_8x16mem_to_8x64(<8 x i16> *%i) nounwind readnone { 608 %a = load <8 x i16>,<8 x i16> *%i,align 1 609 %x = sext <8 x i16> %a to <8 x i64> 610 ret <8 x i64> %x 611 } 612 613 ;SKX-LABEL: zext_8x16_to_8x64mask: 614 ;KNL-LABEL: zext_8x16_to_8x64mask: 615 ;SKX: ## BB#0: 616 ;SKX-NEXT: vpmovw2m %xmm1, %k1 617 ;SKX-NEXT: vpmovzxwq %xmm0, %zmm0 {%k1} {z} 618 ;KNL: vpmovzxwq %xmm0, %zmm0 {%k1} {z} 619 ;SKX-NEXT: retq 620 define <8 x i64> @zext_8x16_to_8x64mask(<8 x i16> %a , <8 x i1> %mask) nounwind readnone { 621 %x = zext <8 x i16> %a to <8 x i64> 622 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 623 ret <8 x i64> %ret 624 } 625 626 ;SKX-LABEL: zext_8x16_to_8x64: 627 ;KNL-LABEL: zext_8x16_to_8x64: 628 ;SKX: ## BB#0: 629 ;SKX-NEXT: vpmovzxwq %xmm0, %zmm0 630 ;KNL: vpmovzxwq %xmm0, %zmm0 631 ;SKX-NEXT: retq 632 ; KNL: ret 633 define <8 x i64> @zext_8x16_to_8x64(<8 x i16> %a) nounwind readnone { 634 %ret = zext <8 x i16> %a to <8 x i64> 635 ret <8 x i64> %ret 636 } 637 638 ;SKX-LABEL: zext_2x32mem_to_2x64: 639 ;SKX: ## BB#0: 640 ;SKX-NEXT: vpmovq2m %xmm0, %k1 641 ;SKX-NEXT: vpmovzxdq (%rdi), %xmm0 {%k1} {z} 642 ;SKX-NEXT: retq 643 define <2 x i64> @zext_2x32mem_to_2x64(<2 x i32> *%i , <2 x i1> %mask) nounwind readnone { 644 %a = load <2 x i32>,<2 x i32> *%i,align 1 645 %x = zext <2 x i32> %a to <2 x i64> 646 %ret = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> zeroinitializer 647 ret <2 x i64> %ret 648 } 649 650 ;SKX-LABEL: sext_2x32mem_to_2x64mask: 651 ;SKX: ## BB#0: 652 ;SKX-NEXT: vpmovq2m %xmm0, %k1 653 ;SKX-NEXT: vpmovsxdq (%rdi), %xmm0 {%k1} {z} 654 ;SKX-NEXT: retq 655 define <2 x i64> @sext_2x32mem_to_2x64mask(<2 x i32> *%i , <2 x i1> %mask) nounwind readnone { 656 %a = load <2 x i32>,<2 x i32> *%i,align 1 657 %x = sext <2 x i32> %a to <2 x i64> 658 %ret = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> zeroinitializer 659 ret <2 x i64> %ret 660 } 661 662 ;SKX-LABEL: sext_2x32mem_to_2x64: 663 ;SKX: ## BB#0: 664 ;SKX-NEXT: vpmovsxdq (%rdi), %xmm0 665 ;SKX-NEXT: retq 666 define <2 x i64> @sext_2x32mem_to_2x64(<2 x i32> *%i) nounwind readnone { 667 %a = load <2 x i32>,<2 x i32> *%i,align 1 668 %x = sext <2 x i32> %a to <2 x i64> 669 ret <2 x i64> %x 670 } 671 672 ;SKX-LABEL: zext_4x32mem_to_4x64: 673 ;SKX: ## BB#0: 674 ;SKX-NEXT: vpmovd2m %xmm0, %k1 675 ;SKX-NEXT: vpmovzxdq (%rdi), %ymm0 {%k1} {z} 676 ;SKX-NEXT: retq 677 define <4 x i64> @zext_4x32mem_to_4x64(<4 x i32> *%i , <4 x i1> %mask) nounwind readnone { 678 %a = load <4 x i32>,<4 x i32> *%i,align 1 679 %x = zext <4 x i32> %a to <4 x i64> 680 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 681 ret <4 x i64> %ret 682 } 683 684 ;SKX-LABEL: sext_4x32mem_to_4x64mask: 685 ;SKX: ## BB#0: 686 ;SKX-NEXT: vpmovd2m %xmm0, %k1 687 ;SKX-NEXT: vpmovsxdq (%rdi), %ymm0 {%k1} {z} 688 ;SKX-NEXT: retq 689 define <4 x i64> @sext_4x32mem_to_4x64mask(<4 x i32> *%i , <4 x i1> %mask) nounwind readnone { 690 %a = load <4 x i32>,<4 x i32> *%i,align 1 691 %x = sext <4 x i32> %a to <4 x i64> 692 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 693 ret <4 x i64> %ret 694 } 695 696 ;SKX-LABEL: sext_4x32mem_to_4x64: 697 ;SKX: ## BB#0: 698 ;SKX-NEXT: vpmovsxdq (%rdi), %ymm0 699 ;SKX-NEXT: retq 700 define <4 x i64> @sext_4x32mem_to_4x64(<4 x i32> *%i) nounwind readnone { 701 %a = load <4 x i32>,<4 x i32> *%i,align 1 702 %x = sext <4 x i32> %a to <4 x i64> 703 ret <4 x i64> %x 704 } 705 706 ;SKX-LABEL: sext_4x32_to_4x64: 707 ;SKX: ## BB#0: 708 ;SKX-NEXT: vpmovsxdq %xmm0, %ymm0 709 ;SKX-NEXT: retq 710 define <4 x i64> @sext_4x32_to_4x64(<4 x i32> %a) nounwind readnone { 711 %x = sext <4 x i32> %a to <4 x i64> 712 ret <4 x i64> %x 713 } 714 715 ;SKX-LABEL: zext_4x32_to_4x64mask: 716 ;SKX: ## BB#0: 717 ;SKX-NEXT: vpmovd2m %xmm1, %k1 718 ;SKX-NEXT: vpmovzxdq %xmm0, %ymm0 {%k1} {z} 719 ;SKX-NEXT: retq 720 define <4 x i64> @zext_4x32_to_4x64mask(<4 x i32> %a , <4 x i1> %mask) nounwind readnone { 721 %x = zext <4 x i32> %a to <4 x i64> 722 %ret = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> zeroinitializer 723 ret <4 x i64> %ret 724 } 725 726 ;SKX-LABEL: zext_8x32mem_to_8x64: 727 ;SKX: ## BB#0: 728 ;SKX-NEXT: vpmovw2m %xmm0, %k1 729 ;SKX-NEXT: vpmovzxdq (%rdi), %zmm0 {%k1} {z} 730 ;SKX-NEXT: retq 731 define <8 x i64> @zext_8x32mem_to_8x64(<8 x i32> *%i , <8 x i1> %mask) nounwind readnone { 732 %a = load <8 x i32>,<8 x i32> *%i,align 1 733 %x = zext <8 x i32> %a to <8 x i64> 734 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 735 ret <8 x i64> %ret 736 } 737 738 ;SKX-LABEL: sext_8x32mem_to_8x64mask: 739 ;SKX: ## BB#0: 740 ;SKX-NEXT: vpmovw2m %xmm0, %k1 741 ;SKX-NEXT: vpmovsxdq (%rdi), %zmm0 {%k1} {z} 742 ;SKX-NEXT: retq 743 define <8 x i64> @sext_8x32mem_to_8x64mask(<8 x i32> *%i , <8 x i1> %mask) nounwind readnone { 744 %a = load <8 x i32>,<8 x i32> *%i,align 1 745 %x = sext <8 x i32> %a to <8 x i64> 746 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 747 ret <8 x i64> %ret 748 } 749 750 ;SKX-LABEL: sext_8x32mem_to_8x64: 751 ;KNL-LABEL: sext_8x32mem_to_8x64: 752 ;SKX: ## BB#0: 753 ;SKX-NEXT: vpmovsxdq (%rdi), %zmm0 754 ;KNL: vpmovsxdq (%rdi), %zmm0 755 ;SKX-NEXT: retq 756 define <8 x i64> @sext_8x32mem_to_8x64(<8 x i32> *%i) nounwind readnone { 757 %a = load <8 x i32>,<8 x i32> *%i,align 1 758 %x = sext <8 x i32> %a to <8 x i64> 759 ret <8 x i64> %x 760 } 761 762 ;SKX-LABEL: sext_8x32_to_8x64: 763 ;KNL-LABEL: sext_8x32_to_8x64: 764 ;SKX: ## BB#0: 765 ;SKX-NEXT: vpmovsxdq %ymm0, %zmm0 766 ;KNL: vpmovsxdq %ymm0, %zmm0 767 ;SKX-NEXT: retq 768 define <8 x i64> @sext_8x32_to_8x64(<8 x i32> %a) nounwind readnone { 769 %x = sext <8 x i32> %a to <8 x i64> 770 ret <8 x i64> %x 771 } 772 773 ;SKX-LABEL: zext_8x32_to_8x64mask: 774 ;KNL-LABEL: zext_8x32_to_8x64mask: 775 ;SKX: ## BB#0: 776 ;SKX-NEXT: vpmovw2m %xmm1, %k1 777 ;SKX-NEXT: vpmovzxdq %ymm0, %zmm0 {%k1} {z} 778 ;KNL: vpmovzxdq %ymm0, %zmm0 {%k1} {z} 779 ;SKX-NEXT: retq 780 define <8 x i64> @zext_8x32_to_8x64mask(<8 x i32> %a , <8 x i1> %mask) nounwind readnone { 781 %x = zext <8 x i32> %a to <8 x i64> 782 %ret = select <8 x i1> %mask, <8 x i64> %x, <8 x i64> zeroinitializer 783 ret <8 x i64> %ret 784 } 785 ;KNL-LABEL: fptrunc_test 786 ;KNL: vcvtpd2ps {{.*}}%zmm 787 ;KNL: ret 788 define <8 x float> @fptrunc_test(<8 x double> %a) nounwind readnone { 789 %b = fptrunc <8 x double> %a to <8 x float> 790 ret <8 x float> %b 791 } 792 793 ;KNL-LABEL: fpext_test 794 ;KNL: vcvtps2pd {{.*}}%zmm 795 ;KNL: ret 796 define <8 x double> @fpext_test(<8 x float> %a) nounwind readnone { 797 %b = fpext <8 x float> %a to <8 x double> 798 ret <8 x double> %b 799 } 800 801 ; KNL-LABEL: zext_16i1_to_16xi32 802 ; KNL: vpbroadcastd LCP{{.*}}(%rip), %zmm0 {%k1} {z} 803 ; KNL: ret 804 define <16 x i32> @zext_16i1_to_16xi32(i16 %b) { 805 %a = bitcast i16 %b to <16 x i1> 806 %c = zext <16 x i1> %a to <16 x i32> 807 ret <16 x i32> %c 808 } 809 810 ; KNL-LABEL: zext_8i1_to_8xi64 811 ; KNL: vpbroadcastq LCP{{.*}}(%rip), %zmm0 {%k1} {z} 812 ; KNL: ret 813 define <8 x i64> @zext_8i1_to_8xi64(i8 %b) { 814 %a = bitcast i8 %b to <8 x i1> 815 %c = zext <8 x i1> %a to <8 x i64> 816 ret <8 x i64> %c 817 } 818 819 ; KNL-LABEL: trunc_16i8_to_16i1 820 ; KNL: vpmovsxbd 821 ; KNL: vpandd 822 ; KNL: vptestmd 823 ; KNL: ret 824 ; SKX-LABEL: trunc_16i8_to_16i1 825 ; SKX: vpmovb2m %xmm 826 define i16 @trunc_16i8_to_16i1(<16 x i8> %a) { 827 %mask_b = trunc <16 x i8>%a to <16 x i1> 828 %mask = bitcast <16 x i1> %mask_b to i16 829 ret i16 %mask 830 } 831 832 ; KNL-LABEL: trunc_16i32_to_16i1 833 ; KNL: vpandd 834 ; KNL: vptestmd 835 ; KNL: ret 836 ; SKX-LABEL: trunc_16i32_to_16i1 837 ; SKX: vpmovd2m %zmm 838 define i16 @trunc_16i32_to_16i1(<16 x i32> %a) { 839 %mask_b = trunc <16 x i32>%a to <16 x i1> 840 %mask = bitcast <16 x i1> %mask_b to i16 841 ret i16 %mask 842 } 843 844 ; SKX-LABEL: trunc_4i32_to_4i1 845 ; SKX: vpmovd2m %xmm 846 ; SKX: kandw 847 ; SKX: vpmovm2d 848 define <4 x i32> @trunc_4i32_to_4i1(<4 x i32> %a, <4 x i32> %b) { 849 %mask_a = trunc <4 x i32>%a to <4 x i1> 850 %mask_b = trunc <4 x i32>%b to <4 x i1> 851 %a_and_b = and <4 x i1>%mask_a, %mask_b 852 %res = sext <4 x i1>%a_and_b to <4 x i32> 853 ret <4 x i32>%res 854 } 855 856 ; KNL-LABEL: trunc_8i16_to_8i1 857 ; KNL: vpmovsxwq 858 ; KNL: vpandq LCP{{.*}}(%rip){1to8} 859 ; KNL: vptestmq 860 ; KNL: ret 861 862 ; SKX-LABEL: trunc_8i16_to_8i1 863 ; SKX: vpmovw2m %xmm 864 define i8 @trunc_8i16_to_8i1(<8 x i16> %a) { 865 %mask_b = trunc <8 x i16>%a to <8 x i1> 866 %mask = bitcast <8 x i1> %mask_b to i8 867 ret i8 %mask 868 } 869 870 ; KNL-LABEL: sext_8i1_8i32 871 ; KNL: vpbroadcastq LCP{{.*}}(%rip), %zmm0 {%k1} {z} 872 ; SKX: vpmovm2d 873 ; KNL: ret 874 define <8 x i32> @sext_8i1_8i32(<8 x i32> %a1, <8 x i32> %a2) nounwind { 875 %x = icmp slt <8 x i32> %a1, %a2 876 %x1 = xor <8 x i1>%x, <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true> 877 %y = sext <8 x i1> %x1 to <8 x i32> 878 ret <8 x i32> %y 879 } 880 881 882 ; KNL-LABEL: trunc_i32_to_i1 883 ; KNL: movw $-4, %ax 884 ; KNL: kmovw %eax, %k1 885 ; KNL: korw 886 define i16 @trunc_i32_to_i1(i32 %a) { 887 %a_i = trunc i32 %a to i1 888 %maskv = insertelement <16 x i1> <i1 true, i1 false, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, i1 %a_i, i32 0 889 %res = bitcast <16 x i1> %maskv to i16 890 ret i16 %res 891 } 892 893 ; KNL-LABEL: sext_8i1_8i16 894 ; SKX: vpmovm2w 895 ; KNL: ret 896 define <8 x i16> @sext_8i1_8i16(<8 x i32> %a1, <8 x i32> %a2) nounwind { 897 %x = icmp slt <8 x i32> %a1, %a2 898 %y = sext <8 x i1> %x to <8 x i16> 899 ret <8 x i16> %y 900 } 901 902 ; KNL-LABEL: sext_16i1_16i32 903 ; SKX: vpmovm2d 904 ; KNL: ret 905 define <16 x i32> @sext_16i1_16i32(<16 x i32> %a1, <16 x i32> %a2) nounwind { 906 %x = icmp slt <16 x i32> %a1, %a2 907 %y = sext <16 x i1> %x to <16 x i32> 908 ret <16 x i32> %y 909 } 910 911 ; KNL-LABEL: sext_8i1_8i64 912 ; SKX: vpmovm2q 913 ; KNL: ret 914 define <8 x i64> @sext_8i1_8i64(<8 x i32> %a1, <8 x i32> %a2) nounwind { 915 %x = icmp slt <8 x i32> %a1, %a2 916 %y = sext <8 x i1> %x to <8 x i64> 917 ret <8 x i64> %y 918 } 919 920 ; KNL-LABEL: @extload_v8i64 921 ; KNL: vpmovsxbq 922 define void @extload_v8i64(<8 x i8>* %a, <8 x i64>* %res) { 923 %sign_load = load <8 x i8>, <8 x i8>* %a 924 %c = sext <8 x i8> %sign_load to <8 x i64> 925 store <8 x i64> %c, <8 x i64>* %res 926 ret void 927 } 928 929 ;SKX-LABEL: test21: 930 ;SKX: vmovdqu16 %zmm0, %zmm3 {%k1} 931 ;SKX-NEXT: kshiftrq $32, %k1, %k1 932 ;SKX-NEXT: vmovdqu16 %zmm1, %zmm2 {%k1} 933 define <64 x i16> @test21(<64 x i16> %x , <64 x i1> %mask) nounwind readnone { 934 %ret = select <64 x i1> %mask, <64 x i16> %x, <64 x i16> zeroinitializer 935 ret <64 x i16> %ret 936 } 937 938