Chung-Ju Wu <jasonw...@gmail.com> writes:
> +  /* If operands[1] is a large constant and cannot be performed
> +     move behavior with single instruction, we need to split it.  */

Suggest "...cannot by performed by a single instruction..."

> +      high20_rtx = GEN_INT ((INTVAL (operands[1]) >> 12) << 12);

Better to use gen_int_mode (..., SImode).  Although GEN_INT will be OK
if the compiler uses an arithmetic shift for >>, that isn't guaranteed
(although I doubt any modern compiler would use anything else).

> +      low12_rtx = GEN_INT (INTVAL (operands[1]) & 0xfff);
> +
> +      emit_move_insn (tmp_rtx, high20_rtx);
> +      emit_move_insn (operands[0], plus_constant (SImode,
> +                                               tmp_rtx,
> +                                               INTVAL (low12_rtx)));

There's no need to create an rtx and then use INTVAL on it.
low12 can just be a HOST_WIDE_INT.

Looks good to me with those changes, thanks.

Richard

Reply via email to