]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2013-10-22 Steve Ellcey <sellcey@mips.com>
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Oct 2013 18:24:43 +0000 (18:24 +0000)
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Oct 2013 18:24:43 +0000 (18:24 +0000)
* config/mips/mips.c (mips_rtx_costs):  Fix cost estimate for nor
(AND (NOT OP1) (NOT OP2)).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203932 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mips/mips.c

index c1d3ba81e39b4d66ccb9975dfb0928913f1bead7..71fdd7d4b10ad277761adf9ea2bd34c840b02965 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-22  Steve Ellcey  <sellcey@mips.com>
+
+       * config/mips/mips.c (mips_rtx_costs):  Fix cost estimate for nor
+       (AND (NOT OP1) (NOT OP2)).
+
 2013-10-22  Bill Schmidt  <wschmidt@vnet.ibm.com>
 
        * config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Reverse
index 5993aabe5781e1f6a010b4b0006d11dda3cda368..60e5e788f902fef2d9aa1e3e762d1f34441a3963 100644 (file)
@@ -3796,6 +3796,18 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
              return true;
            }
        }
+      /* (AND (NOT op0) (NOT op1) is a nor operation that can be done in
+        a single instruction.  */
+      if (!TARGET_MIPS16
+         && GET_CODE (XEXP (x, 0)) == NOT
+         && GET_CODE (XEXP (x, 1)) == NOT)
+       {
+         cost = GET_MODE_SIZE (mode) > UNITS_PER_WORD ? 2 : 1;
+          *total = (COSTS_N_INSNS (cost)
+                   + set_src_cost (XEXP (XEXP (x, 0), 0), speed)
+                   + set_src_cost (XEXP (XEXP (x, 1), 0), speed));
+         return true;
+       }
            
       /* Fall through.  */