Skip to content

Commit

Permalink
Fix type punning in AArch64_AM_isSVEMaskOfIdenticalElements
Browse files Browse the repository at this point in the history
  • Loading branch information
kazarmy committed Jan 7, 2024
1 parent b9c260e commit 52d7560
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/AArch64/AArch64AddressingModes.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ static inline uint64_t AArch64_AM_decodeAdvSIMDModImmType12(uint8_t Imm)
#define DEFINE_isSVEMaskOfIdenticalElements(T) \
static inline bool CONCAT(AArch64_AM_isSVEMaskOfIdenticalElements, T)(int64_t Imm) \
{ \
T *Parts = (T *)(&(Imm)); \
T Parts[sizeof(int64_t) / sizeof(T)]; \
memcpy(Parts, &Imm, sizeof(int64_t) / sizeof(T) * sizeof(T)); \
for (int i = 0; i < (sizeof(int64_t) / sizeof(T)); i++) { \
if (Parts[i] != Parts[0]) \
return false; \
Expand Down

0 comments on commit 52d7560

Please sign in to comment.