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]
Other format: [Raw text]

[PATCH] Kill sparc shift special cases


The other week, when the shift vs. add costing code went in,
Richard mentioned that simplifications would now be possible
in several backends.

Sparc had such a case, emitting adds for shift left of 1, in
order to ease scheduling on ultrasparc.

This gets rid of that code, as it's no longer necessary.

Applied to mainline.

2004-07-12  David S. Miller  <davem@nuts.davemloft.net>

	* config/sparc/sparc.md (ashlsi3): Eliminate const 1
	special case.
	(ashldi3_sp64): Likewise.

Index: config/sparc/sparc.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.md,v
retrieving revision 1.210
diff -c -p -r1.210 sparc.md
*** config/sparc/sparc.md	9 Jul 2004 09:35:48 -0000	1.210
--- config/sparc/sparc.md	12 Jul 2004 23:01:31 -0000
***************
*** 6951,6958 ****
  		   (match_operand:SI 2 "arith_operand" "rI")))]
    ""
  {
-   if (operands[2] == const1_rtx)
-     return "add\t%1, %1, %0";
    if (GET_CODE (operands[2]) == CONST_INT)
      operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
    return "sll\t%1, %2, %0";
--- 6951,6956 ----
***************
*** 6982,6989 ****
  		   (match_operand:SI 2 "arith_operand" "rI")))]
    "TARGET_ARCH64"
  {
-   if (operands[2] == const1_rtx)
-     return "add\t%1, %1, %0";
    if (GET_CODE (operands[2]) == CONST_INT)
      operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f);
    return "sllx\t%1, %2, %0";
--- 6980,6985 ----


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