aboutsummaryrefslogtreecommitdiffstats
path: root/backend/SelectDiv.vp
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-20 12:25:02 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-20 12:25:02 +0100
commit3718f2f520fc9a4dec2e9c1ac6eaf71f36f4f8a1 (patch)
treefe4fafcb0d72473e7159662bacee7fa7fc13afaa /backend/SelectDiv.vp
parente80af0edafe49ec2576b7fa3a24d4596083698b6 (diff)
downloadcompcert-kvx-3718f2f520fc9a4dec2e9c1ac6eaf71f36f4f8a1.tar.gz
compcert-kvx-3718f2f520fc9a4dec2e9c1ac6eaf71f36f4f8a1.zip
begin float division
Diffstat (limited to 'backend/SelectDiv.vp')
-rw-r--r--backend/SelectDiv.vp6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/SelectDiv.vp b/backend/SelectDiv.vp
index 6ddcd6ac..662162e8 100644
--- a/backend/SelectDiv.vp
+++ b/backend/SelectDiv.vp
@@ -309,20 +309,20 @@ Definition modls (e1 e2: expr) :=
end
| _, _ => modls_base e1 e2
end.
-
+
(** Floating-point division by a constant can also be turned into a FP
multiplication by the inverse constant, but only for powers of 2. *)
Definition divfimm (e: expr) (n: float) :=
match Float.exact_inverse n with
| Some n' => Eop Omulf (e ::: Eop (Ofloatconst n') Enil ::: Enil)
- | None => Eop Odivf (e ::: Eop (Ofloatconst n) Enil ::: Enil)
+ | None => divfbase e (Eop (Ofloatconst n) Enil)
end.
Nondetfunction divf (e1: expr) (e2: expr) :=
match e2 with
| Eop (Ofloatconst n2) Enil => divfimm e1 n2
- | _ => Eop Odivf (e1 ::: e2 ::: Enil)
+ | _ => divfbase e1 e2
end.
Definition divfsimm (e: expr) (n: float32) :=