1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=core-avx2 -mattr=+avx2 | FileCheck %s
4 define <4 x i64> @test_vpaddq(<4 x i64> %i, <4 x i64> %j) nounwind readnone {
5 %x = add <4 x i64> %i, %j
10 define <8 x i32> @test_vpaddd(<8 x i32> %i, <8 x i32> %j) nounwind readnone {
11 %x = add <8 x i32> %i, %j
16 define <16 x i16> @test_vpaddw(<16 x i16> %i, <16 x i16> %j) nounwind readnone {
17 %x = add <16 x i16> %i, %j
22 define <32 x i8> @test_vpaddb(<32 x i8> %i, <32 x i8> %j) nounwind readnone {
23 %x = add <32 x i8> %i, %j
28 define <4 x i64> @test_vpsubq(<4 x i64> %i, <4 x i64> %j) nounwind readnone {
29 %x = sub <4 x i64> %i, %j
34 define <8 x i32> @test_vpsubd(<8 x i32> %i, <8 x i32> %j) nounwind readnone {
35 %x = sub <8 x i32> %i, %j
40 define <16 x i16> @test_vpsubw(<16 x i16> %i, <16 x i16> %j) nounwind readnone {
41 %x = sub <16 x i16> %i, %j
46 define <32 x i8> @test_vpsubb(<32 x i8> %i, <32 x i8> %j) nounwind readnone {
47 %x = sub <32 x i8> %i, %j
52 define <8 x i32> @test_vpmulld(<8 x i32> %i, <8 x i32> %j) nounwind readnone {
53 %x = mul <8 x i32> %i, %j
58 define <16 x i16> @test_vpmullw(<16 x i16> %i, <16 x i16> %j) nounwind readnone {
59 %x = mul <16 x i16> %i, %j
64 ; CHECK: vpmuludq %ymm
65 ; CHECK-NEXT: vpsrlq $32, %ymm
66 ; CHECK-NEXT: vpmuludq %ymm
67 ; CHECK-NEXT: vpsllq $32, %ymm
68 ; CHECK-NEXT: vpaddq %ymm
69 ; CHECK-NEXT: vpsrlq $32, %ymm
70 ; CHECK-NEXT: vpmuludq %ymm
71 ; CHECK-NEXT: vpsllq $32, %ymm
72 ; CHECK-NEXT: vpaddq %ymm
73 define <4 x i64> @mul-v4i64(<4 x i64> %i, <4 x i64> %j) nounwind readnone {
74 %x = mul <4 x i64> %i, %j
81 define <8 x i32> @mul_const1(<8 x i32> %x) {
82 %y = mul <8 x i32> %x, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2>
89 define <4 x i64> @mul_const2(<4 x i64> %x) {
90 %y = mul <4 x i64> %x, <i64 4, i64 4, i64 4, i64 4>
97 define <16 x i16> @mul_const3(<16 x i16> %x) {
98 %y = mul <16 x i16> %x, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
106 define <4 x i64> @mul_const4(<4 x i64> %x) {
107 %y = mul <4 x i64> %x, <i64 -1, i64 -1, i64 -1, i64 -1>
114 define <8 x i32> @mul_const5(<8 x i32> %x) {
115 %y = mul <8 x i32> %x, <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
122 define <8 x i32> @mul_const6(<8 x i32> %x) {
123 %y = mul <8 x i32> %x, <i32 0, i32 0, i32 0, i32 2, i32 0, i32 2, i32 0, i32 0>
131 define <8 x i64> @mul_const7(<8 x i64> %x) {
132 %y = mul <8 x i64> %x, <i64 2, i64 2, i64 2, i64 2, i64 2, i64 2, i64 2, i64 2>
139 define <8 x i16> @mul_const8(<8 x i16> %x) {
140 %y = mul <8 x i16> %x, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
147 define <8 x i32> @mul_const9(<8 x i32> %x) {
148 %y = mul <8 x i32> %x, <i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
155 define <4 x i32> @mul_const10(<4 x i32> %x) {
157 %m = mul <4 x i32> %x, <i32 16843009, i32 16843009, i32 16843009, i32 16843009>
164 define <4 x i32> @mul_const11(<4 x i32> %x) {
166 %m = mul <4 x i32> %x, <i32 2155905152, i32 2155905152, i32 2155905152, i32 2155905152>