This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bad choices by expand_mult_highpart


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]