[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#161432: [Bug target/8603] [Alpha] s?addl pattern doesn't work




------- Comment #5 from ubizjak at gmail dot com  2009-01-07 17:56 -------
Following patch that changes addsi3 and subsi3 expander constraint fixes this
problem:

--cut here--
Index: alpha.md
===================================================================
--- alpha.md    (revision 143157)
+++ alpha.md    (working copy)
@@ -261,7 +261,7 @@
   [(set (match_operand:SI 0 "register_operand" "")
        (plus:SI (match_operand:SI 1 "reg_or_0_operand" "")
                 (match_operand:SI 2 "add_operand" "")))]
-  "! optimize"
+  ""
   "")

 (define_insn "*addsi_internal"
@@ -622,7 +622,7 @@
   [(set (match_operand:SI 0 "register_operand" "")
        (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
                  (match_operand:SI 2 "reg_or_8bit_operand" "")))]
-  "! optimize"
+  ""
   "")

 (define_insn "*subsi_internal"
--cut here--

With the patch (gcc -O2):

f:
        s4addl $16,$17,$0
        ret $31,($26),1

g:
        s4subl $16,$16,$0
        ret $31,($26),1

This regression was introduced by:

Sat Feb 23 08:42:47 2002  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

        * expr.c (store_expr): When converting expression to promoted
        equivalent type, allow using SUBREG_REG of TARGET as the target
        of the expansion of EXP.
        * loop.c (basic_induction_var, case SUBREG): Always look inside.
        * config/alpha/alpha.c (rtx_equiv_function_matters): Delete decl.
        (alpha_emit_set_const): Handle SImode when can't make new pseudos.
        (alpha_emit_set_const_1, alpha_sa_mask): Use no_new_pseudos.
        * config/alpha/alpha.md (addsi3, subsi3): Don't use if optimizing.

And the comment above addsi3 says:

;; Don't say we have addsi3 if optimizing.  This generates better code.  We
;; have the anonymous addsi3 pattern below in case combine wants to make it.

So, is this still true? Can somebody benchmark this patch? We can perhaps look
at csibe numbers.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.



Reply to: