Friday July 14, 2006 One the useful features of gcc is inline assembler. There is an old-style inline asm and new one that accepts C expressions as operands. GCC doesn't contain an assembler, so it cannot look inside of the assembler instruction and parse it. The users have to specify clobbered registers and tell the compiler about input/output operands. The syntax analysis is done by the assembler that came with operating system, so it's tough to associate the error reported by the assembler with source code.
gcc4ss went a step further. Sun codegen has an assembler functionality and not just an assembler, but an optimizing assembler. Simple assembler templates are processed early and codegen can optimize them. The templates with control flow or volatile marking are considered complex and codegen inlines them as-is.
During gcc4ss development inline asm implementation turned out to be very efficent, fast and reliable, so most of the other gnu language extensions we implemented using inline asm in the front-end/IR generator.
Posted by alexey ( Jul 14 2006, 04:47:54 PM PDT ) PermalinkThis site is a personal blog and is to be used for informational purposes only. The views expressed on this blog are those of the author only, and should not be attributed to any past or present employers.