[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Wed Mar 10 16:49:26 CET 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/03/10 16:49:26

Modified files:
	cm3/m3-sys/m3back/src/: Stackx86.m3 

Log message:
	two small improvements
	
	1) If we were trying to put 64bit value in EDX:EAX
	such as we assume is for a return value, and either
	part of the value wasn't in place, we would do work
	for both parts. The result was typically throwing in "xchg edx,edx"
	which does nothing. Now we only work on whatever
	part isn't where it should be.
	This could be seen e.g. in Long__Plus.
	
	Caught by adding assert to # from in swapreg.
	
	2) If we are allocating a 64bit value and EAX
	is chosen for one of the registers, force it
	to be the low part. This saves an instruction
	in Long__Insert and easy to imagine elsewhere.
	There's really no downside. Unless maybe you
	are about to shift or rotate by a constant
	of 32 or more, or extract/insert with
	an offset of 32 or more
	(and even then, I think we can address that)
	
	If the high part is already in a register (i.e. EAX), then leave it there.
	I don't think this can happen since, like, we don't
	have a notion of "splitting" or "merging" allocation.
	
	e.g., ideally:
	
	stuff like:
	a := 0L or a := -1L would fit in one register
	
	or
	a := 0L;
	a := Long.Or(a, VAL(integer, LONGINT))
	
	would be an immediate plus one register, instead of two registers




More information about the M3commit mailing list