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]

midRTL - virtualization


Hi,
I've done basics of virtualization and I would like to outlilne my approach
here so you can object and bring more ideas.  The point of virutalization
is to allow multiple machine descriptions in the single compiler. I want
to use it for midRTL/real MD file, but in theory later we may want to use
it to allow multiple MDs to be compiled into single binarry, even when I
am not completely sure how fruitfull that trick can be.

I've done:
1) Most of gen* programs now accepts -p switch that specify prefix
   to avoid C namespace collision.  I want to keep insn-output/insn-emit/insn-recog
   separate file, but all of these reffers functions from each other, so I need
   to distinguish them.
   I now have insn-output/midinsn-output and same for recog, emit, opinit
   all do use mid_ prefix.

2) I've removed the prototype for gen_* functions from insn-flags.h and created
   insn-protos.h.  In longer term we will want to remove gen_* references from compiler.
   Since dozen of md files do use them,  I now include insn-protos from insn-flags,
   but use midinsn-protos only from midinsn-output that needs prototypes to 
   initialize tables.

   I don't want to update all the md files right now on the branch that may live
   for a while, but I will do that incrementally as cleanups to the mainline.

3) I've reworked the CODE_FOR to be variables.  I have codes.h that lits all
   known insn names I want CODE_FOR_*. I've created new insn-defcodes to define
   the variables and insn-initcodes to set the proper numbers to them.  When
   named pattern is missing or condition is false, it is initialized to CODE_FOR_nothing.
   (insn_code is now enum containing only CODE_FOR_nothing initialized to INT_MAX).
   This basically eliminate need for HAVE_* macros.

I can now bootstrap comiler that switch the MD files in the middle of compilation
so it basically works. I've hit problem on i386 that use dozen of CODE_FOR_*
valies for SSE builtins generation.  I don't think it is good idea and it will
not work for midRTL, so it may be nice if we defined the named pattern
for vectorized code generation - this is way to go anyway.

As this is independent issue, may I hope that someone else will care that
while I am concentrating on the midRTL? I hope to implement the current plans
to working prototype in about one week and then we need to address these issues.

I will now cleanup my changes and prepare patch I will commit to branch
sometime tomorrow or day later, as it is relativly huge beast.

Honza


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