* register allocation in gcc
@ 2011-10-18 7:06 vikramsp
2011-10-18 8:35 ` Paulo J. Matos
0 siblings, 1 reply; 4+ messages in thread
From: vikramsp @ 2011-10-18 7:06 UTC (permalink / raw)
To: gcc-help
In my .md file there is an insn
(define_insn abssf2
....
....
(clobber (match_scratch 2 ""))
the %2 register is allocated as r0 in the real code.
My problem is that i want other than r0 to be allocated
for operand 2.
Please help how to do that.
--
View this message in context: http://old.nabble.com/register-allocation-in-gcc-tp32672662p32672662.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: register allocation in gcc
2011-10-18 7:06 register allocation in gcc vikramsp
@ 2011-10-18 8:35 ` Paulo J. Matos
2011-10-18 17:20 ` vikramsp
0 siblings, 1 reply; 4+ messages in thread
From: Paulo J. Matos @ 2011-10-18 8:35 UTC (permalink / raw)
To: gcc-help
On 18/10/11 08:06, vikramsp wrote:
>
> In my .md file there is an insn
> (define_insn abssf2
> ....
> ....
> (clobber (match_scratch 2 ""))
>
> the %2 register is allocated as r0 in the real code.
> My problem is that i want other than r0 to be allocated
> for operand 2.
> Please help how to do that.
In the "" after the 2 comes the constraint list. Constrain the register
to be somewhere that doesn't include r0.
So, for example, define a constraint x that corresponds to a register
class that doesn't contain r0 and then do:
(define_insn abssf2
....
....
(clobber (match_scratch 2 "x"))
--
PMatos
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: register allocation in gcc
2011-10-18 8:35 ` Paulo J. Matos
@ 2011-10-18 17:20 ` vikramsp
2011-10-20 13:47 ` Paulo J. Matos
0 siblings, 1 reply; 4+ messages in thread
From: vikramsp @ 2011-10-18 17:20 UTC (permalink / raw)
To: gcc-help
I understood what you suggested. But how to
define a register class (possibly in <MACHINE>.c file).
Paulo J. Matos-3 wrote:
>
> On 18/10/11 08:06, vikramsp wrote:
>>
>> In my .md file there is an insn
>> (define_insn abssf2
>> ....
>> ....
>> (clobber (match_scratch 2 ""))
>>
>> the %2 register is allocated as r0 in the real code.
>> My problem is that i want other than r0 to be allocated
>> for operand 2.
>> Please help how to do that.
>
> In the "" after the 2 comes the constraint list. Constrain the register
> to be somewhere that doesn't include r0.
>
> So, for example, define a constraint x that corresponds to a register
> class that doesn't contain r0 and then do:
> (define_insn abssf2
> ....
> ....
> (clobber (match_scratch 2 "x"))
>
> --
> PMatos
>
>
>
--
View this message in context: http://old.nabble.com/register-allocation-in-gcc-tp32672662p32676581.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: register allocation in gcc
2011-10-18 17:20 ` vikramsp
@ 2011-10-20 13:47 ` Paulo J. Matos
0 siblings, 0 replies; 4+ messages in thread
From: Paulo J. Matos @ 2011-10-20 13:47 UTC (permalink / raw)
To: gcc-help
On 18/10/11 18:19, vikramsp wrote:
>
> I understood what you suggested. But how to
> define a register class (possibly in<MACHINE>.c file).
>
<MACHINE>.h
http://gcc.gnu.org/onlinedocs/gccint/Register-Classes.html#Register-Classes
Also, look at how other backends do it.
--
PMatos
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-20 13:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18 7:06 register allocation in gcc vikramsp
2011-10-18 8:35 ` Paulo J. Matos
2011-10-18 17:20 ` vikramsp
2011-10-20 13:47 ` Paulo J. Matos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).