diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-02-27 17:15:35 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-02-27 17:15:35 +0100 |
commit | e01d0227af0092db12a6e08f3b8278d860b37416 (patch) | |
tree | 7ed3bf7bd9b4eb171df585a69b143a47800b2037 /src/synth | |
parent | 8e23efc43c07a714b4f429be836c86eddf167b4e (diff) | |
download | ghdl-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')
-rw-r--r-- | src/synth/synth-static_oper.adb | 16 |
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: " |