summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-07-03 15:07:17 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-07-03 15:07:17 +0000
commita0aaa3552d53b20a99566ac7116063fbb31b9964 (patch)
tree72b86341e136accdba1c339230cee0f1ba5013d9 /common
parent18bbf6d3cfb15219c87ebc79a5dd58bf75f2b4c4 (diff)
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
Diffstat (limited to 'common')
-rw-r--r--common/Values.v12
1 files changed, 12 insertions, 0 deletions
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)