1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX
6 declare <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16>, <8 x i16>) nounwind readnone
7 declare <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8>, <16 x i8>) nounwind readnone
9 define <4 x i32> @combine_pmaddwd_zero(<8 x i16> %a0, <8 x i16> %a1) {
10 ; SSE-LABEL: combine_pmaddwd_zero:
12 ; SSE-NEXT: xorps %xmm0, %xmm0
15 ; AVX-LABEL: combine_pmaddwd_zero:
17 ; AVX-NEXT: vxorps %xmm0, %xmm0, %xmm0
19 %1 = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> %a0, <8 x i16> zeroinitializer)
23 define <4 x i32> @combine_pmaddwd_zero_commute(<8 x i16> %a0, <8 x i16> %a1) {
24 ; SSE-LABEL: combine_pmaddwd_zero_commute:
26 ; SSE-NEXT: xorps %xmm0, %xmm0
29 ; AVX-LABEL: combine_pmaddwd_zero_commute:
31 ; AVX-NEXT: vxorps %xmm0, %xmm0, %xmm0
33 %1 = call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> zeroinitializer, <8 x i16> %a0)
37 define <8 x i16> @combine_pmaddubsw_zero(<16 x i8> %a0, <16 x i8> %a1) {
38 ; SSE-LABEL: combine_pmaddubsw_zero:
40 ; SSE-NEXT: xorps %xmm0, %xmm0
43 ; AVX-LABEL: combine_pmaddubsw_zero:
45 ; AVX-NEXT: vxorps %xmm0, %xmm0, %xmm0
47 %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> %a0, <16 x i8> zeroinitializer)
51 define <8 x i16> @combine_pmaddubsw_zero_commute(<16 x i8> %a0, <16 x i8> %a1) {
52 ; SSE-LABEL: combine_pmaddubsw_zero_commute:
54 ; SSE-NEXT: xorps %xmm0, %xmm0
57 ; AVX-LABEL: combine_pmaddubsw_zero_commute:
59 ; AVX-NEXT: vxorps %xmm0, %xmm0, %xmm0
61 %1 = call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128(<16 x i8> zeroinitializer, <16 x i8> %a0)