On Thu, Nov 15, 2007 at 04:20:49PM -0800, Li Wang wrote: > I may need explain this problem more clearly.
Yes, my earlier message directing you to gcc-help was because I thought you didn't grasp what the compiler should do and what the linker should do; sorry about that. > For a backend which runs as > coprocessor to a host processor, such as GPU, which incoporates large > numbers of ALUS and processes only arithmetic operations and some other > simple operations, runs in VLIW pattern to accelerate the host > processor. Say, this coprocessor is referred as 'raw processor', note, I > don't mention GPU, GPU is similar in mechnism but more complex than > this. It owns simple ISA, and has no dedicated ESP, EBP to support > function call. But those registers aren't dedicated to support function calls on the x86 except by convention. If your coprocessor has no ABI to describe a stack and a function interface, you need to invent one, so that you can do function calls. gcc can inline the calls where it makes sense, and the scores can be adjusted so that a lot of inlining happens if your stack is inefficient. > If I want to let GCC produce assembly for it, how should > I code the machine description file? Should I first let cc1 produce a > elf assembly for it, and then let binutils trunate it to a flat > assembly? It seems ugly hacking. Thanks. gcc produces assembler code. as turns it into object code. ld links to form an executable. That's the way that it works.