amdgcn: Add [us]mulsid3/muldi3 patterns
authorJulian Brown <julian@codesourcery.com>
Tue, 29 Jun 2021 10:57:31 +0000 (03:57 -0700)
committerJulian Brown <julian@codesourcery.com>
Tue, 29 Jun 2021 15:19:56 +0000 (08:19 -0700)
commit8f332122589f97b9c974b168ca5b0b186296f0e4
treef21af58f4219a55bd1d0b5c762f2d8831fd18990
parent53b1d1691857a1d3e28566d05bb434fa555c4e8a
amdgcn: Add [us]mulsid3/muldi3 patterns

This patch improves 64-bit multiplication for AMD GCN: patterns for
unsigned and signed 32x32->64 bit multiplication have been added, and
also 64x64->64 bit multiplication is now open-coded rather than calling
a library function (which may be a win for code size as well as speed:
the function calling sequence isn't particularly concise for GCN).

This version of the patch uses define_insn_and_split in order to keep
multiply operations together during RTL optimisations up to register
allocation: this appears to produce more compact code via inspection on
small test cases than the previous approach using an expander.

The DImode multiply implementation is lost from libgcc if we build it
for DImode/TImode rather than SImode/DImode, a change we make in a later
patch in this series.

2021-06-29  Julian Brown  <julian@codesourcery.com>

gcc/
* config/gcn/gcn.md (<su>mulsidi3, <su>mulsidi3_reg, <su>mulsidi3_imm,
muldi3): Add patterns.
gcc/config/gcn/gcn.md