[llvm-commits] [llvm] r48356 - /llvm/trunk/lib/Target/X86/README.txt

Chris Lattner clattner at apple.com
Sun Mar 16 19:24:00 PDT 2008

On Mar 15, 2008, at 2:01 PM, Christopher Lamb wrote:

> Here's a proposed solution. It seems to work OK for me. It'll be  
> even better when the undef and insert_subreg coalescing support gets  
> done.

Thanks for tackling this!  Could this be done as a target independent  
dag combine by selecting to "sext_in_reg(shrl)" when sext_in_reg is  
available (or before legalize)?  This avoids the apparent size changes  
of the register.  On PPC, for example, this would codegen to:

	srwi r2, r3, 16
	extsb r3, r2

instead of:

	slwi r2, r3, 8
	srawi r3, r2, 24

On X86, this is a win because sextinreg (aka movsbl and friends) are 3- 
address, but sar is 2-address, giving:

	shrl	$16, %edi
	movsbl	%dil, %eax

instead of:

	shll	$8, %edi
	movl	%edi, %eax
	sarl	$24, %eax

What do you think?


More information about the llvm-commits mailing list