Support vector loads/stores with right-aligned length for PowerPC future target
GCC enables new PowerPC vector load/store instructions that use the bottom bits for length.
GCC now supports new PowerPC vector load and store instructions designed for a future architecture revision. Unlike current instructions that require the byte count in the most significant bits of a register, these new variants expect it in the least significant bits. This change simplifies code generation by avoiding bit shifts and is enabled with the -mcpu=future flag. It also corrects an issue where these instructions were incorrectly generated for 32-bit systems.
In Details
This commit enhances the rs6000 backend to support future PowerPC vector load/store instructions (lxvrl, lxvrll, stxvrl, stxvrll) which use the bottom 8 bits of a GPR for the length field, unlike current instructions requiring the top 8 bits (shifted left by 56). This is enabled via -mcpu=future. The changes involve new MD patterns in vsx.md and adjustments to rs6000-string.cc's expand_block_move to prevent incorrect generation on 32-bit platforms. A new test lxvrl.c is added.
- PowerPC
- A RISC instruction set architecture developed by Apple, IBM, and Motorola. It's used in various embedded systems, servers, and historically in Apple Macintosh computers.
- vector load/store
- Instructions that load or store multiple data elements (a vector) from or to memory in a single operation. These are crucial for SIMD (Single Instruction, Multiple Data) processing.
- SIMD
- Single Instruction, Multiple Data. A class of parallel computers in Flynn's taxonomy that perform the same operation on multiple data points simultaneously. Vector instructions are a common way to achieve SIMD.
- GPR
- General-Purpose Register. A programmable storage location within a CPU that can be used for various data manipulation tasks.
- -mcpu=future
- A GCC compiler flag that targets a hypothetical future version of the PowerPC architecture, enabling support for upcoming instructions and features.