From 111007296f1553540a78f59d20197faba29d43c9 Mon Sep 17 00:00:00 2001 From: Brian Padalino Date: Wed, 22 Sep 2021 11:38:59 -0400 Subject: Add explicit ?>= and ?> functions for translation. Instead of swapping L/R arguments to try to create ?>= and ?>, create a function for each which performs the not operation of ?< and ?<= as defined by the LRM. --- src/vhdl/translate/trans-chap7.adb | 8 ++++---- src/vhdl/translate/trans_decls.ads | 2 ++ src/vhdl/translate/translation.adb | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index 55f849c59..8b34b87f9 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -2693,12 +2693,12 @@ package body Trans.Chap7 is Left_Tree, Right_Tree, Res_Otype); when Iir_Predefined_Std_Ulogic_Match_Greater => return Translate_Std_Ulogic_Match - (Ghdl_Std_Ulogic_Match_Lt, - Right_Tree, Left_Tree, Res_Otype); + (Ghdl_Std_Ulogic_Match_Gt, + Left_Tree, Right_Tree, Res_Otype); when Iir_Predefined_Std_Ulogic_Match_Greater_Equal => return Translate_Std_Ulogic_Match - (Ghdl_Std_Ulogic_Match_Le, - Right_Tree, Left_Tree, Res_Otype); + (Ghdl_Std_Ulogic_Match_Ge, + Left_Tree, Right_Tree, Res_Otype); when Iir_Predefined_Bit_Array_Match_Equality => return New_Compare_Op diff --git a/src/vhdl/translate/trans_decls.ads b/src/vhdl/translate/trans_decls.ads index f467a60b6..da4a7c4b0 100644 --- a/src/vhdl/translate/trans_decls.ads +++ b/src/vhdl/translate/trans_decls.ads @@ -255,6 +255,8 @@ package Trans_Decls is Ghdl_Std_Ulogic_Match_Ne : O_Dnode; Ghdl_Std_Ulogic_Match_Lt : O_Dnode; Ghdl_Std_Ulogic_Match_Le : O_Dnode; + Ghdl_Std_Ulogic_Match_Ge : O_Dnode; + Ghdl_Std_Ulogic_Match_Gt : O_Dnode; Ghdl_Std_Ulogic_Array_Match_Eq : O_Dnode; Ghdl_Std_Ulogic_Array_Match_Ne : O_Dnode; diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index c02326ea8..e9f1d1095 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -1943,6 +1943,8 @@ package body Translation is Create_Std_Ulogic_Match_Subprogram ("ne", Ghdl_Std_Ulogic_Match_Ne); Create_Std_Ulogic_Match_Subprogram ("lt", Ghdl_Std_Ulogic_Match_Lt); Create_Std_Ulogic_Match_Subprogram ("le", Ghdl_Std_Ulogic_Match_Le); + Create_Std_Ulogic_Match_Subprogram ("ge", Ghdl_Std_Ulogic_Match_Ge); + Create_Std_Ulogic_Match_Subprogram ("gt", Ghdl_Std_Ulogic_Match_Gt); Create_Std_Ulogic_Array_Match_Subprogram ("eq", Ghdl_Std_Ulogic_Array_Match_Eq); -- cgit v1.2.3