On Wed, 2012-11-14 at 11:15 -0800, Andrew Pinski wrote: > Do you have a testcase? As I added expand_cond_expr_using_cmove, I > think this is the correct fix. > > Thanks, > Andrew Pinski
Here is a cutdown test case that I have been compiling with -O3, if you compare with and without my patch you will see fewer 'andi' instructions with 0xffff are generated after my patch is applied. Steve Ellcey sell...@mips.com unsigned short foo(unsigned short a1, unsigned short a2) { unsigned short i, x; for (i = 0; i < 8; i++) { x = (a1 & 1) ^ (a2 & 1); a1 >>= 1; if (x == 1) a2 ^= 0x2006; a2 >>= 1; if (x == 1) a2 |= 0x8800; else a2 &= 0x77ff; } return a2; }