aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-28 10:38:46 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-28 10:38:46 +0100
commite0a61cad47e6b10c9b28b1558a3595e381625910 (patch)
treeb7d2d81ddc00f1e0ce15cac85f6e44a8bd466bd3
parent4c4f4ea7696d30550b573d571407a4490571d1dd (diff)
downloadghdl-e0a61cad47e6b10c9b28b1558a3595e381625910.tar.gz
ghdl-e0a61cad47e6b10c9b28b1558a3595e381625910.tar.bz2
ghdl-e0a61cad47e6b10c9b28b1558a3595e381625910.zip
synth-oper: handle to_integer for signed.
-rw-r--r--src/synth/synth-oper.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index d99e0f836..e5d51f006 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -1510,6 +1510,15 @@ package body Synth.Oper is
return Create_Value_Net
(Synth_Uresize (Get_Net (L), Int_Type.W, Expr), Int_Type);
end;
+ when Iir_Predefined_Ieee_Numeric_Std_Toint_Sgn_Int =>
+ -- SIGNED to Integer.
+ declare
+ Int_Type : constant Type_Acc :=
+ Get_Value_Type (Subprg_Inst, Get_Type (Imp));
+ begin
+ return Create_Value_Net
+ (Synth_Sresize (L, Int_Type.W, Expr), Int_Type);
+ end;
when Iir_Predefined_Ieee_Numeric_Std_Resize_Uns_Nat =>
declare
W : Width;