clang 20.0.0git
fma4intrin.h
Go to the documentation of this file.
1/*===---- fma4intrin.h - FMA4 intrinsics -----------------------------------===
2 *
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 *
7 *===-----------------------------------------------------------------------===
8 */
9
10#ifndef __X86INTRIN_H
11#error "Never use <fma4intrin.h> directly; include <x86intrin.h> instead."
12#endif
13
14#ifndef __FMA4INTRIN_H
15#define __FMA4INTRIN_H
16
17#include <pmmintrin.h>
18
19/* Define the default attributes for the functions in this file. */
20#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(128)))
21#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(256)))
22
23static __inline__ __m128 __DEFAULT_FN_ATTRS128
24_mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
25{
26 return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
27}
28
29static __inline__ __m128d __DEFAULT_FN_ATTRS128
30_mm_macc_pd(__m128d __A, __m128d __B, __m128d __C)
31{
32 return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C);
33}
34
35static __inline__ __m128 __DEFAULT_FN_ATTRS128
36_mm_macc_ss(__m128 __A, __m128 __B, __m128 __C)
37{
38 return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
39}
40
41static __inline__ __m128d __DEFAULT_FN_ATTRS128
42_mm_macc_sd(__m128d __A, __m128d __B, __m128d __C)
43{
44 return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, (__v2df)__C);
45}
46
47static __inline__ __m128 __DEFAULT_FN_ATTRS128
48_mm_msub_ps(__m128 __A, __m128 __B, __m128 __C)
49{
50 return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
51}
52
53static __inline__ __m128d __DEFAULT_FN_ATTRS128
54_mm_msub_pd(__m128d __A, __m128d __B, __m128d __C)
55{
56 return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
57}
58
59static __inline__ __m128 __DEFAULT_FN_ATTRS128
60_mm_msub_ss(__m128 __A, __m128 __B, __m128 __C)
61{
62 return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
63}
64
65static __inline__ __m128d __DEFAULT_FN_ATTRS128
66_mm_msub_sd(__m128d __A, __m128d __B, __m128d __C)
67{
68 return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
69}
70
71static __inline__ __m128 __DEFAULT_FN_ATTRS128
72_mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C)
73{
74 return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
75}
76
77static __inline__ __m128d __DEFAULT_FN_ATTRS128
78_mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C)
79{
80 return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);
81}
82
83static __inline__ __m128 __DEFAULT_FN_ATTRS128
84_mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C)
85{
86 return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
87}
88
89static __inline__ __m128d __DEFAULT_FN_ATTRS128
90_mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C)
91{
92 return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);
93}
94
95static __inline__ __m128 __DEFAULT_FN_ATTRS128
96_mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C)
97{
98 return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
99}
100
101static __inline__ __m128d __DEFAULT_FN_ATTRS128
102_mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C)
103{
104 return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);
105}
106
107static __inline__ __m128 __DEFAULT_FN_ATTRS128
108_mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C)
109{
110 return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
111}
112
113static __inline__ __m128d __DEFAULT_FN_ATTRS128
114_mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C)
115{
116 return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);
117}
118
119static __inline__ __m128 __DEFAULT_FN_ATTRS128
120_mm_maddsub_ps(__m128 __A, __m128 __B, __m128 __C)
121{
122 return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
123}
124
125static __inline__ __m128d __DEFAULT_FN_ATTRS128
126_mm_maddsub_pd(__m128d __A, __m128d __B, __m128d __C)
127{
128 return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, (__v2df)__C);
129}
130
131static __inline__ __m128 __DEFAULT_FN_ATTRS128
132_mm_msubadd_ps(__m128 __A, __m128 __B, __m128 __C)
133{
134 return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
135}
136
137static __inline__ __m128d __DEFAULT_FN_ATTRS128
138_mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C)
139{
140 return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
141}
142
143static __inline__ __m256 __DEFAULT_FN_ATTRS256
144_mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C)
145{
146 return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
147}
148
149static __inline__ __m256d __DEFAULT_FN_ATTRS256
150_mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C)
151{
152 return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);
153}
154
155static __inline__ __m256 __DEFAULT_FN_ATTRS256
156_mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C)
157{
158 return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
159}
160
161static __inline__ __m256d __DEFAULT_FN_ATTRS256
162_mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C)
163{
164 return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);
165}
166
167static __inline__ __m256 __DEFAULT_FN_ATTRS256
168_mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C)
169{
170 return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
171}
172
173static __inline__ __m256d __DEFAULT_FN_ATTRS256
174_mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C)
175{
176 return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C);
177}
178
179static __inline__ __m256 __DEFAULT_FN_ATTRS256
180_mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C)
181{
182 return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
183}
184
185static __inline__ __m256d __DEFAULT_FN_ATTRS256
186_mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C)
187{
188 return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C);
189}
190
191static __inline__ __m256 __DEFAULT_FN_ATTRS256
192_mm256_maddsub_ps(__m256 __A, __m256 __B, __m256 __C)
193{
194 return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
195}
196
197static __inline__ __m256d __DEFAULT_FN_ATTRS256
198_mm256_maddsub_pd(__m256d __A, __m256d __B, __m256d __C)
199{
200 return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);
201}
202
203static __inline__ __m256 __DEFAULT_FN_ATTRS256
204_mm256_msubadd_ps(__m256 __A, __m256 __B, __m256 __C)
205{
206 return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
207}
208
209static __inline__ __m256d __DEFAULT_FN_ATTRS256
210_mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C)
211{
212 return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);
213}
214
215#undef __DEFAULT_FN_ATTRS128
216#undef __DEFAULT_FN_ATTRS256
217
218#endif /* __FMA4INTRIN_H */
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:90
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:114
static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C)
Definition: fma4intrin.h:150
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_macc_ss(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:36
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_msub_sd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:66
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_msub_ps(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:48
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_macc_sd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:42
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:84
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:138
static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C)
Definition: fma4intrin.h:186
static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C)
Definition: fma4intrin.h:174
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:96
static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_msubadd_ps(__m256 __A, __m256 __B, __m256 __C)
Definition: fma4intrin.h:204
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_macc_pd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:30
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_msub_ss(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:60
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:108
static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C)
Definition: fma4intrin.h:156
static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C)
Definition: fma4intrin.h:180
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_msubadd_ps(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:132
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:24
#define __DEFAULT_FN_ATTRS256
Definition: fma4intrin.h:21
static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_maddsub_pd(__m256d __A, __m256d __B, __m256d __C)
Definition: fma4intrin.h:198
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:102
static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C)
Definition: fma4intrin.h:162
#define __DEFAULT_FN_ATTRS128
Definition: fma4intrin.h:20
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:78
static __inline__ __m256d __DEFAULT_FN_ATTRS256 _mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C)
Definition: fma4intrin.h:210
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_maddsub_pd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:126
static __inline__ __m128d __DEFAULT_FN_ATTRS128 _mm_msub_pd(__m128d __A, __m128d __B, __m128d __C)
Definition: fma4intrin.h:54
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:72
static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_maddsub_ps(__m256 __A, __m256 __B, __m256 __C)
Definition: fma4intrin.h:192
static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C)
Definition: fma4intrin.h:144
static __inline__ __m256 __DEFAULT_FN_ATTRS256 _mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C)
Definition: fma4intrin.h:168
static __inline__ __m128 __DEFAULT_FN_ATTRS128 _mm_maddsub_ps(__m128 __A, __m128 __B, __m128 __C)
Definition: fma4intrin.h:120