aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-03 21:14:24 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-03 21:15:09 +0100
commitd9cb3f5313b4dd6a39fab9dc72fa2cf336dd6b08 (patch)
treeeaaccad21a59e4822a12d3df65b443e6385fe310
parentd9399f72340009974a8bf6d8ea4db86f2067eed5 (diff)
downloadghdl-d9cb3f5313b4dd6a39fab9dc72fa2cf336dd6b08.tar.gz
ghdl-d9cb3f5313b4dd6a39fab9dc72fa2cf336dd6b08.tar.bz2
ghdl-d9cb3f5313b4dd6a39fab9dc72fa2cf336dd6b08.zip
synth-oper: use build2_uresize
-rw-r--r--src/synth/synth-oper.adb18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index d2d4e5cb9..6634a2b2b 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -45,23 +45,9 @@ package body Synth.Oper is
procedure Set_Location (N : Net; Loc : Node)
renames Synth.Source.Set_Location;
- function Synth_Uresize (N : Net; W : Width; Loc : Node) return Net
- is
- Wn : constant Width := Get_Width (N);
- Res : Net;
+ function Synth_Uresize (N : Net; W : Width; Loc : Node) return Net is
begin
- if Wn = W then
- return N;
- else
- if Wn > W then
- Res := Build_Trunc (Build_Context, Id_Utrunc, N, W);
- else
- pragma Assert (Wn < W);
- Res := Build_Extend (Build_Context, Id_Uextend, N, W);
- end if;
- Set_Location (Res, Loc);
- return Res;
- end if;
+ return Build2_Uresize (Build_Context, N, W, Get_Location (Loc));
end Synth_Uresize;
function Synth_Sresize (N : Net; W : Width; Loc : Node) return Net