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]

Re: x86 backend patch pings^2


On Sun, Jul 25, 2004 at 07:52:08AM -0600, Roger Sayle wrote:
> http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00066.html
> Peephole x86 multiplications by 3, 5 and 9

You can merge these all into two patterns.

(define_peephole2
  [(parallel
    [(set (match_operand:SI 0 "register_operand" "")
	  (mult:SI (match_operand:SI 1 "register_operand" "")
		   (match_operand:SI 2 "const_int_operand" "")))
     (clobber (reg:CC FLAGS_REG))])]
  "INTVAL (operands[2]) == 3
   || INTVAL (operands[2]) == 5
   || INTVAL (operands[2]) == 9"
  [(set (match_dup 0)
	(plus:SI (mult:SI (match_dup 1) (match_dup 2))
		 (match_dup 1)))]
  { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); })

Further, this is applicable to 64 and 32-bit.  Further, 64-bit
can do the same for DImode with "leaq" instead of "leal".


> http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00981.html
> Consider ffreep to pop the top-of-stack ater f[u]compip

Ok.


r~


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