[1/6] MIPSr6/math: Use builtin fma and fmaf
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
redhat-pt-bot/TryBot-still_applies |
warning
|
Patch no longer applies to master
|
Commit Message
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
Comments
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?
new file mode 100644
@@ -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