aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-22 19:58:44 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-22 19:58:44 +0200
commitb67d934541336238f66556d8f861f972c288c131 (patch)
treed97fc18624eab0de499e92ae4f62453a08047496 /src
parentdfdcfa6a6db7e44fba39fc7b9758ff68cdb7f313 (diff)
downloadghdl-b67d934541336238f66556d8f861f972c288c131.tar.gz
ghdl-b67d934541336238f66556d8f861f972c288c131.tar.bz2
ghdl-b67d934541336238f66556d8f861f972c288c131.zip
synth: add more operations.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-oper.adb15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index eb7bc6cef..2b4da90e3 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -454,6 +454,9 @@ package body Synth.Oper is
when Iir_Predefined_Ieee_Numeric_Std_Sub_Uns_Uns =>
-- "-" (Unsigned, Unsigned)
return Synth_Dyadic_Uns (Id_Sub, True);
+ when Iir_Predefined_Ieee_Numeric_Std_Sub_Sgn_Sgn =>
+ -- "-" (Signed, Signed)
+ return Synth_Dyadic_Sgn (Id_Sub, True);
when Iir_Predefined_Ieee_Numeric_Std_Mul_Sgn_Sgn =>
declare
@@ -581,7 +584,7 @@ package body Synth.Oper is
Iir_Index32 (Get_Width (L) + Get_Width (R)));
return Create_Value_Net
- (N, Create_Vector_Type (Bnd, Left.Typ.Vec_El));
+ (N, Create_Vector_Type (Bnd, Get_Array_Element (Left.Typ)));
end;
when Iir_Predefined_Integer_Plus =>
if Is_Const_Val (Left) and then Is_Const_Val (Right) then
@@ -968,7 +971,8 @@ package body Synth.Oper is
(Synth_Sresize (Get_Net (V), W, Expr),
Create_Vec_Type_By_Length (W, Logic_Type));
end;
- when Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat =>
+ when Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat
+ | Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat =>
declare
L : constant Value_Acc := Get_Value (Subprg_Inst, Param1);
R : constant Value_Acc := Get_Value (Subprg_Inst, Param2);
@@ -982,6 +986,13 @@ package body Synth.Oper is
begin
return Synth_Shift_Rotate (Id_Lsr, L, R, Expr);
end;
+ when Iir_Predefined_Ieee_Numeric_Std_Shr_Sgn_Nat =>
+ declare
+ L : constant Value_Acc := Get_Value (Subprg_Inst, Param1);
+ R : constant Value_Acc := Get_Value (Subprg_Inst, Param2);
+ begin
+ return Synth_Shift_Rotate (Id_Asr, L, R, Expr);
+ end;
when Iir_Predefined_Ieee_Numeric_Std_Rol_Uns_Nat =>
declare
L : constant Value_Acc := Get_Value (Subprg_Inst, Param1);