This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH,rs6000] permit the first operand of isel to be 0
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Nathan Froyd <froydnj at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jul 2010 18:37:10 -0400
- Subject: Re: [PATCH,rs6000] permit the first operand of isel to be 0
- References: <20100715204741.GU12333@codesourcery.com>
On Thu, Jul 15, 2010 at 4:47 PM, Nathan Froyd <email@example.com> wrote:
> Like several other PowerPC insns, isel treats RA == 0 specially; the
> value zero is used, instead of the contents of r0. ?GCC doesn't take
> advantage of this, preferring instead to constrain both operands to be
> in registers 1-31. ?This leads to unnecessary code pessimizations.
> The patch below changes this by changing the constraints on the isel
> patterns in two ways:
> - Only comparisons that the actual isel insn can handle are permitted;
> - Once we don't have to worry about swapping operands in output_isel, we
> ?can have proper constraints for both of isel's alternatives.
> In addition, the patch centralizes the bulk of the above logic in
> rs6000_emit_int_cmove, rather than duplicating it in rs6000_emit_sISEL
> and rs6000_emit_int_cmove. ?rs6000_emit_int_cmove now needs to handle
> swapping arguments for combined conditions.
> Tested with cross to powerpc-eabispe (ongoing, but looking good so far).
> OK to commit?
> ? ? ? ?* config/rs6000/rs6000.c (rs6000_emit_sISEL): Let rs6000_emit_int_cmove
> ? ? ? ?do all the work.
> ? ? ? ?(rs6000_emit_int_cmove): Use function pointers for insn generation.
> ? ? ? ?Don't force values into registers unnecessarily. ?Swap operands if
> ? ? ? ?the condition requires it.
> ? ? ? ?(output_isel): Assert that we're not given conditions we can't handle.
> ? ? ? ?Delete corresponding code.
> ? ? ? ?* config/rs6000/rs6000.md (isel_signed_<mode>): Use
> ? ? ? ?scc_comparison_operator constraint. ?Permit 0 for the consequent
> ? ? ? ?operand. ?Permit any GPR for the alternative operand.
> ? ? ? ?(isel_unsigned_<mode>): Likewise.