; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512vl | FileCheck %s --check-prefix=X64-AVX512 --check-prefix=X64-AVX512VL ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefix=X64-AVX512 --check-prefix=X64-AVX512BWVL ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512dq,+avx512vl | FileCheck %s --check-prefix=X64-AVX512 --check-prefix=X64-AVX512DQVL define <8 x double> @test_broadcast_4f64_8f64(<4 x double> *%p) nounwind { ; X64-AVX512-LABEL: test_broadcast_4f64_8f64: ; X64-AVX512: ## %bb.0: ; X64-AVX512-NEXT: vbroadcastf64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3] ; X64-AVX512-NEXT: vaddpd {{.*}}(%rip), %zmm0, %zmm0 ; X64-AVX512-NEXT: retq %1 = load <4 x double>, <4 x double> *%p %2 = shufflevector <4 x double> %1, <4 x double> undef, <8 x i32> %3 = fadd <8 x double> %2, ret <8 x double> %3 } define <8 x i64> @test_broadcast_4i64_8i64(<4 x i64> *%p) nounwind { ; X64-AVX512-LABEL: test_broadcast_4i64_8i64: ; X64-AVX512: ## %bb.0: ; X64-AVX512-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3] ; X64-AVX512-NEXT: vpaddq {{.*}}(%rip), %zmm0, %zmm0 ; X64-AVX512-NEXT: retq %1 = load <4 x i64>, <4 x i64> *%p %2 = shufflevector <4 x i64> %1, <4 x i64> undef, <8 x i32> %3 = add <8 x i64> %2, ret <8 x i64> %3 } define <16 x float> @test_broadcast_8f32_16f32(<8 x float> *%p) nounwind { ; X64-AVX512-LABEL: test_broadcast_8f32_16f32: ; X64-AVX512: ## %bb.0: ; X64-AVX512-NEXT: vbroadcastf64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3] ; X64-AVX512-NEXT: vaddps {{.*}}(%rip), %zmm0, %zmm0 ; X64-AVX512-NEXT: retq %1 = load <8 x float>, <8 x float> *%p %2 = shufflevector <8 x float> %1, <8 x float> undef, <16 x i32> %3 = fadd <16 x float> %2, ret <16 x float> %3 } define <16 x i32> @test_broadcast_8i32_16i32(<8 x i32> *%p) nounwind { ; X64-AVX512-LABEL: test_broadcast_8i32_16i32: ; X64-AVX512: ## %bb.0: ; X64-AVX512-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3] ; X64-AVX512-NEXT: vpaddd {{.*}}(%rip), %zmm0, %zmm0 ; X64-AVX512-NEXT: retq %1 = load <8 x i32>, <8 x i32> *%p %2 = shufflevector <8 x i32> %1, <8 x i32> undef, <16 x i32> %3 = add <16 x i32> %2, ret <16 x i32> %3 } define <32 x i16> @test_broadcast_16i16_32i16(<16 x i16> *%p) nounwind { ; X64-AVX512VL-LABEL: test_broadcast_16i16_32i16: ; X64-AVX512VL: ## %bb.0: ; X64-AVX512VL-NEXT: vmovdqa (%rdi), %ymm0 ; X64-AVX512VL-NEXT: vpaddw {{.*}}(%rip), %ymm0, %ymm1 ; X64-AVX512VL-NEXT: vpaddw {{.*}}(%rip), %ymm0, %ymm0 ; X64-AVX512VL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; X64-AVX512VL-NEXT: retq ; ; X64-AVX512BWVL-LABEL: test_broadcast_16i16_32i16: ; X64-AVX512BWVL: ## %bb.0: ; X64-AVX512BWVL-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3] ; X64-AVX512BWVL-NEXT: vpaddw {{.*}}(%rip), %zmm0, %zmm0 ; X64-AVX512BWVL-NEXT: retq ; ; X64-AVX512DQVL-LABEL: test_broadcast_16i16_32i16: ; X64-AVX512DQVL: ## %bb.0: ; X64-AVX512DQVL-NEXT: vmovdqa (%rdi), %ymm0 ; X64-AVX512DQVL-NEXT: vpaddw {{.*}}(%rip), %ymm0, %ymm1 ; X64-AVX512DQVL-NEXT: vpaddw {{.*}}(%rip), %ymm0, %ymm0 ; X64-AVX512DQVL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; X64-AVX512DQVL-NEXT: retq %1 = load <16 x i16>, <16 x i16> *%p %2 = shufflevector <16 x i16> %1, <16 x i16> undef, <32 x i32> %3 = add <32 x i16> %2, ret <32 x i16> %3 } define <64 x i8> @test_broadcast_32i8_64i8(<32 x i8> *%p) nounwind { ; X64-AVX512VL-LABEL: test_broadcast_32i8_64i8: ; X64-AVX512VL: ## %bb.0: ; X64-AVX512VL-NEXT: vmovdqa (%rdi), %ymm0 ; X64-AVX512VL-NEXT: vpaddb {{.*}}(%rip), %ymm0, %ymm1 ; X64-AVX512VL-NEXT: vpaddb {{.*}}(%rip), %ymm0, %ymm0 ; X64-AVX512VL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; X64-AVX512VL-NEXT: retq ; ; X64-AVX512BWVL-LABEL: test_broadcast_32i8_64i8: ; X64-AVX512BWVL: ## %bb.0: ; X64-AVX512BWVL-NEXT: vbroadcasti64x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3] ; X64-AVX512BWVL-NEXT: vpaddb {{.*}}(%rip), %zmm0, %zmm0 ; X64-AVX512BWVL-NEXT: retq ; ; X64-AVX512DQVL-LABEL: test_broadcast_32i8_64i8: ; X64-AVX512DQVL: ## %bb.0: ; X64-AVX512DQVL-NEXT: vmovdqa (%rdi), %ymm0 ; X64-AVX512DQVL-NEXT: vpaddb {{.*}}(%rip), %ymm0, %ymm1 ; X64-AVX512DQVL-NEXT: vpaddb {{.*}}(%rip), %ymm0, %ymm0 ; X64-AVX512DQVL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0 ; X64-AVX512DQVL-NEXT: retq %1 = load <32 x i8>, <32 x i8> *%p %2 = shufflevector <32 x i8> %1, <32 x i8> undef, <64 x i32> %3 = add <64 x i8> %2, ret <64 x i8> %3 }