[PATCH,TARGET]PR23726 Optimize divmod for AVR target
Denis Chertykov
chertykov@gmail.com
Fri Dec 11 11:08:00 GMT 2009
2009/12/11 Denis Chertykov <chertykov@gmail.com>:
> 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.
Oops. I was too fast.
I can't understand why this `pseudo_register_operand' exists.
Can you explain ?
Denis.
More information about the Gcc-patches
mailing list