1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-options "-O2 -mavx512vl -mno-avx512dq" } */
3 
4 #include <x86intrin.h>
5 
6 __m128d
f1(__m128d a,__m128d b)7 f1 (__m128d a, __m128d b)
8 {
9   register __m128d c __asm ("xmm16") = a;
10   asm volatile ("" : "+v" (c));
11   c = _mm_and_pd (c, b);
12   asm volatile ("" : "+v" (c));
13   return c;
14 }
15 
16 /* { dg-final { scan-assembler-times "vpandq\[^\n\r\]*xmm\[0-9\]" 1 } } */
17 
18 __m128d
f2(__m128d a,__m128d b)19 f2 (__m128d a, __m128d b)
20 {
21   register __m128d c __asm ("xmm16") = a;
22   asm volatile ("" : "+v" (c));
23   c = _mm_or_pd (c, b);
24   asm volatile ("" : "+v" (c));
25   return c;
26 }
27 
28 /* { dg-final { scan-assembler-times "vporq\[^\n\r\]*xmm\[0-9\]" 1 } } */
29 
30 __m128d
f3(__m128d a,__m128d b)31 f3 (__m128d a, __m128d b)
32 {
33   register __m128d c __asm ("xmm16") = a;
34   asm volatile ("" : "+v" (c));
35   c = _mm_xor_pd (c, b);
36   asm volatile ("" : "+v" (c));
37   return c;
38 }
39 
40 /* { dg-final { scan-assembler-times "vpxorq\[^\n\r\]*xmm\[0-9\]" 1 } } */
41 
42 __m128d
f4(__m128d a,__m128d b)43 f4 (__m128d a, __m128d b)
44 {
45   register __m128d c __asm ("xmm16") = a;
46   asm volatile ("" : "+v" (c));
47   c = _mm_andnot_pd (c, b);
48   asm volatile ("" : "+v" (c));
49   return c;
50 }
51 
52 /* { dg-final { scan-assembler-times "vpandnq\[^\n\r\]*xmm\[0-9\]" 1 } } */
53 
54 __m128
f5(__m128 a,__m128 b)55 f5 (__m128 a, __m128 b)
56 {
57   register __m128 c __asm ("xmm16") = a;
58   asm volatile ("" : "+v" (c));
59   c = _mm_and_ps (c, b);
60   asm volatile ("" : "+v" (c));
61   return c;
62 }
63 
64 /* { dg-final { scan-assembler-times "vpandd\[^\n\r\]*xmm\[0-9\]" 1 } } */
65 
66 __m128
f6(__m128 a,__m128 b)67 f6 (__m128 a, __m128 b)
68 {
69   register __m128 c __asm ("xmm16") = a;
70   asm volatile ("" : "+v" (c));
71   c = _mm_or_ps (c, b);
72   asm volatile ("" : "+v" (c));
73   return c;
74 }
75 
76 /* { dg-final { scan-assembler-times "vpord\[^\n\r\]*xmm\[0-9\]" 1 } } */
77 
78 __m128
f7(__m128 a,__m128 b)79 f7 (__m128 a, __m128 b)
80 {
81   register __m128 c __asm ("xmm16") = a;
82   asm volatile ("" : "+v" (c));
83   c = _mm_xor_ps (c, b);
84   asm volatile ("" : "+v" (c));
85   return c;
86 }
87 
88 /* { dg-final { scan-assembler-times "vpxord\[^\n\r\]*xmm\[0-9\]" 1 } } */
89 
90 __m128
f8(__m128 a,__m128 b)91 f8 (__m128 a, __m128 b)
92 {
93   register __m128 c __asm ("xmm16") = a;
94   asm volatile ("" : "+v" (c));
95   c = _mm_andnot_ps (c, b);
96   asm volatile ("" : "+v" (c));
97   return c;
98 }
99 
100 /* { dg-final { scan-assembler-times "vpandnd\[^\n\r\]*xmm\[0-9\]" 1 } } */
101 
102 __m256d
f9(__m256d a,__m256d b)103 f9 (__m256d a, __m256d b)
104 {
105   register __m256d c __asm ("xmm16") = a;
106   asm volatile ("" : "+v" (c));
107   c = _mm256_and_pd (c, b);
108   asm volatile ("" : "+v" (c));
109   return c;
110 }
111 
112 /* { dg-final { scan-assembler-times "vpandq\[^\n\r\]*ymm\[0-9\]" 1 } } */
113 
114 __m256d
f10(__m256d a,__m256d b)115 f10 (__m256d a, __m256d b)
116 {
117   register __m256d c __asm ("xmm16") = a;
118   asm volatile ("" : "+v" (c));
119   c = _mm256_or_pd (c, b);
120   asm volatile ("" : "+v" (c));
121   return c;
122 }
123 
124 /* { dg-final { scan-assembler-times "vporq\[^\n\r\]*ymm\[0-9\]" 1 } } */
125 
126 __m256d
f11(__m256d a,__m256d b)127 f11 (__m256d a, __m256d b)
128 {
129   register __m256d c __asm ("xmm16") = a;
130   asm volatile ("" : "+v" (c));
131   c = _mm256_xor_pd (c, b);
132   asm volatile ("" : "+v" (c));
133   return c;
134 }
135 
136 /* { dg-final { scan-assembler-times "vpxorq\[^\n\r\]*ymm\[0-9\]" 1 } } */
137 
138 __m256d
f12(__m256d a,__m256d b)139 f12 (__m256d a, __m256d b)
140 {
141   register __m256d c __asm ("xmm16") = a;
142   asm volatile ("" : "+v" (c));
143   c = _mm256_andnot_pd (c, b);
144   asm volatile ("" : "+v" (c));
145   return c;
146 }
147 
148 /* { dg-final { scan-assembler-times "vpandnq\[^\n\r\]*ymm\[0-9\]" 1 } } */
149 
150 __m256
f13(__m256 a,__m256 b)151 f13 (__m256 a, __m256 b)
152 {
153   register __m256 c __asm ("xmm16") = a;
154   asm volatile ("" : "+v" (c));
155   c = _mm256_and_ps (c, b);
156   asm volatile ("" : "+v" (c));
157   return c;
158 }
159 
160 /* { dg-final { scan-assembler-times "vpandd\[^\n\r\]*ymm\[0-9\]" 1 } } */
161 
162 __m256
f14(__m256 a,__m256 b)163 f14 (__m256 a, __m256 b)
164 {
165   register __m256 c __asm ("xmm16") = a;
166   asm volatile ("" : "+v" (c));
167   c = _mm256_or_ps (c, b);
168   asm volatile ("" : "+v" (c));
169   return c;
170 }
171 
172 /* { dg-final { scan-assembler-times "vpord\[^\n\r\]*ymm\[0-9\]" 1 } } */
173 
174 __m256
f15(__m256 a,__m256 b)175 f15 (__m256 a, __m256 b)
176 {
177   register __m256 c __asm ("xmm16") = a;
178   asm volatile ("" : "+v" (c));
179   c = _mm256_xor_ps (c, b);
180   asm volatile ("" : "+v" (c));
181   return c;
182 }
183 
184 /* { dg-final { scan-assembler-times "vpxord\[^\n\r\]*ymm\[0-9\]" 1 } } */
185 
186 __m256
f16(__m256 a,__m256 b)187 f16 (__m256 a, __m256 b)
188 {
189   register __m256 c __asm ("xmm16") = a;
190   asm volatile ("" : "+v" (c));
191   c = _mm256_andnot_ps (c, b);
192   asm volatile ("" : "+v" (c));
193   return c;
194 }
195 
196 /* { dg-final { scan-assembler-times "vpandnd\[^\n\r\]*ymm\[0-9\]" 1 } } */
197