]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add widening expansion of MULT_HIGHPART_EXPR for integral modes
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 8 May 2024 08:07:56 +0000 (10:07 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Fri, 17 May 2024 09:45:40 +0000 (11:45 +0200)
commitf53f8a859631bef97adba1522a8049a8fce57c1b
treecc7bd05030603a58ccf070d26afc73891706eb26
parentb420e0b920613c42f63252aa2478a8315dc37a13
Add widening expansion of MULT_HIGHPART_EXPR for integral modes

For integral modes the expansion of MULT_HIGHPART_EXPR requires the presence
of an {s,u}mul_highpart optab whereas, for vector modes, widening expansion
is supported.  This adds a widening expansion for integral modes too, which
is in fact already implemented in expmed_mult_highpart_optab.

gcc/
* expmed.h (expmed_mult_highpart_optab): Declare.
* expmed.cc (expmed_mult_highpart_optab): Remove static keyword.
Do not assume that OP1 is a constant integer.  Fix pasto.
(expmed_mult_highpart): Pass OP1 narrowed to MODE in all the calls
to expmed_mult_highpart_optab.
* optabs-query.cc (can_mult_highpart_p): Use 2 for integer widening
and shift subsequent values accordingly.
* optabs.cc (expand_mult_highpart): Call expmed_mult_highpart_optab
when can_mult_highpart_p returns 2 and adjust to above change.
gcc/expmed.cc
gcc/expmed.h
gcc/optabs-query.cc
gcc/optabs.cc