Skip to content

Commit 123375f

Browse files
iclsrcFznamznon
authored andcommitted
[X86] Move 128/256-bit FP16/BF16 typedef to emmintrin.h or or avxintrin.h, NFCI
Co-authored-by: Mariya Podchishchaeva <[email protected]>
1 parent dbfe3ea commit 123375f

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

clang/lib/Headers/avx512bf16intrin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
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)));
2022
typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));
2123

2224
#define __DEFAULT_FN_ATTRS512 \

clang/lib/Headers/avx512fp16intrin.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
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)));
2228

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

clang/lib/Headers/avx512vlbf16intrin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
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+
1821
#define __DEFAULT_FN_ATTRS128 \
1922
__attribute__((__always_inline__, __nodebug__, \
2023
__target__("avx512vl, avx512bf16"), __min_vector_width__(128)))

clang/lib/Headers/avxintrin.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ 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-
5242
/* Define the default attributes for the functions in this file. */
5343
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx"), __min_vector_width__(256)))
5444
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx"), __min_vector_width__(128)))

clang/lib/Headers/emmintrin.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ 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-
5141
/* Define the default attributes for the functions in this file. */
5242
#define __DEFAULT_FN_ATTRS \
5343
__attribute__((__always_inline__, __nodebug__, __target__("sse2"), \

0 commit comments

Comments
 (0)