Skip to content

Fix ARM64 NEON type conversion errors for GCC 13+ compatibility#64

Merged
zkingston merged 4 commits intoKavrakiLab:mainfrom
saahu27:fix-arm64-neon-gcc13-compatibility
Sep 8, 2025
Merged

Fix ARM64 NEON type conversion errors for GCC 13+ compatibility#64
zkingston merged 4 commits intoKavrakiLab:mainfrom
saahu27:fix-arm64-neon-gcc13-compatibility

Conversation

@saahu27
Copy link
Contributor

@saahu27 saahu27 commented Sep 8, 2025

  • Fix vmvnq_s32 usage with explicit uint32 reinterpret cast
  • Fix vcvtq_s32_f32 to vcvtq_f32_s32 for proper float conversion
  • Fix vreinterpretq_u32_f32 to vreinterpretq_f32_u32 for sign mask
  • Add explicit reinterpret cast for sign_mask_sin usage

These changes resolve compilation errors on ARM64 with GCC 13+ which enforces stricter type checking for NEON intrinsics.

- Fix vmvnq_s32 usage with explicit uint32 reinterpret cast
- Fix vcvtq_s32_f32 to vcvtq_f32_s32 for proper float conversion
- Fix vreinterpretq_u32_f32 to vreinterpretq_f32_u32 for sign mask
- Add explicit reinterpret cast for sign_mask_sin usage

These changes resolve compilation errors on ARM64 with GCC 13+
which enforces stricter type checking for NEON intrinsics.
Remove unnecessary vreinterpretq_u32_s32 cast since vceqq_s32
already returns uint32x4_t which can be directly passed to vmvnq_u32.

This resolves the remaining ARM64 compilation error:
'cannot convert uint32x4_t to __Int32x4_t'
Copy link
Collaborator

@zkingston zkingston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment but other than that LGTM.

As pointed out by @zkingston, sign_mask_sin is already float32x4_t
and blend() expects float32x4_t, so no conversion is needed.

The blend function internally handles the conversion to uint32x4_t
for vbslq_f32, making the double cast redundant.
@saahu27 saahu27 force-pushed the fix-arm64-neon-gcc13-compatibility branch from 1a5dc68 to 49fa08c Compare September 8, 2025 17:06
@zkingston zkingston merged commit ea5c3da into KavrakiLab:main Sep 8, 2025
7 checks passed
@saahu27 saahu27 deleted the fix-arm64-neon-gcc13-compatibility branch September 9, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants