https://gcc.gnu.org/g:55267c1cccd66882b9b5463690ff10f1f80887bd
commit 55267c1cccd66882b9b5463690ff10f1f80887bd Author: Michael Meissner <[email protected]> Date: Thu Oct 23 21:36:33 2025 -0400 Do not allow non-zero 16-bit floating point constants in easy_altivec_constant. 2025-10-23 Michael Meissner <[email protected]> gcc/ * config/rs6000/rs6000.cc (easy_altivec_constant): Do not allow non-zero 16-bit floating point constants. Diff: --- gcc/config/rs6000/rs6000.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 809a27b16c0f..5b60c9791c13 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -6517,9 +6517,12 @@ easy_altivec_constant (rtx op, machine_mode mode) else if (mode != GET_MODE (op)) return 0; - /* V2DI/V2DF was added with VSX. Only allow 0 and all 1's as easy - constants. */ - if (mode == V2DFmode) + /* V2DI/V2DF was added with VSX. Only allow 0 and all 1's as easy constants. + Likewise, don't handle 16-bit floating point constants here, unless they + are 0.0. */ + if (mode == V2DFmode + || FP16_SCALAR_MODE_P (mode) + || FP16_VECTOR_MODE_P (mode)) return zero_constant (op, mode) ? 8 : 0; else if (mode == V2DImode)
