From 707e6f42362fa30b5af6090cc68f8e94fe61925a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 11 Jan 2023 18:17:47 +0100 Subject: synth: handle universal r*i and i*r mul, physical mod. --- src/synth/synth-vhdl_eval.adb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/synth/synth-vhdl_eval.adb') diff --git a/src/synth/synth-vhdl_eval.adb b/src/synth/synth-vhdl_eval.adb index f9bb11089..126c8a735 100644 --- a/src/synth/synth-vhdl_eval.adb +++ b/src/synth/synth-vhdl_eval.adb @@ -1118,6 +1118,13 @@ package body Synth.Vhdl_Eval is Check_Integer_Overflow (Inst, Res, Res_Typ, Expr); return Create_Memory_Discrete (Res, Res_Typ); end; + when Iir_Predefined_Universal_I_R_Mul => + return Create_Memory_Fp64 + (Fp64 (Read_Discrete (Param1)) * Read_Fp64 (Param2), Res_Typ); + when Iir_Predefined_Universal_R_I_Mul => + return Create_Memory_Fp64 + (Read_Fp64 (Param1) * Fp64 (Read_Discrete (Param2)), Res_Typ); + when Iir_Predefined_Integer_Div | Iir_Predefined_Physical_Physical_Div | Iir_Predefined_Physical_Integer_Div => @@ -1134,7 +1141,8 @@ package body Synth.Vhdl_Eval is Check_Integer_Overflow (Inst, Res, Res_Typ, Expr); return Create_Memory_Discrete (Res, Res_Typ); end; - when Iir_Predefined_Integer_Mod => + when Iir_Predefined_Integer_Mod + | Iir_Predefined_Physical_Mod => declare Res : Int64; Div : Int64; -- cgit v1.2.3