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]

Ping: Fix of pattern altivec_vnmsubfp in altivec.md


On Sun, 25 Jul 2004 yossi markovich wrote:

>The following patch fixes a bug (that was exposed by test case vect-6.c of
>the vectorizer) in the altivec.md file regarding vnmsubfp (vector negative
>multiply subtract floating point); vnmsubfp vD, vA, vC ,vB means multiply
>the four floating point word elements of vA with the four floating point
>word elements of vC, subtract from the vA*vC product the four floating
>point word elements of vB, invert the sign and store the result into vD.
>the current pattern describes a multiply subtract without a negation, and
>thus instead of generating/recognize  (set (vD (neg(minus(mult(vA, vC) ,
>vB))))) ,
>we generate/recognize   (set(vD (minus(mult(vA, vC) , vB)))).

>bootstraped and tested on powerpc-apple-darwin7.0.0.

>ok for mainline?

>Yossi



>ChangeLog
>------------------
>2004-07-25 Yossi Markovich <yossim@il.ibm.com>
>      Mostafa Hagog <mustafa@il.ibm.com>

>      * altivec.md (altivec_vnmsubfp) : Fix wrong pattern.


>Index: altivec.md
>===================================================================
>RCS file: /Develop/gcc_cvs_sync/gcc-cvs/gcc/gcc/config/rs6000/altivec.md,v
>retrieving revision 1.20
>diff -c -p -r1.20 altivec.md
>*** altivec.md    11 May 2004 04:22:05 -0000    1.20
>--- altivec.md    25 Jul 2004 07:17:36 -0000
>***************
>*** 610,618 ****
>  ;; Fused multiply subtract
>  (define_insn "altivec_vnmsubfp"
>    [(set (match_operand:V4SF 0 "register_operand" "=v")
>!     (minus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
>                         (match_operand:V4SF 2 "register_operand" "v"))
>!               (match_operand:V4SF 3 "register_operand" "v")))]
>    "TARGET_ALTIVEC"
>    "vnmsubfp %0,%1,%2,%3"
>    [(set_attr "type" "vecfloat")])
>--- 610,618 ----
>  ;; Fused multiply subtract
>  (define_insn "altivec_vnmsubfp"
>    [(set (match_operand:V4SF 0 "register_operand" "=v")
>!     (neg:V4SF (minus:V4SF (mult:V4SF (match_operand:V4SF 1
>"register_operand" "v")
>                         (match_operand:V4SF 2 "register_operand" "v"))
>!               (match_operand:V4SF 3 "register_operand" "v"))))]
>    "TARGET_ALTIVEC"
>    "vnmsubfp %0,%1,%2,%3"
>    [(set_attr "type" "vecfloat")])

Ping !

Yossi


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