]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add force_lowpart_subreg
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 18 Jun 2024 11:22:31 +0000 (12:22 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 18 Jun 2024 11:22:31 +0000 (12:22 +0100)
commit5f40d1c0cc6ce91ef28d326b8707b3f05e6f239c
tree106ff63d7ce4336bf8f41cb994f506af6b4d27d6
parentd4047da6a070175aae7121c739d1cad6b08ff4b2
Add force_lowpart_subreg

optabs had a local function called lowpart_subreg_maybe_copy
that is very similar to the lowpart version of force_subreg.
This patch adds a force_lowpart_subreg wrapper around
force_subreg and uses it in optabs.cc.

The only difference between the old and new functions is that
the old one asserted success while the new one doesn't.
It's common not to assert elsewhere when taking subregs;
normally a null result is enough.

Later patches will make more use of the new function.

gcc/
* explow.h (force_lowpart_subreg): Declare.
* explow.cc (force_lowpart_subreg): New function.
* optabs.cc (lowpart_subreg_maybe_copy): Delete.
(expand_absneg_bit): Use force_lowpart_subreg instead of
lowpart_subreg_maybe_copy.
(expand_copysign_bit): Likewise.
gcc/explow.cc
gcc/explow.h
gcc/optabs.cc