From 2a0168fea37b68ad14e2cb60bf215111e49d4870 Mon Sep 17 00:00:00 2001 From: xleroy Date: Wed, 23 Jul 2014 08:54:56 +0000 Subject: Merge of "newspilling" branch: - Support single-precision floats as first-class values - Introduce chunks Many32, Many64 and types Tany32, Tany64 to support saving and restoring registers without knowing the exact types (int/single/float) of their contents, just their sizes. - Memory model: generalize the opaque encoding of pointers to apply to any value, not just pointers, if chunks Many32/Many64 are selected. - More properties of FP arithmetic proved. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2537 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- backend/SelectDiv.vp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'backend/SelectDiv.vp') diff --git a/backend/SelectDiv.vp b/backend/SelectDiv.vp index 938ce5d..a275a85 100644 --- a/backend/SelectDiv.vp +++ b/backend/SelectDiv.vp @@ -182,4 +182,16 @@ Nondetfunction divf (e1: expr) (e2: expr) := | _ => Eop Odivf (e1 ::: e2 ::: Enil) end. +Definition divfsimm (e: expr) (n: float32) := + match Float32.exact_inverse n with + | Some n' => Eop Omulfs (e ::: Eop (Osingleconst n') Enil ::: Enil) + | None => Eop Odivfs (e ::: Eop (Osingleconst n) Enil ::: Enil) + end. + +Nondetfunction divfs (e1: expr) (e2: expr) := + match e2 with + | Eop (Osingleconst n2) Enil => divfsimm e1 n2 + | _ => Eop Odivfs (e1 ::: e2 ::: Enil) + end. + -- cgit v1.2.3