diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-17 02:16:28 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-17 02:16:28 +0200 |
commit | b3a28203e95f68bd1007c4c11b44187ecabbf593 (patch) | |
tree | 114e02aa47dae4a5776692b81daeed24d25df97d /src/synth/synth-oper.adb | |
parent | 2ab83662516b7466e1870548cb8906e0842bb3ca (diff) | |
download | ghdl-b3a28203e95f68bd1007c4c11b44187ecabbf593.tar.gz ghdl-b3a28203e95f68bd1007c4c11b44187ecabbf593.tar.bz2 ghdl-b3a28203e95f68bd1007c4c11b44187ecabbf593.zip |
synth: fold addition on constant nets.
Diffstat (limited to 'src/synth/synth-oper.adb')
-rw-r--r-- | src/synth/synth-oper.adb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb index ac11d0606..2327d32d9 100644 --- a/src/synth/synth-oper.adb +++ b/src/synth/synth-oper.adb @@ -585,9 +585,9 @@ package body Synth.Oper is (N, Create_Vector_Type (Bnd, Left.Typ.Vec_El)); end; when Iir_Predefined_Integer_Plus => - if Is_Const (Left) and then Is_Const (Right) then + if Is_Const_Val (Left) and then Is_Const_Val (Right) then return Create_Value_Discrete - (Left.Scal + Right.Scal, + (Get_Const_Discrete (Left) + Get_Const_Discrete (Right), Get_Value_Type (Syn_Inst, Get_Type (Expr))); else return Synth_Int_Dyadic (Id_Add); @@ -995,7 +995,7 @@ package body Synth.Oper is function Log2 (Arg : Fp64) return Fp64; pragma Import (C, Log2); begin - if not Is_Float (V) then + if V.Typ.Kind /= Type_Float then Error_Msg_Synth (+Expr, "argument must be a float value"); return null; @@ -1010,7 +1010,7 @@ package body Synth.Oper is function Ceil (Arg : Fp64) return Fp64; pragma Import (C, Ceil); begin - if not Is_Float (V) then + if V.Typ.Kind /= Type_Float then Error_Msg_Synth (+Expr, "argument must be a float value"); return null; |