[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Sat Aug 21 23:58:50 CEST 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/08/21 23:58:50

Added files:
	cm3/m3-sys/m3back/src/: M3C.m3 

Log message:
	Start really thinking about a C backend.
	It will offer:
	much better portability
	no more merging gcc, or trying to figure out
	what is wrong with the gcc trees we make
	
	no more dealing with platforms that maintain
	their own gcc forks, e.g. OpenBSD, e.g. Apple
	
	better codegen probably:
	less problem with optimizations
	
	better codegen definitely with caveats:
	on Digital (Tru64, VMS) an NT platforms,
	we can use the C exception handling mechanism
	on all platforms we can use C++ exception handling
	i.e. "portable C" still limits to setjmp/longjmp
	but portable C++ is better and some platforms
	provide better C
	
	better codegen:
	features like "graphite" and "lto" become accessible
	if the host gcc has them, without us forking more code
	
	better debugging with stock gdb
	less need for forking gdb
	
	probably slower compilation
	
	a portable distribution format -- just C source
	(still to work through small number of platform dependencies
	in the front end, e.g. word size, endian, size of
	of closure marker (could just be 4 bytes probably on all
	platforms, except Ia64 maybe, need to try disassembling 4
	bytes 0xFF 0xFF 0xFF 0xFF or really underand the encoding
	to see if it can be ruled out)
	
	a dramatic reduction in porting work
	(still to push out more platform dependencies e.g. Uin.i3)
	
	possibly better codegen, in that the changes I made to Uerrno.i3
	could probably be restated somehow, to actually use the
	#defines, referenced from generated C; this is even more futurisic
	and hypothetical though, as it'd require an alternative
	to <* extern *>.
	
	Anyway, not much here, just forked M3x86.m3 and made some
	systematic changes, thinking it through just a little.
	
	The compile-time stack should now probably just contain strings
	for example. The constant folding can go away.
	The pushes/pops should still operate on it.
	But actual codegen will be "print".




More information about the M3commit mailing list