On Sat, May 30, 2015 at 08:02:20AM -0500, Segher Boessenkool wrote:
> On Sat, May 30, 2015 at 10:47:27AM +0930, Alan Modra wrote:
> > Huh, that does look like you've destroyed my claim about SImode AND.
> 
> Carefully worded :-)

Yes, I wrote it meaning as in refuted an argument, but it also fits
the culprit who broke the AND patterns.  :-)

Unifying andsi_mask with anddi_mask, and the fact that constraints for
const_int see VOIDmode rather than the operand mode is why we get
rldicr rather than rlwinm.  Easily fixed by separating the si/di
patterns, and with a little more work I may even be able to keep them
together.

There are some other problems too.

In and<mode>3 expander I think you want the following since
and64_2_operand covers the extra double-rotate cases, not all DImode.

-  if ((<MODE>mode == DImode && !and64_2_operand (operands[2], <MODE>mode))
-      || (<MODE>mode != DImode && !and_operand (operands[2], <MODE>mode)))
+  if (!and_operand (operands[2], <MODE>mode)
+      && (<MODE>mode != DImode || !and64_2_operand (operands[2], <MODE>mode)))

In and<mode>3_imm_mask_dot and and<mode>3_imm_mask_dot2.  Typo?
-   && any_mask_operand (operands[2], <MODE>mode)"
+   && !any_mask_operand (operands[2], <MODE>mode)"

And that calls into question the !logical_const_operand in the insn
predicates for and<mode>3_mask_dot and and<mode>3_mask_dot2.  Certain
masks satisfy both any_mask_operand and logical_const_operand..  After
fixing the typo, neither the andi./andis. patterns nor the
rlwinm./rldic[rl]. patterns will be enabled for those masks.  Seems to
me we should omit !logical_const_operand from those insn predicates.

> I don't think it is a good idea to optimise code based on assumptions
> of what SImode SETs will do to the dest seen as DImode, without making
> those assumptions explicit in the RTL.

I agree.  Do you intend to get rid of WORD_REGISTER_OPERATIONS,
POINTERS_EXTEND_UNSIGNED, PUSH_ROUNDING, SHORT_IMMEDIATES_SIGN_EXTEND,
and LOAD_EXTEND_OP?  ;-)

-- 
Alan Modra
Australia Development Lab, IBM

Reply via email to