This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Bad choices by expand_mult_highpart
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: roger at eyesopen dot com (Roger Sayle), ja2morri at csclub dot uwaterloo dot ca (James Morrison), gcc-patches at gcc dot gnu dot org
- Date: Mon, 22 Mar 2004 20:06:17 +0000
- Subject: Re: Bad choices by expand_mult_highpart
- References: <200403221935.UAA12225@faui1d.informatik.uni-erlangen.de>
Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:
> To fix this for expand_mult_highpart, we have two possible strategies:
> we could sign-/zero-extend both the first operand and the constant
> to wider_mode, and perform synth_mult as is in wider_mode, ignoring
> all bits outside of wider_mode in the result.
I thought that what the existing code was trying to do (at least
after you fixed the mode argument choose_mult_variant, sorry for
screwing that up):
if (choose_mult_variant (wider_mode, cnst1, &alg, &variant,
max_cost - extra_cost))
{
[...]
tem = convert_to_mode (wider_mode, op0, unsignedp);
tem = expand_mult_const (wider_mode, tem, cnst1, 0, &alg, variant);
tem = extract_high_half (mode, tem);
I'm assuming that CNST1, as passed to expand_mult_highpart, is required
to be a legitimate INTVAL for mode MODE. That means it'll be legitimate
for WIDER_MODE as well.
Richard