]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn: fix vcc clobber in vector load/store
authorAndrew Stubbs <ams@codesourcery.com>
Wed, 13 May 2020 15:05:54 +0000 (16:05 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Fri, 29 May 2020 12:42:03 +0000 (13:42 +0100)
commit49a35d1f699892907d7a34198274a286993c0f22
tree376304a77443bd2d236de8fc6a4fe1732da3f391
parent0579f339110acb85d5bda128588f4d57c45dfe7a
amdgcn: fix vcc clobber in vector load/store

This switches the code that expands scalar addresses to vectors of addresses
from using VCC to using CC_SAVE_REG, for the lo-part to hi-part carry values.
These were fine in code expanded in earlier passes, but addresses expanded
late, such as for stack spills or reloads, could clobber live VCC values,
causing execution failures.

This is the first target-specific testcase for GCN, so the new .exp file is
included.

Backport from master:

gcc/
* config/gcn/gcn-valu.md (add<mode>3_zext_dup): Change to a
define_expand, and rename the original to ...
(add<mode>3_vcc_zext_dup): ... this, and add a custom VCC operand.
(add<mode>3_zext_dup_exec): Likewise, with ...
(add<mode>3_vcc_zext_dup_exec): ... this.
(add<mode>3_zext_dup2): Likewise, with ...
(add<mode>3_zext_dup_exec): ... this.
(add<mode>3_zext_dup2_exec): Likewise, with ...
(add<mode>3_zext_dup2): ... this.
* config/gcn/gcn.c (gcn_expand_scalar_to_vector_address): Switch
addv64di3_zext* calls to use addv64di3_vcc_zext*.

gcc/testsuite/
* gcc.target/gcn/gcn.exp: New file.
* gcc.target/gcn/vcc-clobber.c: New file.
gcc/config/gcn/gcn-valu.md
gcc/config/gcn/gcn.c
gcc/testsuite/gcc.target/gcn/gcn.exp [new file with mode: 0644]
gcc/testsuite/gcc.target/gcn/vcc-clobber.c [new file with mode: 0644]