From a0aaa3552d53b20a99566ac7116063fbb31b9964 Mon Sep 17 00:00:00 2001 From: xleroy Date: Wed, 3 Jul 2013 15:07:17 +0000 Subject: Treat casts int64 -> float32 as primitive operations instead of two casts int64 -> float64 -> float32. The latter causes double rounding errors. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2290 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- common/Values.v | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'common') diff --git a/common/Values.v b/common/Values.v index 7caf551..b937071 100644 --- a/common/Values.v +++ b/common/Values.v @@ -438,6 +438,18 @@ Definition floatoflongu (v: val) : option val := | _ => None end. +Definition singleoflong (v: val) : option val := + match v with + | Vlong n => Some (Vfloat (Float.singleoflong n)) + | _ => None + end. + +Definition singleoflongu (v: val) : option val := + match v with + | Vlong n => Some (Vfloat (Float.singleoflongu n)) + | _ => None + end. + Definition addl (v1 v2: val): val := match v1, v2 with | Vlong n1, Vlong n2 => Vlong(Int64.add n1 n2) -- cgit v1.2.3