diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-05-15 08:18:00 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-05-15 08:18:00 +0200 |
commit | 6a57bfe3512001324d0954ebea4156a1746608a5 (patch) | |
tree | 70d9f22f228295a22ad2f78e0c683ab35e13801b /src/synth/synth-static_oper.adb | |
parent | bc31638a6c7ab04bc5e71941dd69ff13e9d19ec7 (diff) | |
download | ghdl-6a57bfe3512001324d0954ebea4156a1746608a5.tar.gz ghdl-6a57bfe3512001324d0954ebea4156a1746608a5.tar.bz2 ghdl-6a57bfe3512001324d0954ebea4156a1746608a5.zip |
synth-static_oper: handle more comparisons. Fix #1310
Diffstat (limited to 'src/synth/synth-static_oper.adb')
-rw-r--r-- | src/synth/synth-static_oper.adb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb index 5f1316745..f7bf518e3 100644 --- a/src/synth/synth-static_oper.adb +++ b/src/synth/synth-static_oper.adb @@ -828,6 +828,14 @@ package body Synth.Static_Oper is Synth_Compare_Uns_Uns (Left, Right, Less, Expr) = Greater; return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); end; + when Iir_Predefined_Ieee_Numeric_Std_Gt_Sgn_Sgn => + declare + Res : Boolean; + begin + Res := + Synth_Compare_Sgn_Sgn (Left, Right, Less, Expr) = Greater; + return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); + end; when Iir_Predefined_Ieee_Numeric_Std_Gt_Nat_Uns => declare Res : Boolean; @@ -845,6 +853,23 @@ package body Synth.Static_Oper is return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); end; + when Iir_Predefined_Ieee_Numeric_Std_Ge_Uns_Uns => + declare + Res : Boolean; + begin + Res := + Synth_Compare_Uns_Uns (Left, Right, Greater, Expr) >= Equal; + return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); + end; + when Iir_Predefined_Ieee_Numeric_Std_Ge_Sgn_Sgn => + declare + Res : Boolean; + begin + Res := + Synth_Compare_Sgn_Sgn (Left, Right, Less, Expr) >= Equal; + return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); + end; + when Iir_Predefined_Ieee_Numeric_Std_Le_Uns_Uns => declare Res : Boolean; @@ -861,6 +886,14 @@ package body Synth.Static_Oper is Synth_Compare_Uns_Nat (Left, Right, Greater, Expr) <= Equal; return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); end; + when Iir_Predefined_Ieee_Numeric_Std_Le_Sgn_Sgn => + declare + Res : Boolean; + begin + Res := + Synth_Compare_Sgn_Sgn (Left, Right, Less, Expr) <= Equal; + return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); + end; when Iir_Predefined_Ieee_Numeric_Std_Lt_Uns_Uns => declare @@ -886,6 +919,14 @@ package body Synth.Static_Oper is Synth_Compare_Nat_Uns (Left, Right, Greater, Expr) < Equal; return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); end; + when Iir_Predefined_Ieee_Numeric_Std_Lt_Sgn_Sgn => + declare + Res : Boolean; + begin + Res := + Synth_Compare_Sgn_Sgn (Left, Right, Less, Expr) < Equal; + return Create_Memory_U8 (Boolean'Pos (Res), Res_Typ); + end; when Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Uns | Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Log |