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]

Using SCRATCH Register for a mov op,


Hi,

My proc got
12 bit Register
An address is 24 bits long (2 register)
HImode stands for 24 bit value
SImode stands for 48 bit value

When gcc create such expression :
(set (reg:Mode X) (mem:Mode(reg:Pmode X)))
Where X is the same for both arguments of SET.
I need a scratch to register to resolve properly this
expression in assembly (the adress can be lost by
setting the value in X).

I tryed to directly generates a clobber reg in
movMode expression for all kind of arguments because
they may turn in reg or (mem(reg )) during reload pass
and then after give up unused clobber with a
define_split.
But this leads to problem during the combine phase
(.cse) that create then unknow expression such as :
(parallel
(set (reg:Mode) (ashift:Mode (reg:Mode)(const_int)))
(clobber ("fixed reg")) Wich I don't want to catch in
define_insn template.

With SECONDARY_RELOAD_CLASS wich does not interest me
that much because I need only GENERAL REGS class for
all my regs it was worth 
In order to do this I created two register classes ,
one with only one Pmode reg C1 and the other with the
rest of my register C2. I thought that then if he
wants to reload the first one C1 he will create a
scratch in C2 and C2 will get a C1 scratch.
But it appears that when he wants to reload  C1 and
get C2 but just after will try C2 and get C1 ... ...
And here we go for an infinite loop.!!!!

I've set a define_peephole2 for creating a clobber
register with the set expression seen before and this
works just fine in all case ... except if u don't use
optimization!

So I don't see any means to get this #?! scratch for
moving from mem to reg with adress in the same
register  as the output... And I really really
need it!!

I really don't know what I can do then??
Thanks a lot for helping me
Regards 
Pierre

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


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