diff options
author | Julian Brown <julian@codesourcery.com> | 2021-06-28 06:58:52 -0700 |
---|---|---|
committer | Julian Brown <julian@codesourcery.com> | 2021-06-29 08:19:56 -0700 |
commit | 5c127c4cac308429cba483a2ac4e175c2ab26165 (patch) | |
tree | 94b1e23835c53cf205715efce26e4d09d2ebd3ca | |
parent | 7a973fc03a52b5f39bf60dc0ef2fdf4a2e2ec7c8 (diff) | |
download | gcc-5c127c4cac308429cba483a2ac4e175c2ab26165.zip gcc-5c127c4cac308429cba483a2ac4e175c2ab26165.tar.gz gcc-5c127c4cac308429cba483a2ac4e175c2ab26165.tar.bz2 |
amdgcn: Mark s_mulk_i32 as clobbering SCC
The s_mulk_i32 instruction sets the SCC status register according to
whether the multiplication overflows, but that is not currently modelled
in the GCN backend. AFAIK this is a latent bug and hasn't been noticed
"in the wild", but it should be fixed.
2021-06-29 Julian Brown <julian@codesourcery.com>
gcc/
* config/gcn/gcn.md (mulsi3): Make s_mulk_i32 variant clobber SCC.
-rw-r--r-- | gcc/config/gcn/gcn.md | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md index b5f895a..cca4552 100644 --- a/gcc/config/gcn/gcn.md +++ b/gcc/config/gcn/gcn.md @@ -1371,10 +1371,13 @@ ; Vector multiply has vop3a encoding, but no corresponding vop2a, so no long ; immediate. +; The "s_mulk_i32" variant sets SCC to indicate overflow (which we don't care +; about here, but we need to indicate the clobbering). (define_insn "mulsi3" [(set (match_operand:SI 0 "register_operand" "= Sg,Sg, Sg, v") (mult:SI (match_operand:SI 1 "gcn_alu_operand" "%SgA, 0,SgA, v") - (match_operand:SI 2 "gcn_alu_operand" " SgA, J, B,vASv")))] + (match_operand:SI 2 "gcn_alu_operand" " SgA, J, B,vASv"))) + (clobber (match_scratch:BI 3 "=X,cs, X, X"))] "" "@ s_mul_i32\t%0, %1, %2 |