On Tue, May 19, 2026 at 05:25:49PM +0530, jeevitha wrote:
> Hi All,
> 
> The following changes have been bootstrapped and regression tested on
> powerpc64le-linux. Is this okay for trunk?
> 
> Changes from V2:
>   * Added TARGET_VSX check to all new insn patterns.
>   * Added * prefix to vsx_mul pattern.
>   * Added new test cases vsx_simd-3.c and vsx_simd-4.c.
>   * Created new future-vsx stanza to map builtins.
> 
> Changes from V1:
>   * Incorporated wording suggestions.
>   * Renamed mode iterators to VIMulH and VIArith for better clarity.
>   * Removed extra blank line in vsx_simd-*.c test case.
>   * Replaced unspec with proper smul_highpart and umul_highpart RTL
>     codes for multiply-high patterns.
>   * Added * prefix to internal patterns for vsx_add, vsx_sub, altivec_add,
>     altivec_sub, altivec_smul and altivec_umul.
>   * Updated extend.texi.
> 
> This patch adds support for VSX vector arithmetic instructions that may
> be added to future PowerPC processors. Note that the names of these
> builtins may change in the future.
> 
> New VSX patterns are added for vector add, subtract, multiply, and
> multiply-high instructions guarded by TARGET_FUTURE. Existing Altivec
> patterns are renamed to altivec_* to avoid name conflicts.

A couple of minor things.

> 2026-05-19  Jeevitha Palanisamy  <[email protected]>
> 
> gcc/
>       * config/rs6000/altivec.md (*vsx_add<mode>3): New insn pattern.

While it isn't a hard and fast rule (and we may/may not want to address
it in general clean up), most of the VSX specific things go in vsx.md
instead of altivec.md.  The main exception is the IEEE 128-bit floating
point support (using traditional Altivec registers) is in rs6000.md and
not in either altivec.md or vsx.md.

When I added the VSX support many years ago, it seemed simpler to have
a separation between the traditional Altivec support and the new VSX
support which was completely different.

>       (*altivec_add<mode>3): Renamed from add<mode>3.
>       (*vsx_sub<mode>3): New insn pattern.
>       (*altivec_sub<mode>3): Renamed from sub<mode>3.
>       * config/rs6000/vector.md (VIMulH): New mode iterator.

I'm not a big fan of iterators using mixed case, but I don't have
strong sentiments against it.

> gcc/testsuite/
>       * gcc.target/powerpc/vsx_simd-1.c: New test.
>       * gcc.target/powerpc/vsx_simd-2.c: Likewise.
>       * gcc.target/powerpc/vsx_simd-3.c: Likewise.
>       * gcc.target/powerpc/vsx_simd-4.c: Likewise.

These need guards like:

/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-require-effective-target powerpc_vsx } */

You might not need the powerpc_vsx line, since it should be on by
default for future systems, but given these are VSX specific, it
doesn't hurt to add it.

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

Reply via email to