From 5312915c1b29929f82e1f8de80609a277584913f Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 28 Jun 2012 07:59:03 +0000 Subject: Use Flocq for floats git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1939 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- arm/PrintAsm.ml | 10 ++++++---- arm/PrintOp.ml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'arm') diff --git a/arm/PrintAsm.ml b/arm/PrintAsm.ml index 1f053df..161c760 100644 --- a/arm/PrintAsm.ml +++ b/arm/PrintAsm.ml @@ -137,7 +137,7 @@ let distance_to_emit_constants () = let float_labels = (Hashtbl.create 39 : (int64, int) Hashtbl.t) let label_float f = - let bf = Int64.bits_of_float f in + let bf = camlint64_of_coqint(Floats.Float.bits_of_double f) in try Hashtbl.find float_labels bf with Not_found -> @@ -563,7 +563,7 @@ let print_instruction oc = function (* We could make good use of the fconstd instruction, but it's available in VFD v3 and up, not in v1 nor v2 *) let lbl = label_float f in - fprintf oc " fldd %a, .L%d @ %.12g\n" freg r1 lbl f; 1 + fprintf oc " fldd %a, .L%d @ %.12g\n" freg r1 lbl (camlfloat_of_coqfloat f); 1 | Pfcmpd(r1, r2) -> fprintf oc " fcmpd %a, %a\n" freg r1 freg r2; fprintf oc " fmstat\n"; 2 @@ -707,9 +707,11 @@ let print_init oc = function | Init_int32 n -> fprintf oc " .word %ld\n" (camlint_of_coqint n) | Init_float32 n -> - fprintf oc " .word 0x%lx %s %.15g \n" (Int32.bits_of_float n) comment n + fprintf oc " .word 0x%lx %s %.15g \n" (camlint_of_coqint (Floats.Float.bits_of_single n)) + comment (camlfloat_of_coqfloat n) | Init_float64 n -> - fprintf oc " .quad %Ld %s %.18g\n" (Int64.bits_of_float n) comment n + fprintf oc " .quad %Ld %s %.18g\n" (camlint64_of_coqint (Floats.Float.bits_of_double n)) + comment (camlfloat_of_coqfloat n) | Init_space n -> let n = camlint_of_z n in if n > 0l then fprintf oc " .space %ld\n" n diff --git a/arm/PrintOp.ml b/arm/PrintOp.ml index 8f21cd4..b5a8d75 100644 --- a/arm/PrintOp.ml +++ b/arm/PrintOp.ml @@ -58,7 +58,7 @@ let print_condition reg pp = function let print_operation reg pp = function | Omove, [r1] -> reg pp r1 | Ointconst n, [] -> fprintf pp "%ld" (camlint_of_coqint n) - | Ofloatconst n, [] -> fprintf pp "%F" n + | Ofloatconst n, [] -> fprintf pp "%F" (camlfloat_of_coqfloat n) | Oaddrsymbol(id, ofs), [] -> fprintf pp "\"%s\" + %ld" (extern_atom id) (camlint_of_coqint ofs) | Oaddrstack ofs, [] -> -- cgit v1.2.3