[mmix] convert to constraints.md
diff mbox

Message ID alpine.BSF.2.00.1209120558230.28531@dair.pair.com
State New
Headers show

Commit Message

Hans-Peter Nilsson Sept. 12, 2012, 10:31 a.m. UTC
On Wed, 12 Sep 2012, Nathan Froyd wrote:
> ----- Original Message -----
> > Nathan, again thanks.  There are a few minor tweaks compared to your
> > version:
> Thanks for fixing this up!
> > - Keeping old layout of "mmix_reg_or_8bit_operand".  That looked like
> >   a spurious change and I prefer the ior construct to the
> >   if_then_else.
> ISTR without this change, there were lots of assembly changes like:
>     set rx, 6
>     cmp rz, ry, rx
> instead of the previous and better:
>     cmp rz, ry, 6
> (apologies if the assembly syntax isn't correct; hopefully the intent is clear)

Yes.  My only guess is a typo in your previous edit, as the two
constructs certainly should be equivalent in *what's* being
recognized.  If they aren't, we have a bug in the gen*
machinery.  If "my" construct is wrong, then that's a separate
bug-fix, ehm.  Seems worth it to double-check, not just for
the sake of MMIX.

> but if you double-checked that the assembly didn't change
> after your changes, maybe something else that you tweaked fixed this.

I have no clue; nothing in the patch below stands out - the
missing "I"-constraint that may explain this (modulo that "H"
wasn't recognizable either) was on an "or" operation, not a
compare.  But maybe one was close enough that it mattered.

What revision was your baseline?  My baseline was r190260 but
configure-patches as posted (required to build, affecting
crtstuff at most) and with:

I'll try with your original patch and see it I can spot

> > - Replacing undefined-constraint-"H" with "I" instead of removing it.
> >   It was either renamed early or a genuine typo.  Good catch.
> Hard not to see it; the gen* machinery complains about undefined constraints. :)

Exactly! :)  You don't congratulate the machine, but the
machinist - and sometimes the inventor of the machine.
(Thank you, Zack!)

brgds, H-P

diff mbox

Index: gcc/config/mmix/predicates.md
--- gcc/config/mmix/predicates.md	(revision 190682)
+++ gcc/config/mmix/predicates.md	(working copy)
@@ -118,7 +118,7 @@  (define_predicate "mmix_symbolic_or_addr
 	return 1;
       /* Fall through.  */
-      return address_operand (op, mode);
+      return mmix_extra_constraint (op, 'U', reload_in_progress || reload_completed);

Index: gcc/config/mmix/mmix.md
--- gcc/config/mmix/mmix.md	(revision 190682)
+++ gcc/config/mmix/mmix.md	(working copy)
@@ -274,7 +275,7 @@  (define_insn "anddi3"
 (define_insn "iordi3"
   [(set (match_operand:DI 0 "register_operand" "=r,r")
 	(ior:DI (match_operand:DI 1 "register_operand" "%r,0")
-		(match_operand:DI 2 "mmix_reg_or_constant_operand" "rH,LS")))]
+		(match_operand:DI 2 "mmix_reg_or_constant_operand" "rI,LS")))]
    OR %0,%1,%2