diff options
author | Michael Meissner <meissner@linux.ibm.com> | 2022-03-11 19:47:09 -0500 |
---|---|---|
committer | Michael Meissner <meissner@linux.ibm.com> | 2022-03-11 19:47:09 -0500 |
commit | 3cb27b85a7b977958d53e1a29596ba211d21dde2 (patch) | |
tree | 33a42bf06126fe44d1b53c3b5b40db0f340872d8 | |
parent | b00f9761b9b9bfa2be6dfd41b3f56a8ae9dba6d0 (diff) | |
download | gcc-3cb27b85a7b977958d53e1a29596ba211d21dde2.zip gcc-3cb27b85a7b977958d53e1a29596ba211d21dde2.tar.gz gcc-3cb27b85a7b977958d53e1a29596ba211d21dde2.tar.bz2 |
Fix DImode to TImode sign extend issue
PR target/104868 had had an issue where my code that updated the DImode to
TImode sign extension for power10 failed. In looking at the failure
message, the reason is when extendditi2 tries to split the insn, it
generates an insn that does not satisfy its constraints:
(set (reg:V2DI 65 1)
(vec_duplicate:V2DI (reg:DI 0)))
The reason is vsx_splat_v2di does not allow GPR register 0 when the will
be generating a mtvsrdd instruction. In the definition of the mtvsrdd
instruction, if the RA register is 0, it means clear the upper 64 bits of
the vector instead of moving register GPR 0 to those bits.
When I wrote the extendditi2 pattern, I forgot that mtvsrdd had that
behavior so I used a 'r' constraint instead of 'b'. In the rare case
where the value is in GPR register 0, this split will fail.
This patch uses the right constraint for extendditi2.
2022-03-11 Michael Meissner <meissner@linux.ibm.com>
gcc/
PR target/104868
* config/rs6000/vsx.md (extendditi2): Use a 'b' constraint when
moving from a GPR register to an Altivec register.
-rw-r--r-- | gcc/config/rs6000/vsx.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index d0fb92f..15bd86d 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -5033,7 +5033,7 @@ ;; generate the vextsd2q instruction. (define_insn_and_split "extendditi2" [(set (match_operand:TI 0 "register_operand" "=r,r,v,v,v") - (sign_extend:TI (match_operand:DI 1 "input_operand" "r,m,r,wa,Z"))) + (sign_extend:TI (match_operand:DI 1 "input_operand" "r,m,b,wa,Z"))) (clobber (reg:DI CA_REGNO))] "TARGET_POWERPC64 && TARGET_POWER10" "#" |