Skip to content

Commit

Permalink
Fix vqshlud_n_s64 implementation to be 64-bit.
Browse files Browse the repository at this point in the history
The scalar vqshlud_n_s64 function was wrong, and there was no test
case for it (or the scalar 32 bit form).  Add test cases for the
scalar functions (test vectors generated on GCE ARMv9 system),
validate the fix for the 64-bit scalar form.
  • Loading branch information
Syonyk authored and mr-c committed Jan 4, 2025
1 parent 858b005 commit 3527e86
Show file tree
Hide file tree
Showing 2 changed files with 1,210 additions and 86 deletions.
4 changes: 2 additions & 2 deletions simde/arm/neon/qshlu_n.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ SIMDE_FUNCTION_ATTRIBUTES
uint64_t
simde_vqshlud_n_s64(int64_t a, const int n)
SIMDE_REQUIRE_CONSTANT_RANGE(n, 0, 63) {
uint32_t r = HEDLEY_STATIC_CAST(uint32_t, a << n);
r |= (((r >> n) != HEDLEY_STATIC_CAST(uint32_t, a)) ? UINT32_MAX : 0);
uint64_t r = HEDLEY_STATIC_CAST(uint64_t, a << n);
r |= (((r >> n) != HEDLEY_STATIC_CAST(uint64_t, a)) ? UINT64_MAX : 0);
return (a < 0) ? 0 : r;
}
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE)
Expand Down
Loading

0 comments on commit 3527e86

Please sign in to comment.