Skip to content

Commit dab9156

Browse files
authored
[X86] Add missing explicit conversion for AMXAVX512 and SHA (llvm#127385)
Address the X86 part of llvm#126491
1 parent e8d8488 commit dab9156

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

clang/lib/Headers/amxavx512intrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
/// dst.byte[i] := a.row[row_index].byte[row_chunk+i]
229229
/// ENDFOR
230230
/// \endcode
231-
#define _tile_movrow(a, b) __builtin_ia32_tilemovrow(a, b)
231+
#define _tile_movrow(a, b) ((__m512i)__builtin_ia32_tilemovrow(a, b))
232232

233233
/// This is internal intrinsic. C/C++ user should avoid calling it directly.
234234

clang/lib/Headers/shaintrin.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@
4747
/// An immediate value where bits [1:0] select among four possible
4848
/// combining functions and rounding constants (not specified here).
4949
/// \returns A 128-bit vector of [4 x i32] containing the updated SHA-1 state.
50-
#define _mm_sha1rnds4_epu32(V1, V2, M) \
51-
__builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), (__v4si)(__m128i)(V2), (M))
50+
#define _mm_sha1rnds4_epu32(V1, V2, M) \
51+
((__m128i)__builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), \
52+
(__v4si)(__m128i)(V2), (M)))
5253

5354
/// Calculates the SHA-1 state variable E from the SHA-1 state variables in
5455
/// the 128-bit vector of [4 x i32] in \a __X, adds that to the next set of

clang/test/CodeGen/X86/amxavx512-builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +amx-tile -target-feature +amx-avx512 \
2-
// RUN: -target-feature +avx10.2-512 -emit-llvm -o - -Wall -Werror -pedantic -Wno-gnu-statement-expression | FileCheck %s
2+
// RUN: -target-feature +avx10.2-512 -emit-llvm -o - -Wall -Werror -pedantic -Wno-gnu-statement-expression -flax-vector-conversions=none | FileCheck %s
33

44
#include <immintrin.h>
55
#include <stddef.h>

clang/test/CodeGen/X86/sha-builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-unknown-unknown -target-feature +sha -emit-llvm -o - | FileCheck %s
1+
// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-unknown-unknown -target-feature +sha -emit-llvm -flax-vector-conversions=none -o - | FileCheck %s
22

33

44
#include <immintrin.h>

0 commit comments

Comments
 (0)