diff --git a/clang/lib/Headers/avx512fp16intrin.h b/clang/lib/Headers/avx512fp16intrin.h --- a/clang/lib/Headers/avx512fp16intrin.h +++ b/clang/lib/Headers/avx512fp16intrin.h @@ -82,11 +82,11 @@ _Float16 __h21, _Float16 __h22, _Float16 __h23, _Float16 __h24, _Float16 __h25, _Float16 __h26, _Float16 __h27, _Float16 __h28, _Float16 __h29, _Float16 __h30, _Float16 __h31, _Float16 __h32) { - return (__m512h)(__v32hf){__h1, __h2, __h3, __h4, __h5, __h6, __h7, - __h8, __h9, __h10, __h11, __h12, __h13, __h14, - __h15, __h16, __h17, __h18, __h19, __h20, __h21, - __h22, __h23, __h24, __h25, __h26, __h27, __h28, - __h29, __h30, __h31, __h32}; + return (__m512h)(__v32hf){__h32, __h31, __h30, __h29, __h28, __h27, __h26, + __h25, __h24, __h23, __h22, __h21, __h20, __h19, + __h18, __h17, __h16, __h15, __h14, __h13, __h12, + __h11, __h10, __h9, __h8, __h7, __h6, __h5, + __h4, __h3, __h2, __h1}; } #define _mm512_setr_ph(__h1, __h2, __h3, __h4, __h5, __h6, __h7, __h8, __h9, \ diff --git a/clang/lib/Headers/avx512vlfp16intrin.h b/clang/lib/Headers/avx512vlfp16intrin.h --- a/clang/lib/Headers/avx512vlfp16intrin.h +++ b/clang/lib/Headers/avx512vlfp16intrin.h @@ -48,7 +48,7 @@ static __inline __m128h __DEFAULT_FN_ATTRS128 _mm_set_ph(_Float16 __h1, _Float16 __h2, _Float16 __h3, _Float16 __h4, _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8) { - return (__m128h)(__v8hf){__h1, __h2, __h3, __h4, __h5, __h6, __h7, __h8}; + return (__m128h)(__v8hf){__h8, __h7, __h6, __h5, __h4, __h3, __h2, __h1}; } static __inline __m256h __DEFAULT_FN_ATTRS256 @@ -56,9 +56,9 @@ _Float16 __h5, _Float16 __h6, _Float16 __h7, _Float16 __h8, _Float16 __h9, _Float16 __h10, _Float16 __h11, _Float16 __h12, _Float16 __h13, _Float16 __h14, _Float16 __h15, _Float16 __h16) { - return (__m256h)(__v16hf){__h1, __h2, __h3, __h4, __h5, __h6, - __h7, __h8, __h9, __h10, __h11, __h12, - __h13, __h14, __h15, __h16}; + return (__m256h)(__v16hf){__h16, __h15, __h14, __h13, __h12, __h11, + __h10, __h9, __h8, __h7, __h6, __h5, + __h4, __h3, __h2, __h1}; } #define _mm_setr_ph(__h1, __h2, __h3, __h4, __h5, __h6, __h7, __h8) \