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,TARGET]PR23726 Optimize divmod for AVR target


2009/12/11 Andrew Hutchinson <andrewhutchinson@cox.net>:
> This AVR target patch was originally posted by Bjoern Haase in 2007 against
> 4.1 but never approved and the problem remains.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23726
>
> The patch allows optimizers to eliminate redundant call to divmod when both
> quotient and remainder are required. For example, the following will
> currently require 2 divmod operations.
>
> Â x = y%n;
> Â y = y/n;
>
> The patch changes AVR divmod expand patterns to define_insn_and_split
> simplifying use of hard register into parallel clobber.
>
> I have retested this patch on 4.5 head and it works just fine. There are no
> regressions on gcc testsuite for AVR.
>
> Ok for 4.5?
>
>
> 2009-12-10 ÂAndy Hutchinson Â<hutchinsonandy@gcc.gnu.org>
>
> Â PR target/23726
> Â * config/avr/predicates.md (pseudo_register_operand): Add new predicate
> for pseudos.
> Â * config/avr/avr.md (divmodqi4): Replace with define_insn_and_split to
> allow div/mod optimization.
> Â (udivmodqi4): Ditto.
> Â (divmodhi4): Ditto.
> Â (udivmodhi4): Ditto.
> Â (divmodsi4): Ditto.
> Â (udivmodsi4): Ditto.

Approved.

Denis.


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