[COMMITTED] MIPSr6/math: Use builtin fma and fmaf

Message ID 20240624174605.17406-1-dilfridge@gentoo.org
State Committed
Commit 9e06e4a43b58519991acbed1d7f33abc40249226
Headers
Series [COMMITTED] MIPSr6/math: Use builtin fma and fmaf |

Commit Message

Andreas K. Hüttel June 24, 2024, 5:45 p.m. UTC
  From: YunQiang Su <syq@gcc.gnu.org>

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>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.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

Maciej W. Rozycki June 24, 2024, 10:55 p.m. UTC | #1
On Mon, 24 Jun 2024, Andreas K. Hüttel wrote:

> From: YunQiang Su <syq@gcc.gnu.org>
> 
> 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>
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

 It seems odd to me to commit an obsolete change reported to cause actual 
compilation errors as well as raising copyright notice concerns where 3 
subsequent revisions have been already posted that addressed these issues.

  Maciej
  
Andreas K. Hüttel June 24, 2024, 10:57 p.m. UTC | #2
Oops. I'm sorry, I must have picked the wrong version by accident. On it...

On June 25, 2024 12:55:41 AM GMT+02:00, "Maciej W. Rozycki" <macro@orcam.me.uk> wrote:
>On Mon, 24 Jun 2024, Andreas K. Hüttel wrote:
>
>> From: YunQiang Su <syq@gcc.gnu.org>
>> 
>> 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>
>> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> It seems odd to me to commit an obsolete change reported to cause actual 
>compilation errors as well as raising copyright notice concerns where 3 
>subsequent revisions have been already posted that addressed these issues.
>
>  Maciej
  

Patch

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..af8c1f95ff
--- /dev/null
+++ b/sysdeps/mips/fpu/math-use-builtins-fma.h
@@ -0,0 +1,13 @@ 
+#if __mips_isa_rev >= 6
+# ifdef __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