Skip to content

Commit

Permalink
use C++ style casts in simd.h
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Oct 3, 2024
1 parent 4ff703c commit 7b46816
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hal/src/main/native/athena/simd/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

// This file contains snippets from the Simd Library by Ihar Yermalayeu
// This file contains modified snippets from the Simd Library by Ihar Yermalayeu
// (http://ermig1979.github.io/Simd). The original source file names are listed
// above each section.
/*
Expand Down Expand Up @@ -95,7 +95,7 @@ SIMD_INLINE uint8x8x4_t LoadHalf4<true>(const uint8_t* p) {
#if SIMD_NEON_PREFECH_SIZE
__builtin_prefetch(p + SIMD_NEON_PREFECH_SIZE);
#endif
uint8_t* _p = (uint8_t*)__builtin_assume_aligned(p, 8);
uint8_t* _p = static_cast<uint8_t*>(__builtin_assume_aligned(p, 8));
return vld4_u8(_p);
#elif defined(_MSC_VER)
return vld4_u8_ex(p, 64);
Expand All @@ -121,7 +121,7 @@ SIMD_INLINE uint8x16x4_t Load4<true>(const uint8_t* p) {
#if SIMD_NEON_PREFECH_SIZE
__builtin_prefetch(p + SIMD_NEON_PREFECH_SIZE);
#endif
uint8_t* _p = (uint8_t*)__builtin_assume_aligned(p, 16);
uint8_t* _p = static_cast<uint8_t*>(__builtin_assume_aligned(p, 16));
return vld4q_u8(_p);
#elif defined(_MSC_VER)
return vld4q_u8_ex(p, 128);
Expand All @@ -142,7 +142,7 @@ SIMD_INLINE void Store4<false>(uint8_t* p, uint8x16x4_t a) {
template <>
SIMD_INLINE void Store4<true>(uint8_t* p, uint8x16x4_t a) {
#if defined(__GNUC__)
uint8_t* _p = (uint8_t*)__builtin_assume_aligned(p, 16);
uint8_t* _p = static_cast<uint8_t*>(__builtin_assume_aligned(p, 16));
vst4q_u8(_p, a);
#elif defined(_MSC_VER)
vst4q_u8_ex(p, a, 128);
Expand All @@ -162,7 +162,7 @@ SIMD_INLINE void Store4<false>(uint8_t* p, uint8x8x4_t a) {
template <>
SIMD_INLINE void Store4<true>(uint8_t* p, uint8x8x4_t a) {
#if defined(__GNUC__)
uint8_t* _p = (uint8_t*)__builtin_assume_aligned(p, 8);
uint8_t* _p = static_cast<uint8_t*>(__builtin_assume_aligned(p, 8));
vst4_u8(_p, a);
#elif defined(_MSC_VER)
vst4_u8_ex(p, a, 64);
Expand Down

0 comments on commit 7b46816

Please sign in to comment.