From 49c59985a88a1bd8ab2ef812574d41dd96022840 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 28 Nov 2019 18:33:22 +0100 Subject: synth-static_oper: handle floating point comparisons. Fix #1042 --- src/synth/synth-static_oper.adb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') 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); -- cgit v1.2.3