rs6000 patch for logical operation cleanup.

David Edelsohn
Fri May 19 10:49:00 GMT 2000

	I was not able to test the compiler with your patch until today
and my fears about your patch were confirmed.  Your cleanup and removal of
the logical_u_operand() and non_logical_u_cint_operand() predicates
re-introduced a bug that I had fixed when I added those predicates.
Masking with MODE does not fix the problem.

	The current predicates believes that any CONST_INT can be
synthesized through the instructions which use 16-byte immediate operands.
However, the PowerPC instructions do not sign-extend immediate values used
in logical operands (unlike arithmetic operands, e.g., addi, addis, li,
lis, etc.)  For DImode operands the GCC backend believes that it is
generating CONST_INT -1 [0xffffffffffffffff], but the actual value being
computed is 0x00000000ffffffff (which only can be represented by
CONST_DOUBLE on a 32-bit host).  This is why I added all of the tests for
CONST_INT greater than zero in unsigned variants of the predicates.

	The MODE masking you introduced in your cleanup only solves the
problem of a 64-bit host which I solved in a less elegant way.  The
incorrect range of CONST_INT immediate operands is unaffected by the

	How can we solve this once and for all so that it is not reverted

Thanks, David

More information about the Gcc-bugs mailing list