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 --- ia32/PrintAsm.ml | 12 ++++++++---- ia32/PrintOp.ml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'ia32') diff --git a/ia32/PrintAsm.ml b/ia32/PrintAsm.ml index 4e7c916..ccc3c0f 100644 --- a/ia32/PrintAsm.ml +++ b/ia32/PrintAsm.ml @@ -519,9 +519,9 @@ let print_instruction oc = function | Pmovsd_ff(rd, r1) -> fprintf oc " movapd %a, %a\n" freg r1 freg rd | Pmovsd_fi(rd, n) -> - let b = Int64.bits_of_float n in + let b = camlint64_of_coqint (Floats.Float.bits_of_double n) in let lbl = new_label() in - fprintf oc " movsd %a, %a %s %.18g\n" label lbl freg rd comment n; + fprintf oc " movsd %a, %a %s %.18g\n" label lbl freg rd comment (camlfloat_of_coqfloat n); float_literals := (lbl, b) :: !float_literals | Pmovsd_fm(rd, a) -> fprintf oc " movsd %a, %a\n" addressing a freg rd @@ -772,9 +772,13 @@ let print_init oc = function | Init_int32 n -> fprintf oc " .long %ld\n" (camlint_of_coqint n) | Init_float32 n -> - fprintf oc " .long %ld %s %.18g\n" (Int32.bits_of_float n) comment n + fprintf oc " .long %ld %s %.18g\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/ia32/PrintOp.ml b/ia32/PrintOp.ml index 6e6ef3c..f76416a 100644 --- a/ia32/PrintOp.ml +++ b/ia32/PrintOp.ml @@ -63,7 +63,7 @@ let print_addressing 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) | Ocast8signed, [r1] -> fprintf pp "int8signed(%a)" reg r1 | Ocast8unsigned, [r1] -> fprintf pp "int8unsigned(%a)" reg r1 | Ocast16signed, [r1] -> fprintf pp "int16signed(%a)" reg r1 -- cgit v1.2.3