From 4888442fb425fc85437547d360ced84d6c65bad0 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 18 Nov 2024 22:32:55 +0100 Subject: [PATCH] * RiscV: more reliable use_fma --- compiler/riscv/nrvadd.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/riscv/nrvadd.pas b/compiler/riscv/nrvadd.pas index 6609c4dd24..b46fe58449 100644 --- a/compiler/riscv/nrvadd.pas +++ b/compiler/riscv/nrvadd.pas @@ -339,7 +339,10 @@ implementation function trvaddnode.use_fma: boolean; begin - Result:=current_settings.fputype in [fpu_fd]; + Result:=(is_single(left.resultdef) and is_single(right.resultdef) and + (CPURV_HAS_F in cpu_capabilities[current_settings.cputype])) or + (is_double(left.resultdef) and is_double(right.resultdef) and + (CPURV_HAS_D in cpu_capabilities[current_settings.cputype])); end;