[M3commit] CVS Update: cm3

Jay K jay.krell at cornell.edu
Sat Mar 13 19:12:21 CET 2010


diff attached


 
> Date: Sat, 13 Mar 2010 19:11:14 +0000
> To: m3commit at elegosoft.com
> From: jkrell at elego.de
> Subject: [M3commit] CVS Update: cm3
> 
> CVSROOT: /usr/cvs
> Changes by: jkrell at birch. 10/03/13 19:11:14
> 
> Modified files:
> cm3/m3-sys/m3back/src/: Codex86.m3 M3x86.m3 Stackx86.m3 
> 
> Log message:
> improve all integer compares, some/all set compares
> not yet: float compares
> 
> old pattern:
> cmp
> setcc byte in memory
> xor reg,reg (any register, I believe)
> mov reg, memory
> 
> new patterns, depending on comparison/types:
> xor reg, reg (register restricted to RegistersForByteOperations = {EAX, EBX, ECX, EDX}
> cmp
> setcc reg
> 
> or
> cmp possibly with operands reversed
> sbb reg, reg
> neg reg
> 
> or
> cmp possibly with operands reversed
> sbb reg, reg
> inc reg
> 
> There is a little extra pressure on eax,ebx,ecx,edx, but
> we save an instruction and we avoid use of an in-memory temporary.
> The instruction could have been saved by using movzx as the manuals
> recommend anyway, instead of xor+mov.
> 
> The sequences are used are based on optimized C.
> 
> Basic problem here is setcc which only sets a byte
> but we generally want 32bit values.
> 
> Possibly more to do here.
> 
> The main difficulty developing this change was
> that I didn't initially restrict to RegistersForByteOperations.
> Small test cases worked ok but cases with more register pressure did not.
> see test p232 for a test that currently exercises some of this.
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20100313/1deea162/attachment-0002.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1.txt
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20100313/1deea162/attachment-0002.txt>


More information about the M3commit mailing list