This is the mail archive of the gcc@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]

RE: Porting GCC help/doubts


Hi Nitin,
Thanks for your quick reply. 
Any idea on how the Parse Tree is converted to the RTL form ? ..
Meaning, when I create a .md file how is the pattern matching done, I mean I have the patterns in the .md file to be compared against something else. This 'something else' is unknown to me. Any idea on what this 'something else' is and how it is derived from the Parse Tree.

Thanks for your reply.
Nithya R. Babu

> ------------Original Message------------
> From: "Nitin Gupta" <nitin.gupta@nevisnetworks.com>
> To: "Nithya Babu" <nithyababu@isofttech.com>
> Date: Mon, Dec-22-2003 3:37 PM
> Subject: RE: Porting GCC help/doubts
> 
> 
> 
> > -----Original Message-----
> > From: Nithya Babu [mailto:nithyababu@isofttech.com] 
> > Sent: Monday, December 22, 2003 12:37 PM
> > To: gcc@gcc.gnu.org
> > Subject: Porting GCC help/doubts
> > 
> > 
> > Hi,
> > Im currently studying the method of porting GCC to other 
> > targets for which I have been using the "Porting GCC' 
> > document available at the GNU site.
> > 
> > A few questions for which I need answers
> > a) I generate an RTL file output from the compiler, is the 
> > RTL file output target specific, I mean - will the output 
> > change according to various targets or will it remain the same ?
> > 
> The RTL file is very much target dependent. It is based on the basic
> patterns as defined in your md file. say for example if there is an add
> of two variables and both are in registers, then based on the mode
> (SI,HI,QI,SF,DF etc) you need to write the patterns in md file. This
> pattern for say SI mode will be something like 'addsi'. Similarly if
> your target has multiplication support, then add something like
> 'mulsi2'. otherwise a call to the multiplication routine is generated.
> 
> > b) If the answer to my previous question is no, then it means 
> > that RTL patterns are different for different targets. I hope 
> > not this is the case. But if it is, then how do we tell the 
> > compiler to use a specific combination of RTL instructions 
> > for a particular instruction. The .md file doesnt seem to 
> > make anything about this.....
> > 
> The compiler actually breaks the rtl pattern in a way that it can have
> code generated with the defined patterns in your md file. There is a
> list of basic patters that you need to support. To understand it better,
> imagine your target does not support memory to memory operation (RISC
> m/c). In that case if there is something like mem = mem_loc1 + mem_loc2,
> then the compile would actually split it into moving mem_loc1 to
> register, mem_loc2 to another register and a register-register add rtl.
> 
> > c) Any other reading material apart from the 'Using and 
> > Porting GNU GCC' ?
> > 
> well the best way is to look into already implemented md file for the
> processor known to you.
> 
> > Thanks,
> > Nithya R. Babu
> > 
> 

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