RFC: PATCH: Add -m8bit-idiv for x86

Paolo Bonzini bonzini@gnu.org
Wed Sep 15 18:31:00 GMT 2010


On 09/14/2010 09:13 AM, Uros Bizjak wrote:
> On Tue, Sep 14, 2010 at 7:05 AM, H.J. Lu<hjl.tools@gmail.com>  wrote:
>
>>>> This patch generates 2 idivbs since the optimization is done at RTL
>>>> expansion. Is there a way to delay this until later when 2 idivls are
>>>> optimized into 1 idivl and before IRA since this optimization needs
>>>> a scratch register.
>>>
>>> Splitter with&&  can_create_pseudo_p () split constraint will limit
>>> splits to pre-regalloc passes, or ...
>>
>> try_split doesn't allow any insn of the result matches the original pattern
>> to avoid infinite loop.
>
> So, switch the places of div and mod RTXes in the parallel and provide
> another divl_1 insn pattern that matches this new parallel.

I think adding an unspec to the parallel would be less hacky than 
reversing the div/mod.

Paolo



More information about the Gcc-patches mailing list