aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-28 18:33:22 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-28 18:40:27 +0100
commit49c59985a88a1bd8ab2ef812574d41dd96022840 (patch)
treeb5623fe659b8c62a2ac384b3b141223da09989b5 /src/synth
parente2ae03c3582edcd71382f6d93f70208af500807d (diff)
downloadghdl-49c59985a88a1bd8ab2ef812574d41dd96022840.tar.gz
ghdl-49c59985a88a1bd8ab2ef812574d41dd96022840.tar.bz2
ghdl-49c59985a88a1bd8ab2ef812574d41dd96022840.zip
synth-static_oper: handle floating point comparisons. Fix #1042
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-static_oper.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb
index 75803c607..3a1c53ef4 100644
--- a/src/synth/synth-static_oper.adb
+++ b/src/synth/synth-static_oper.adb
@@ -239,6 +239,25 @@ package body Synth.Static_Oper is
return Create_Value_Discrete
(Left.Scal / Right.Scal, Res_Typ);
+ when Iir_Predefined_Floating_Less =>
+ return Create_Value_Discrete
+ (Boolean'Pos (Left.Fp < Right.Fp), Boolean_Type);
+ when Iir_Predefined_Floating_Less_Equal =>
+ return Create_Value_Discrete
+ (Boolean'Pos (Left.Fp <= Right.Fp), Boolean_Type);
+ when Iir_Predefined_Floating_Equality =>
+ return Create_Value_Discrete
+ (Boolean'Pos (Left.Fp = Right.Fp), Boolean_Type);
+ when Iir_Predefined_Floating_Inequality =>
+ return Create_Value_Discrete
+ (Boolean'Pos (Left.Fp /= Right.Fp), Boolean_Type);
+ when Iir_Predefined_Floating_Greater =>
+ return Create_Value_Discrete
+ (Boolean'Pos (Left.Fp > Right.Fp), Boolean_Type);
+ when Iir_Predefined_Floating_Greater_Equal =>
+ return Create_Value_Discrete
+ (Boolean'Pos (Left.Fp >= Right.Fp), Boolean_Type);
+
when Iir_Predefined_Floating_Div =>
return Create_Value_Float
(Left.Fp / Right.Fp, Res_Typ);