diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-28 18:33:22 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-28 18:40:27 +0100 |
commit | 49c59985a88a1bd8ab2ef812574d41dd96022840 (patch) | |
tree | b5623fe659b8c62a2ac384b3b141223da09989b5 /src/synth | |
parent | e2ae03c3582edcd71382f6d93f70208af500807d (diff) | |
download | ghdl-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.adb | 19 |
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); |