Skip to content

Fix for GCC 15 compiler error on PPC8/PPC9/PPC10#2445

Merged
copybara-service[bot] merged 1 commit intogoogle:masterfrom
johnplatts:hwy_ppc_gcc15_fix_011725
Jan 20, 2025
Merged

Fix for GCC 15 compiler error on PPC8/PPC9/PPC10#2445
copybara-service[bot] merged 1 commit intogoogle:masterfrom
johnplatts:hwy_ppc_gcc15_fix_011725

Conversation

@johnplatts
Copy link
Copy Markdown
Contributor

Resolves issue #2443.

This pull request adds detail::VsxXvcvspsxds and detail::VsxXvcvspuxds, which are wrappers around the VSX xvcvspsxds and xvcvspuxds instructions.

__builtin_vsx_xvcvspsxds is replaced with detail::VsxXvcvspsxds in the implementations of F32->I64 PromoteTo, F32->I64 PromoteUpperTo, F32->I64 PromoteOddTo, and F32->I64 PromoteUpperTo on PPC8/PPC9/PPC10.

__builtin_vsx_xvcvspuxds is replaced with detail::VsxXvcvspuxds in the implementations of F32->U64 PromoteTo, F32->U64 PromoteUpperTo, F32->U64 PromoteOddTo, and F32->U64 PromoteUpperTo on PPC8/PPC9/PPC10.

detail::VsxXvcvspsxds takes a Vec128<float, N> vector and returns the result of the VsxXvcvspsxds instruction as a Vec128<int64_t, ((N + 1) / 2)> vector.

detail::VsxXvcvspuxds takes a Vec128<float, N> vector and returns the result of the VsxXvcvspuxds instruction as a Vec128<uint64_t, ((N + 1) / 2)> vector.

The VSX F32->I64 vec_signede, F32->I64 vec_signedo, F32->U64 vec_unsignede, and F32->U64 vec_unsignedo intrinsics are only available with GCC 15 or later and not available with GCC 14 or earlier or Clang 20 or earlier.

detail::VsxXvcvspsxds also includes an inline assembly fallback for Clang 12 or earlier which lack the __builtin_vsx_xvcvspsxds, F32->I64 vec_signede, and F32->I64 vec_signedo intrinsics.

detail::VsxXvcvspuxds also includes an inline assembly fallback for Clang 12 or earlier which lack the __builtin_vsx_xvcvspuxds, F32->U64 vec_unsignede, and F32->U64 vec_unsignedo intrinsics.

Copy link
Copy Markdown
Member

@jan-wassenberg jan-wassenberg left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants