This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Optimize AND with 0xffffffff


Hello!

Attached patch fixes oversight with AND pattern and 0xffffffff
immediate. While ANDs with 0xff and 0xffff are converted to equivalent
zero_extend pattern, AND with 0xffffffff isn't. This problem leaves
important optimization that would substitute "movq    %rdi, %rax; andl
   $4294967295, %eax" sequence with "movl     %edi, %eax" ineffective.

This optimization happens ~100 times in cc1.

Moving to stage4 got me by a bit of surprise (I was away from the
keyboard for the weekend), so I will leave to RMs if this (otherwise
fairly safe patch) is OK for mainline.

2012-01-09  Uros Bizjak  <ubizjak@gmail.com>

	PR target/51681
	* config/i386/constraints.md ("L"): Return true for 0xffffffff.
	* config/i386/i386.c (*anddi_1): Emit AND with 0xffffffff as MOV.

So, OK for  mainline?

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]