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: [PATCH,rs6000] permit the first operand of isel to be 0


On Thu, Jul 15, 2010 at 4:47 PM, Nathan Froyd <froydnj@codesourcery.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?
>
> -Nathan
>
> ? ? ? ?* 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.

Okay.

Thanks, David


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