Message ID | 20240513081429.1749898-2-syq@gcc.gnu.org |
---|---|
State | New |
Headers | show |
Series | MIPS: Improve math | expand |
On 13/05/24 05:14, YunQiang Su wrote: > MIPSr6 has MADDF.s/MADDF.d instructions, which are fused. > > In MIPS ISA, double support can be subsetted. Only FMAF is enabled > for this case. > > * sysdeps/mips/fpu/math-use-builtins-fma.h > > Signed-off-by: YunQiang Su <syq@gcc.gnu.org> > --- > sysdeps/mips/fpu/math-use-builtins-fma.h | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > create mode 100644 sysdeps/mips/fpu/math-use-builtins-fma.h > > diff --git a/sysdeps/mips/fpu/math-use-builtins-fma.h b/sysdeps/mips/fpu/math-use-builtins-fma.h > new file mode 100644 > index 0000000000..6e296fd4c0 > --- /dev/null > +++ b/sysdeps/mips/fpu/math-use-builtins-fma.h > @@ -0,0 +1,13 @@ > +#if __mips_isa_rev >= 6 > +# if defined(__mips_single_float) Usually for a single case we write as '#ifdef __mips_single_float, also the identation is a single space. The rest look ok, gcc seems to emit the the MADDF.X even with pretty old versions (gcc 5.5.0). > +# define USE_FMA_BUILTIN 0 > +# else > +# define USE_FMA_BUILTIN 1 > +# endif > +# define USE_FMAF_BUILTIN 1 > +#else > +# define USE_FMA_BUILTIN 0 > +# define USE_FMAF_BUILTIN 0 > +#endif > +#define USE_FMAL_BUILTIN 0 > +#define USE_FMAF128_BUILTIN 0
Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> 于2024年5月22日周三 21:42写道: > > > > On 13/05/24 05:14, YunQiang Su wrote: > > MIPSr6 has MADDF.s/MADDF.d instructions, which are fused. > > > > In MIPS ISA, double support can be subsetted. Only FMAF is enabled > > for this case. > > > > * sysdeps/mips/fpu/math-use-builtins-fma.h > > > > Signed-off-by: YunQiang Su <syq@gcc.gnu.org> > > --- > > sysdeps/mips/fpu/math-use-builtins-fma.h | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > create mode 100644 sysdeps/mips/fpu/math-use-builtins-fma.h > > > > diff --git a/sysdeps/mips/fpu/math-use-builtins-fma.h b/sysdeps/mips/fpu/math-use-builtins-fma.h > > new file mode 100644 > > index 0000000000..6e296fd4c0 > > --- /dev/null > > +++ b/sysdeps/mips/fpu/math-use-builtins-fma.h > > @@ -0,0 +1,13 @@ > > +#if __mips_isa_rev >= 6 > > +# if defined(__mips_single_float) > > Usually for a single case we write as '#ifdef __mips_single_float, > also the identation is a single space. > In fact I sent V2, can you have a look at it? https://sourceware.org/pipermail/libc-alpha/2024-May/156668.html > The rest look ok, gcc seems to emit the the MADDF.X even with > pretty old versions (gcc 5.5.0). > > > +# define USE_FMA_BUILTIN 0 > > +# else > > +# define USE_FMA_BUILTIN 1 > > +# endif > > +# define USE_FMAF_BUILTIN 1 > > +#else > > +# define USE_FMA_BUILTIN 0 > > +# define USE_FMAF_BUILTIN 0 > > +#endif > > +#define USE_FMAL_BUILTIN 0 > > +#define USE_FMAF128_BUILTIN 0
@Adhemerval Zanella can you help to merge it if the V2 is OK?
diff --git a/sysdeps/mips/fpu/math-use-builtins-fma.h b/sysdeps/mips/fpu/math-use-builtins-fma.h new file mode 100644 index 0000000000..6e296fd4c0 --- /dev/null +++ b/sysdeps/mips/fpu/math-use-builtins-fma.h @@ -0,0 +1,13 @@ +#if __mips_isa_rev >= 6 +# if defined(__mips_single_float) +# define USE_FMA_BUILTIN 0 +# else +# define USE_FMA_BUILTIN 1 +# endif +# define USE_FMAF_BUILTIN 1 +#else +# define USE_FMA_BUILTIN 0 +# define USE_FMAF_BUILTIN 0 +#endif +#define USE_FMAL_BUILTIN 0 +#define USE_FMAF128_BUILTIN 0
MIPSr6 has MADDF.s/MADDF.d instructions, which are fused. In MIPS ISA, double support can be subsetted. Only FMAF is enabled for this case. * sysdeps/mips/fpu/math-use-builtins-fma.h Signed-off-by: YunQiang Su <syq@gcc.gnu.org> --- sysdeps/mips/fpu/math-use-builtins-fma.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sysdeps/mips/fpu/math-use-builtins-fma.h