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: [PATCH] RFC for patch to add C99 fma/fmaf/fmal builtins


Michael Meissner <meissner@linux.vnet.ibm.com> writes:

> Index: gcc/doc/md.texi
> ===================================================================
> --- gcc/doc/md.texi	(.../svn+ssh://meissner@gcc.gnu.org/svn/gcc/trunk)	(revision 164954)
> +++ gcc/doc/md.texi	(working copy)
> @@ -3948,6 +3948,16 @@ means of constraints requiring operands 
>  @itemx @samp{and@var{m}3}, @samp{ior@var{m}3}, @samp{xor@var{m}3}
>  Similar, for other arithmetic operations.
>  
> +@cindex @code{fma@var{m}4} instruction pattern
> +@item @samp{fma@var{m}4}
> +Multiply operand 2 and operand 1, then add operand 3, storing the
> +result in operand 0.  All operands must have mode @var{m}.  This
> +pattern is used to implement the @code{fma}, @code{fmas}, and

s/fmas/fmaf/

> Index: gcc/c-family/c-cppbuiltin.c
> ===================================================================
> --- gcc/c-family/c-cppbuiltin.c	(.../svn+ssh://meissner@gcc.gnu.org/svn/gcc/trunk)	(revision 164954)
> +++ gcc/c-family/c-cppbuiltin.c	(working copy)
> @@ -260,6 +260,27 @@ builtin_define_float_constants (const ch
>       NaN has quiet NaNs.  */
>    sprintf (name, "__%s_HAS_QUIET_NAN__", name_prefix);
>    builtin_define_with_int_value (name, MODE_HAS_NANS (TYPE_MODE (type)));
> +
> +  /* Note, whether the port has builtin FMA support.  */
> +#ifdef HAVE_fmasf4
> +  if (HAVE_fmasf4 && FLOAT_TYPE_SIZE == 32)
> +    builtin_define_with_int_value ("__FP_FAST_FMAS", 1);

s/__FP_FAST_FMAS/__FP_FAST_FMAF/

> Index: gcc/config/rs6000/rs6000.md
> ===================================================================
> --- gcc/config/rs6000/rs6000.md	(.../svn+ssh://meissner@gcc.gnu.org/svn/gcc/trunk)	(revision 164954)
> +++ gcc/config/rs6000/rs6000.md	(working copy)
> @@ -5844,6 +5844,78 @@ (define_insn "fres"
>    "fres %0,%1"
>    [(set_attr "type" "fp")])
>  
> +; __builtin_fmas support

s/__builtin_fmas/__builtin_fmaf/

(Other occurences in changelog entry.)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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