From f0a1eb465baa759e2aa65464c9c2b28ca57e6367 Mon Sep 17 00:00:00 2001 From: Pat Bernardi Date: Wed, 31 Jul 2024 12:05:19 -0400 Subject: [PATCH] Only use FMA instructions on RISC-V if FPU supports double precision FP System.Double_Real.Product can use FMA instructions, but only if the FPU supports both single and double precision floating-point. As RISC-V can have FPUs that only support single precision, only include the FMA version if the target support double precision. Issue: eng/toolchain/bb-runtimes#50 --- support/rts_sources/profiles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/rts_sources/profiles.py b/support/rts_sources/profiles.py index 9542f0b0..0282d798 100644 --- a/support/rts_sources/profiles.py +++ b/support/rts_sources/profiles.py @@ -141,10 +141,10 @@ def light_scenarios(self, profile="light"): ret["Has_FMA"] = "no" elif cpu in ("riscv32", "r7"): ret["CPU_Family"] = "riscv32" - ret["Has_FMA"] = "yes" if self.config.has_fpu else "no" + ret["Has_FMA"] = "yes" if self.config.has_double_precision_fpu else "no" elif cpu in ("riscv64",): ret["CPU_Family"] = "riscv64" - ret["Has_FMA"] = "yes" if self.config.has_fpu else "no" + ret["Has_FMA"] = "yes" if self.config.has_double_precision_fpu else "no" else: print("Unexpected cpu %s" % cpu) sys.exit(2)