On Thu, Jul 16, 2026 at 06:52:03PM +0530, Kishan Parmar wrote:
> Add support for the DMF (Dense Math Facility) and MMA+
> (Matrix-Multiply Assist Plus) builtins and instructions which may be
> available on a future Power processor.
> 
> This patch extends the existing MMA infrastructure to support Dense
> Math Registers (DMRs).
> 
> Key changes:
> 
> 1. Extended MMA operand support from 7 to 9 operands (MAX_MMA_OPERANDS)
> 
> 2. Added new DMF-specific unspecs:
> 
>    * UNSPEC_DMF_DMXOR for DMR XOR operations
>    * UNSPEC_DMF_DMXVI8GERX4* for DMR GER (outer product) operations
>    * UNSPEC_DMF_PMDMXVI8GERX4* for prefixed DMR GER operations
>    * UNSPEC_DMF_DMSETDMRZ for zeroing a DMR register
> 
> 3. Implemented new instruction patterns in mma.md:
> 
>    * dmf_build_dmr: Build a DMR from eight vector operands
>    * dmf_dmsetdmrz: Zero a DMR register
>    * dmf_dmxor: XOR operation on DMR registers
>    * dmf_dmxvi8gerx4/dmxvi8gerx4pp: DMR outer product operations
>    * dmf_pmdmxvi8gerx4/pmdmxvi8gerx4pp: Prefixed DMR outer product
>      operations
> 
> 4. Added new DMF builtins and updated GIMPLE folding:
> 
>    * Added DMF and MMA+ builtins
>    * Updated GIMPLE folding to handle DMR pass-by-reference semantics
>    * Extended builtin expansion to support up to 9 operand instructions
> 
> 5. Added documentation for the new DMF and MMA+ builtins.
> 
> The implementation follows the existing MMA pattern where user-facing
> builtins use pass-by-reference for DMR arguments, while internal
> builtins use pass-by-value for optimization.
> 
> 2026-07-15  Peter Bergner  <[email protected]>
>           Surya Kumari Jangala  <[email protected]>
>           Kishan Parmar  <[email protected]>
> 
> gcc/ChangeLog:
>       * config/rs6000/mma.md (MAX_MMA_OPERANDS): Increase from 7 to 9.
>       (UNSPEC_DMF_DMXOR): New unspec.
>       (UNSPEC_DMF_DMXVI8GERX4): Likewise.
>       (UNSPEC_DMF_DMXVI8GERX4PP): Likewise.
>       (UNSPEC_DMF_PMDMXVI8GERX4): Likewise.
>       (UNSPEC_DMF_PMDMXVI8GERX4PP): Likewise.
>       (UNSPEC_DMF_DMSETDMRZ): Likewise.
>       (DMF_PV): New iterator.
>       (DMF_DPV): Likewise.
>       (DMF_PVI8I4I4): Likewise.
>       (DMF_DPVI8I4I4): Likewise.
>       (pv): Add DMF mappings.
>       (apv): Likewise.
>       (pvi8i4i4): New attribute.
>       (dpvi8i4i4): Likewise.
>       (dmf_build_dmr): New define_expand.
>       (dmf_dmsetdmrz): New insn.
>       (dmf_dmxor): Likewise.
>       (dmf_<pv>): New insn pattern.
>       (dmf_<apv>): Likewise.
>       (dmf_<pvi8i4i4>): Likewise.
>       (dmf_<dpvi8i4i4>): Likewise.
>       * config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_mma_builtin): Add
>       DMF builtin support. Handle DMR pass-by-reference semantics.
>       Support up to nine builtin operands.
>       (mma_expand_builtin): Likewise.
>       (rs6000_expand_builtin): Handle DMF builtins.
>       * config/rs6000/rs6000-builtins.def: Add DMF and MMA+ builtin
>       definitions.
>       * doc/extend.texi
>       (PowerPC Matrix-Multiply Assist Built-in Functions): Document
>       MMA+ builtins.
>       (PowerPC Dense Math Facility Built-in Functions): Document DMF builtins.
> 
> gcc/testsuite/ChangeLog:
>       * gcc.target/powerpc/dmf-build-dmr.c: New test.
>       * gcc.target/powerpc/dmf-builtin.c: New test.

All of these patches are cleared to be back ported to the GCC 16 branch
after a short delay to make sure the master branch was not broken,
given they only modify PowerPC specific files or documentation files.

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

Reply via email to