aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-static_oper.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-02-27 17:15:35 +0100
committerTristan Gingold <tgingold@free.fr>2021-02-27 17:15:35 +0100
commite01d0227af0092db12a6e08f3b8278d860b37416 (patch)
tree7ed3bf7bd9b4eb171df585a69b143a47800b2037 /src/synth/synth-static_oper.adb
parent8e23efc43c07a714b4f429be836c86eddf167b4e (diff)
downloadghdl-e01d0227af0092db12a6e08f3b8278d860b37416.tar.gz
ghdl-e01d0227af0092db12a6e08f3b8278d860b37416.tar.bz2
ghdl-e01d0227af0092db12a6e08f3b8278d860b37416.zip
synth: handle pow and arctan from ieee.math_real. Fix #1665
Diffstat (limited to 'src/synth/synth-static_oper.adb')
-rw-r--r--src/synth/synth-static_oper.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb
index c0faa0d78..bd53f73b9 100644
--- a/src/synth/synth-static_oper.adb
+++ b/src/synth/synth-static_oper.adb
@@ -610,6 +610,15 @@ package body Synth.Static_Oper is
end if;
end;
+ when Iir_Predefined_Ieee_Math_Real_Pow =>
+ declare
+ function Pow (L, R : Fp64) return Fp64;
+ pragma Import (C, Pow);
+ begin
+ return Create_Memory_Fp64
+ (Pow (Read_Fp64 (Left), Read_Fp64 (Right)), Res_Typ);
+ end;
+
when others =>
Error_Msg_Synth
(+Expr, "synth_static_dyadic_predefined: unhandled "
@@ -1012,6 +1021,13 @@ package body Synth.Static_Oper is
begin
return Create_Memory_Fp64 (Cos (Read_Fp64 (Param1)), Res_Typ);
end;
+ when Iir_Predefined_Ieee_Math_Real_Arctan =>
+ declare
+ function Atan (Arg : Fp64) return Fp64;
+ pragma Import (C, Atan);
+ begin
+ return Create_Memory_Fp64 (Atan (Read_Fp64 (Param1)), Res_Typ);
+ end;
when others =>
Error_Msg_Synth
(+Expr, "unhandled (static) function: "