Improve SFmode vector splat code generation on Power7/Power8.
Optimizes SFmode vector splatting on Power7/Power8 by using specific load and splat instructions.
This commit enhances vector splat code generation for single-precision floating-point (SFmode) values on Power7 and Power8 processors. It replaces the previous load, conversion, and splat sequence with more efficient instructions: lfiwzx and xxspltw on Power7, and lxsiwzx and xxspltw on Power8, when loading from memory. The change also broadens support for SFmode splat inputs to all VSX targets and uses vsx_splat_v4sf for vector initialization.
In Details
This patch targets SFmode splatting on Power7/8 by replacing the existing load-convert-splat sequence with direct memory load instructions (lfiwzx/lxsiwzx) followed by the xxspltw instruction. This bypasses intermediate conversion steps, improving performance. The pattern vsx_splat_v4sf is now used for all V4SFmode splats on VSX targets, and memory-load alternatives are added for Power7/8. Register inputs retain the existing conversion/splat sequence.
- SFmode
- GCC's internal representation for single-precision floating-point numbers (32-bit).
- vector splat
- An operation that takes a single value and replicates it across all elements of a vector register.
- Power7/Power8
- Specific generations of IBM's PowerPC processor architecture, known for their vector processing capabilities (VSX).
- VSX
- Vector Scalar Extension. An instruction set extension for PowerPC architectures that provides SIMD (Single Instruction, Multiple Data) capabilities.
- lfiwzx/lxsiwzx
- PowerPC assembly instructions for loading a word from memory into a vector register, with zero-extension or sign-extension respectively, and aligning the data.
- xxspltw
- A PowerPC VSX instruction that performs a vector splat operation on a word, replicating it to fill a vector register.