Constraint modifier for partially overlaping operands
Andrew Hutchinson
andrewhutchinson@cox.net
Sat Oct 17 17:35:00 GMT 2009
The situation comes up where no or a partial overlap of registers
permits optimal code - since this can avoid using scratch register
Thus no overlap OR partial overlap is preferred (or required)
Using nothing leaves overlap without preference - full, partial,none
Using = gives the least preffered case - full
Using & gives only the no-overlapping case - none
Ideally "NOT"= is required - which I would hope the register allocator
would quite like too.
Dave Korn wrote:
> Ian Lance Taylor wrote:
>
>> Andrew Hutchinson <andrewhutchinson@> writes:
>>
>>
>>> I can use "=" modifier to make operands use same register and early
>>> clobber "&" to avoid overlaps.
>>>
>>> Is it possible to have or construct a contraint that permits partial
>>> overlap operands. (which neither = or & would allow)
>>> The case would be wide types taking multiple hard registers.
>>>
>>> eg Input r20..23 Output r22..25
>>>
>> There is no such constraint today. I suppose it would be possible to
>> define such a constraint if it seemed useful.
>>
>
> Maybe I'm misunderstanding, but I thought that was already the default if
> you use neither "=" to specify full overlap nor "&" for no overlap?
>
> Frex, a lot of ABIs specify that DImode values stored in pairs of SImode
> registers must always use an odd-even register pair (using a test in
> HARD_REGNO_MODE_OK), but when I was working on a custom port that allowed them
> in any register pair, GCC would happily generate partially overlapping movdi
> instructions such as (set:DI (reg:DI 5) (reg:DI 6)) (i.e., move r6/7 -> r5/6).
> This hasn't changed since 3.3, has it?
>
> cheers,
> DaveK
>
>
More information about the Gcc-help
mailing list