x86-64: Increase gain for TImode pand/pior/pxor loads
x86-64 target cost model now correctly accounts for TImode bitwise loads, improving instruction selection.
The cost model for x86-64 has been updated to assign a gain of one instruction cost to pand, pior, and pxor operations on TImode operands. This accurately reflects that these operations on 128-bit integers require a single memory load, unlike previous costings that might have implied two loads for DImode operations. This change should lead to more optimal instruction selection for bitwise operations on 128-bit data types.
In Details
The timode_scalar_chain::compute_convert_gain function in gcc/config/i386/i386-features.cc is modified to include COSTS_N_INSNS (1) for TImode pand, pior, and pxor loads. This addresses PR target/127020 by correctly modeling the cost of these operations, which require a single memory load for 128-bit operands, as opposed to potentially modeling them as multiple DImode operations.
- TImode
- A GCC machine mode representing a 128-bit integer type. This is often used for SIMD (Single Instruction, Multiple Data) operations.
- pand
- Bitwise AND operation.
- pior
- Bitwise OR operation.
- pxor
- Bitwise XOR operation.
- Cost model
- A part of the compiler that estimates the execution cost (e.g., latency, instruction count) of different operations and instructions on a specific target architecture. This guides the optimizer's instruction selection.
- DImode
- A GCC machine mode representing a 64-bit integer type.