diff options
author | Pepijn de Vos <pepijndevos@gmail.com> | 2019-08-20 19:11:10 +0200 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2019-08-20 19:11:10 +0200 |
commit | 27ddfe66da98ad3ea058d29730454b19045d8621 (patch) | |
tree | df59c777410e1bcb87c1790cb19bc883c7e590a4 /src/synth/synth-expr.adb | |
parent | f64f2dbaa0e613f3ee499e6d474074d1b21c8bf4 (diff) | |
download | ghdl-27ddfe66da98ad3ea058d29730454b19045d8621.tar.gz ghdl-27ddfe66da98ad3ea058d29730454b19045d8621.tar.bz2 ghdl-27ddfe66da98ad3ea058d29730454b19045d8621.zip |
initial support for reduce and/or (#900)
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r-- | src/synth/synth-expr.adb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index f5767b3f0..3c2504322 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1265,6 +1265,17 @@ package body Synth.Expr is Set_Location (N, Loc); return Create_Value_Net (N, Create_Res_Bound (Operand, Op)); end Synth_Vec_Monadic; + + function Synth_Vec_Reduce_Monadic (Id : Reduce_Module_Id) + return Value_Acc + is + Op: constant Net := Get_Net (Operand); + N : Net; + begin + N := Build_Reduce (Build_Context, Id, Op); + Set_Location (N, Loc); + return Create_Value_Net (N, Operand.Typ.Vec_El); + end Synth_Vec_Reduce_Monadic; begin Operand := Synth_Expression (Syn_Inst, Operand_Expr); case Def is @@ -1279,6 +1290,10 @@ package body Synth.Expr is when Iir_Predefined_Ieee_Numeric_Std_Neg_Uns | Iir_Predefined_Ieee_Numeric_Std_Neg_Sgn => return Synth_Vec_Monadic (Id_Neg); + when Iir_Predefined_Ieee_1164_Vector_And_Reduce => + return Synth_Vec_Reduce_Monadic(Id_Red_And); + when Iir_Predefined_Ieee_1164_Vector_Or_Reduce => + return Synth_Vec_Reduce_Monadic(Id_Red_Or); when others => Error_Msg_Synth (+Loc, |