From 8d138e0ceff0e77014a4459971bb5bed34aa796b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 7 May 2014 05:24:15 +0200 Subject: evaluation: Handl FP literals in Get_Physical_Value. --- evaluation.adb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/evaluation.adb b/evaluation.adb index eb0231e41..084050039 100644 --- a/evaluation.adb +++ b/evaluation.adb @@ -33,6 +33,11 @@ package body Evaluation is when Iir_Kind_Physical_Int_Literal => return Get_Value (Expr) * Get_Value (Get_Physical_Unit_Value (Get_Unit_Name (Expr))); + when Iir_Kind_Physical_Fp_Literal => + return Iir_Int64 + (Get_Fp_Value (Expr) + * Iir_Fp64 (Get_Value (Get_Physical_Unit_Value + (Get_Unit_Name (Expr))))); when Iir_Kind_Unit_Declaration => return Get_Value (Get_Physical_Unit_Value (Expr)); when others => @@ -1678,11 +1683,7 @@ package body Evaluation is return Build_Physical (Get_Physical_Value (Expr), Expr); end if; when Iir_Kind_Physical_Fp_Literal => - return Build_Physical - (Iir_Int64 (Get_Fp_Value (Expr) - * Iir_Fp64 (Get_Value (Get_Physical_Unit_Value - (Get_Unit_Name (Expr))))), - Expr); + return Build_Physical (Get_Physical_Value (Expr), Expr); when Iir_Kind_Constant_Declaration => Val := Get_Default_Value (Expr); Res := Build_Constant (Val, Expr); -- cgit v1.2.3