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]

Re: rs6000 patch for logical operation cleanup.


	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
masking.

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

Thanks, David


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