[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Thu Mar 4 13:57:24 CET 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/03/04 13:57:24

Modified files:
	cm3/m3-sys/m3cc/gcc/gcc/m3cg/: parse.c 

Log message:
	eliminate calls to set_member and set_singleton
	the unoptimized code for set_member is decent, though not nearly as good as m3back (m3back uses bts and bt)
	the code for set_singleton never seems particularly great but ok
	I tried a lot with array_ref, and bit_field ref, no luck
	the use of stabilize_reference (or build(save_expr)) does help
	
	In particular in set_singleton, I can't get the compiler to "or into memory",
	never as good even when optimized as optimized C.
	
	The C compiler's best:
	
	void set_singleton(unsigned* a, unsigned b)
	{
	a[b / 32] |= (1 << (b % 32));
	}
	
	pushl   %ebp
	movl    %esp, %ebp
	
	movl    12(%ebp), %ecx
	movl    8(%ebp), %eax
	movl    %ecx, %edx
	andl    $31, %ecx
	shrl    $5, %edx
	leal    (%eax,%edx,4), %edx  << not able to get this from cm3cg
	movl    $1, %eax
	sall    %cl, %eax
	orl     %eax, (%edx)         << not able to get this from cm3cg
	
	popl    %ebp
	ret
	
	I can never get it to use lea with both a scale and an address.
	
	I will try a bit more, but this version should do.
	In particular I was using bit_field_ref with size 1, setting it to 1,
	maybe a full word will work better.
	
	This variation also has an advantage over some in that
	it shouldn't break pickles.
	
	This might be considered a significant size deoptimization and better off before, calling a function.
	
	tested on LINUXLIBC6 (so far)




More information about the M3commit mailing list