aboutsummaryrefslogtreecommitdiffstats
path: root/kvx
diff options
context:
space:
mode:
authorDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-12 12:06:32 +0100
committerDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-12 12:06:32 +0100
commit50377ef4b9430fa019e26fac3028739f0308e9b1 (patch)
tree4a2ce2c21c96f5ba04787f0d8bccb8bb8784d894 /kvx
parent5ba8c76d3eaf78d1a57678af5d9b006e29c4a02f (diff)
downloadcompcert-kvx-50377ef4b9430fa019e26fac3028739f0308e9b1.tar.gz
compcert-kvx-50377ef4b9430fa019e26fac3028739f0308e9b1.zip
unsigned long -> float without function calls
Diffstat (limited to 'kvx')
-rw-r--r--kvx/SelectLong.vp9
-rw-r--r--kvx/SelectLongproof.v5
2 files changed, 12 insertions, 2 deletions
diff --git a/kvx/SelectLong.vp b/kvx/SelectLong.vp
index 16517aa5..3598025a 100644
--- a/kvx/SelectLong.vp
+++ b/kvx/SelectLong.vp
@@ -23,6 +23,7 @@ Require Import OpHelpers.
Require Import SelectOp SplitLong.
Require Import ExtValues.
Require Import DecBoolOps.
+Require FPExtra.
Local Open Scope cminorsel_scope.
Local Open Scope string_scope.
@@ -448,9 +449,15 @@ Definition longofsingle (e: expr) := longoffloat (floatofsingle e).
Definition longuofsingle (e: expr) := longuoffloat (floatofsingle e).
+Definition use_inlined_fp_conversions := true.
+Opaque use_inlined_fp_conversions.
+
Definition singleoflong (e: expr) := SplitLong.singleoflong e.
-Definition singleoflongu (e: expr) := SplitLong.singleoflongu e.
+Definition singleoflongu (e: expr) :=
+ if use_inlined_fp_conversions
+ then FPExtra.e_single_of_longu e
+ else SplitLong.singleoflongu e.
End SELECT.
diff --git a/kvx/SelectLongproof.v b/kvx/SelectLongproof.v
index a88863b4..b858158b 100644
--- a/kvx/SelectLongproof.v
+++ b/kvx/SelectLongproof.v
@@ -939,7 +939,10 @@ Qed.
Theorem eval_singleoflongu: partial_unary_constructor_sound singleoflongu Val.singleoflongu.
Proof.
unfold singleoflongu; red; intros.
- eapply SplitLongproof.eval_singleoflongu; eauto.
+ destruct use_inlined_fp_conversions.
+ - econstructor. split. apply FPExtra.e_single_of_longu_correct.
+ eassumption. rewrite H0. cbn. constructor.
+ - eapply SplitLongproof.eval_singleoflongu; eauto.
Qed.
End CMCONSTR.