From 14a9bb4b267eeead8cd9503ee19e860a8bc0d763 Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 28 Oct 2010 14:56:39 +0000 Subject: Float.intoffloat and Float.intuoffloat are now partial functions. (May fail if float is too big to be converted.) git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1544 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- ia32/ConstpropOp.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ia32/ConstpropOp.v') diff --git a/ia32/ConstpropOp.v b/ia32/ConstpropOp.v index 7dfa0465..815ba0e0 100644 --- a/ia32/ConstpropOp.v +++ b/ia32/ConstpropOp.v @@ -288,7 +288,7 @@ Definition eval_static_operation (op: operation) (vl: list approx) := | Omulf, F n1 :: F n2 :: nil => F(Float.mul n1 n2) | Odivf, F n1 :: F n2 :: nil => F(Float.div n1 n2) | Osingleoffloat, F n1 :: nil => F(Float.singleoffloat n1) - | Ointoffloat, F n1 :: nil => I(Float.intoffloat n1) + | Ointoffloat, F n1 :: nil => match Float.intoffloat n1 with Some x => I x | None => Unknown end | Ofloatofint, I n1 :: nil => F(Float.floatofint n1) | Ocmp c, vl => match eval_static_condition c vl with None => Unknown | Some b => I(if b then Int.one else Int.zero) end | _, _ => Unknown @@ -590,7 +590,7 @@ Definition eval_static_operation (op: operation) (vl: list approx) := | eval_static_operation_case38 n1 => F(Float.singleoffloat n1) | eval_static_operation_case39 n1 => - I(Float.intoffloat n1) + match Float.intoffloat n1 with Some x => I x | None => Unknown end | eval_static_operation_case41 n1 => F(Float.floatofint n1) | eval_static_operation_case43 c vl => -- cgit