summaryrefslogtreecommitdiff
path: root/cfrontend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-06-28 07:59:03 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-06-28 07:59:03 +0000
commit5312915c1b29929f82e1f8de80609a277584913f (patch)
tree0f7ee475743f0eb05d352148a9e1f0b861ee9d34 /cfrontend
parentf3250c32ff42ae18fd03a5311c1f0caec3415aba (diff)
Use Flocq for floats
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1939 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend')
-rw-r--r--cfrontend/C2C.ml2
-rw-r--r--cfrontend/PrintClight.ml2
-rw-r--r--cfrontend/PrintCsyntax.ml6
3 files changed, 5 insertions, 5 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml
index 0d29a23..831f92f 100644
--- a/cfrontend/C2C.ml
+++ b/cfrontend/C2C.ml
@@ -392,7 +392,7 @@ let rec convertExpr env e =
| C.EConst(C.CFloat(f, k, _)) ->
if k = C.FLongDouble then
unsupported "'long double' floating-point literal";
- Eval(Vfloat(f), ty)
+ Eval(Vfloat(coqfloat_of_camlfloat f), ty)
| C.EConst(C.CStr s) ->
let ty = typeStringLiteral s in
Evalof(Evar(name_for_string_literal env s, ty), ty)
diff --git a/cfrontend/PrintClight.ml b/cfrontend/PrintClight.ml
index 1bd21da..feb07fa 100644
--- a/cfrontend/PrintClight.ml
+++ b/cfrontend/PrintClight.ml
@@ -90,7 +90,7 @@ let rec expr p (prec, e) =
| Econst_int(n, _) ->
fprintf p "%ld" (camlint_of_coqint n)
| Econst_float(f, _) ->
- fprintf p "%F" f
+ fprintf p "%F" (camlfloat_of_coqfloat f)
| Eunop(op, a1, _) ->
fprintf p "%s%a" (name_unop op) expr (prec', a1)
| Eaddrof(a1, _) ->
diff --git a/cfrontend/PrintCsyntax.ml b/cfrontend/PrintCsyntax.ml
index 3880188..ae25e17 100644
--- a/cfrontend/PrintCsyntax.ml
+++ b/cfrontend/PrintCsyntax.ml
@@ -175,7 +175,7 @@ let print_pointer_hook
let print_value p v =
match v with
| Vint n -> fprintf p "%ld" (camlint_of_coqint n)
- | Vfloat f -> fprintf p "%F" f
+ | Vfloat f -> fprintf p "%F" (camlfloat_of_coqfloat f)
| Vptr(b, ofs) -> fprintf p "<ptr%a>" !print_pointer_hook (b, ofs)
| Vundef -> fprintf p "<undef>"
@@ -383,8 +383,8 @@ let print_init p = function
| Init_int8 n -> fprintf p "%ld,@ " (camlint_of_coqint n)
| Init_int16 n -> fprintf p "%ld,@ " (camlint_of_coqint n)
| Init_int32 n -> fprintf p "%ld,@ " (camlint_of_coqint n)
- | Init_float32 n -> fprintf p "%F,@ " n
- | Init_float64 n -> fprintf p "%F,@ " n
+ | Init_float32 n -> fprintf p "%F,@ " (camlfloat_of_coqfloat n)
+ | Init_float64 n -> fprintf p "%F,@ " (camlfloat_of_coqfloat n)
| Init_space n -> fprintf p "/* skip %ld, */@ " (camlint_of_coqint n)
| Init_addrof(symb, ofs) ->
let ofs = camlint_of_coqint ofs in