From: Jeff Law Date: Sun, 3 Jan 1993 19:02:27 +0000 (-0700) Subject: pa.md (fmpyadd peepholes): New peepholes to issue independent floating point multiply... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c871711c3e85fc89e67b24e39199f1ac0f18b02;p=gcc.git pa.md (fmpyadd peepholes): New peepholes to issue independent floating point multiply and add instructions... * pa.md (fmpyadd peepholes): New peepholes to issue independent floating point multiply and add instructions at the same time. (fmpysub peepholes): Likewise for multiply and subtract instructions. From-SVN: r3069 --- diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 1743b3db1f4..af805d5cd33 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -2532,6 +2532,79 @@ (const_int 5)))))]) +;; The next four peepholes take advantage of the new 5 operand +;; fmpy{add,sub} instructions available on 1.1 CPUS. Basically +;; fmpyadd performs a multiply and add/sub of independent operands +;; at the same time. Because the operands must be independent +;; combine will not try to combine such insns... Thus we have +;; to use a peephole. +(define_peephole + [(set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx"))) + (set (match_operand 3 "register_operand" "+fx") + (plus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx")))] + "TARGET_SNAKE && fmpyaddoperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpyadd,dbl %1,%2,%0,%4,%3\"; + else + return \"fmpyadd,sgl %1,%2,%0,%4,%3\"; +}") + + +(define_peephole + [(set (match_operand 3 "register_operand" "+fx") + (plus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx"))) + (set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx")))] + "TARGET_SNAKE && fmpyaddoperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpyadd,dbl %1,%2,%0,%4,%3\"; + else + return \"fmpyadd,sgl %1,%2,%0,%4,%3\"; +}") + +;; Note fsub subtracts the second operand from the first while fmpysub +;; does the opposite for the subtraction operands! +(define_peephole + [(set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx"))) + (set (match_operand 3 "register_operand" "+fx") + (minus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx")))] + "TARGET_SNAKE && fmpysuboperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpysub,dbl %1,%2,%0,%5,%3\"; + else + return \"fmpysub,sgl %1,%2,%0,%5,%3\"; +}") + +(define_peephole + [(set (match_operand 3 "register_operand" "+fx") + (minus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx"))) + (set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx")))] + "TARGET_SNAKE && fmpysuboperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpysub,dbl %1,%2,%0,%5,%3\"; + else + return \"fmpysub,sgl %1,%2,%0,%5,%3\"; +}") + ;;- Local variables: ;;- mode:emacs-lisp