Skip to content

Commit e0fb01e

Browse files
committed
[X86] Move 128/256-bit FP16/BF16 typedef to emmintrin.h or avxintrin.h, NFCI
1 parent 3ee5859 commit e0fb01e

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

clang/lib/Headers/avx512bf16intrin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
typedef __bf16 __v32bf __attribute__((__vector_size__(64), __aligned__(64)));
1919
typedef __bf16 __m512bh __attribute__((__vector_size__(64), __aligned__(64)));
20-
typedef __bf16 __v16bf __attribute__((__vector_size__(32), __aligned__(32)));
21-
typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));
2220
typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));
2321

2422
#define __DEFAULT_FN_ATTRS512 \

clang/lib/Headers/avx512fp16intrin.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
typedef _Float16 __v32hf __attribute__((__vector_size__(64), __aligned__(64)));
2020
typedef _Float16 __m512h __attribute__((__vector_size__(64), __aligned__(64)));
2121
typedef _Float16 __m512h_u __attribute__((__vector_size__(64), __aligned__(1)));
22-
typedef _Float16 __v8hf __attribute__((__vector_size__(16), __aligned__(16)));
23-
typedef _Float16 __m128h __attribute__((__vector_size__(16), __aligned__(16)));
24-
typedef _Float16 __m128h_u __attribute__((__vector_size__(16), __aligned__(1)));
25-
typedef _Float16 __v16hf __attribute__((__vector_size__(32), __aligned__(32)));
26-
typedef _Float16 __m256h __attribute__((__vector_size__(32), __aligned__(32)));
27-
typedef _Float16 __m256h_u __attribute__((__vector_size__(32), __aligned__(1)));
2822

2923
/* Define the default attributes for the functions in this file. */
3024
#define __DEFAULT_FN_ATTRS512 \

clang/lib/Headers/avx512vlbf16intrin.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#ifndef __AVX512VLBF16INTRIN_H
1616
#define __AVX512VLBF16INTRIN_H
1717

18-
typedef __bf16 __v8bf __attribute__((__vector_size__(16), __aligned__(16)));
19-
typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));
20-
2118
#define __DEFAULT_FN_ATTRS128 \
2219
__attribute__((__always_inline__, __nodebug__, \
2320
__target__("avx512vl, avx512bf16"), __min_vector_width__(128)))

clang/lib/Headers/avxintrin.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ typedef float __m256_u __attribute__ ((__vector_size__ (32), __aligned__(1)));
3939
typedef double __m256d_u __attribute__((__vector_size__(32), __aligned__(1)));
4040
typedef long long __m256i_u __attribute__((__vector_size__(32), __aligned__(1)));
4141

42+
#ifdef __SSE2__
43+
/* Both _Float16 and __bf16 require SSE2 being enabled. */
44+
typedef _Float16 __v16hf __attribute__((__vector_size__(32), __aligned__(32)));
45+
typedef _Float16 __m256h __attribute__((__vector_size__(32), __aligned__(32)));
46+
typedef _Float16 __m256h_u __attribute__((__vector_size__(32), __aligned__(1)));
47+
48+
typedef __bf16 __v16bf __attribute__((__vector_size__(32), __aligned__(32)));
49+
typedef __bf16 __m256bh __attribute__((__vector_size__(32), __aligned__(32)));
50+
#endif
51+
4252
/* Define the default attributes for the functions in this file. */
4353
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx"), __min_vector_width__(256)))
4454
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx"), __min_vector_width__(128)))

clang/lib/Headers/emmintrin.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ typedef unsigned char __v16qu __attribute__((__vector_size__(16)));
3838
* appear in the interface though. */
3939
typedef signed char __v16qs __attribute__((__vector_size__(16)));
4040

41+
#ifdef __SSE2__
42+
/* Both _Float16 and __bf16 require SSE2 being enabled. */
43+
typedef _Float16 __v8hf __attribute__((__vector_size__(16), __aligned__(16)));
44+
typedef _Float16 __m128h __attribute__((__vector_size__(16), __aligned__(16)));
45+
typedef _Float16 __m128h_u __attribute__((__vector_size__(16), __aligned__(1)));
46+
47+
typedef __bf16 __v8bf __attribute__((__vector_size__(16), __aligned__(16)));
48+
typedef __bf16 __m128bh __attribute__((__vector_size__(16), __aligned__(16)));
49+
#endif
50+
4151
/* Define the default attributes for the functions in this file. */
4252
#define __DEFAULT_FN_ATTRS \
4353
__attribute__((__always_inline__, __nodebug__, __target__("sse2"), \

0 commit comments

Comments
 (0)