Skip to content

Commit

Permalink
Fix style, make MSVC compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
Logikable committed May 16, 2024
1 parent a68ef78 commit 8c789f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ typedef float32x4_t __m128d;
typedef int64x2_t __m128i; /* 128-bit vector containing integers */

// Some intrinsics operate on unaligned data types.
typedef int16_t __attribute__((aligned(1))) unaligned_int16_t;
typedef int32_t __attribute__((aligned(1))) unaligned_int32_t;
typedef int64_t __attribute__((aligned(1))) unaligned_int64_t;
typedef int16_t ALIGN_STRUCT(1) unaligned_int16_t;
typedef int32_t ALIGN_STRUCT(1) unaligned_int32_t;
typedef int64_t ALIGN_STRUCT(1) unaligned_int64_t;

// __int64 is defined in the Intrinsics Guide which maps to different datatype
// in different data model
Expand Down Expand Up @@ -1932,7 +1932,7 @@ FORCE_INLINE __m128 _mm_loadu_ps(const float *p)
FORCE_INLINE __m128i _mm_loadu_si16(const void *p)
{
return vreinterpretq_m128i_s16(
vsetq_lane_s16(*(const int16_t *) p, vdupq_n_s16(0), 0));
vsetq_lane_s16(*(const unaligned_int16_t *) p, vdupq_n_s16(0), 0));
}

// Load unaligned 64-bit integer from memory into the first element of dst.
Expand Down
8 changes: 4 additions & 4 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ result_t test_mm_loadu_si16(const SSE2NEONTestImpl &impl, uint32_t iter)
return TEST_UNIMPL;
#else
const unaligned_int16_t *addr =
(const unaligned_int16_t *)(impl.mTestUnalignedInts + 1);
(const unaligned_int16_t *) (impl.mTestUnalignedInts + 1);

__m128i ret = _mm_loadu_si16((const void *) addr);

Expand All @@ -2167,7 +2167,7 @@ result_t test_mm_loadu_si64(const SSE2NEONTestImpl &impl, uint32_t iter)
return TEST_UNIMPL;
#else
const unaligned_int64_t *addr =
(const unaligned_int64_t *)(impl.mTestUnalignedInts + 1);
(const unaligned_int64_t *) (impl.mTestUnalignedInts + 1);

__m128i ret = _mm_loadu_si64((const void *) addr);

Expand Down Expand Up @@ -5035,7 +5035,7 @@ result_t test_mm_loadu_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
result_t test_mm_loadu_si128(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const unaligned_int32_t *_a =
(const unaligned_int32_t *)(impl.mTestUnalignedInts + 1);
(const unaligned_int32_t *) (impl.mTestUnalignedInts + 1);
__m128i c = _mm_loadu_si128((const __m128i *) _a);
return VALIDATE_INT32_M128(c, _a);
}
Expand All @@ -5049,7 +5049,7 @@ result_t test_mm_loadu_si32(const SSE2NEONTestImpl &impl, uint32_t iter)
return TEST_UNIMPL;
#else
const unaligned_int32_t *addr =
(const unaligned_int32_t *)(impl.mTestUnalignedInts + 1);
(const unaligned_int32_t *) (impl.mTestUnalignedInts + 1);

__m128i ret = _mm_loadu_si32((const void *) addr);

Expand Down

0 comments on commit 8c789f4

Please sign in to comment.