On Sun, Aug 23, 2026 at 09:36:12PM -0500, Manjunath S Matti wrote:
> The changes have been bootstrapped and regression tested on
> powerpc64le-linux and powerpc64-linux.
> 
> V1TImode is only enabled when TARGET_VSX is set (see
> rs6000_option_override_internal, wherers6000_vector_mem[V1TImode] and
> rs6000_vector_unit[V1TImode] are only set up under TARGET_VSX).
> Consequently rs6000_vector_mode_supported_p returns false for V1TImode
> with -mno-vsx, and vector_type_mode () demotes the "vector __int128"
> types to plain TImode.
> 
> Moving these built-ins to the [vsx] stanza so they are gated on
> TARGET_VSX, which is where the corresponding V2DF/V2DI vperm/vsel/vsldoi
> built-ins already live.  We then emit a proper diagnostic instead of
> ICEing, similar to PR109932 was fixed for __builtin_pack_vector_int128:
> 
> vec_perm and vec_sld on __int128 vectors ICEd in exactly the same way
> and are fixed by the same change. __builtin_altivec_lvx_v1ti is
> deliberately left in [altivec]: it goes through ldv_expand_builtin ()
> rather than the generic path, does not ICE, and produces semantically
> correct code with -mno-vsx.
> 
> 2026-08-23  Manjunath Matti  <[email protected]>
> 
>       PR target/126512
> gcc/ChangeLog:
>       * config/rs6000/rs6000-builtins.def (__builtin_altivec_vperm_1ti,
>       __builtin_altivec_vperm_1ti_uns, __builtin_altivec_vsel_1ti,
>       __builtin_altivec_vsel_1ti_uns, __builtin_altivec_vsldoi_v1ti): Move
>       from the [altivec] stanza to the [vsx] stanza.
> 
> gcc/testsuite/ChangeLog:
>         PR target/126512
>         * gcc.target/powerpc/pr126512.c: New test.

This looks ok for the master branch, once you fix the errors mentioned
in the thread (i.e. move the PR target/126512 after gcc/Changelog).  If
the test only shows up with -mno-vsx, I'm not sure we need a test with
-mvsx.

I imagine the PVIR is probably older that __int128_t and vector
__int128_t.  As I recall, vector __int128_t was added to support some
built-ins on power8 (IIRC).  The issue at the time was __int128_t
values weren't allowed in vector registers (for vec_vaddcuq,
vec_vaddcuq, etc.).

Given it is a bug, if previous GCC versions show the issue, you can
backport the changes to the older branches that are open for bug
submissions if the older branches show the bug after a week breakin
period if the master changes don't cause any problems.

-- 
Michael Meissner, IBM
PO Box 98, Ayer, Massachusetts, USA, 01432
email: [email protected]

Reply via email to