From 50377ef4b9430fa019e26fac3028739f0308e9b1 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sat, 12 Feb 2022 12:06:32 +0100 Subject: unsigned long -> float without function calls --- configure | 1 + kvx/SelectLong.vp | 9 ++++++++- kvx/SelectLongproof.v | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 61a6697c..685ce390 100755 --- a/configure +++ b/configure @@ -821,6 +821,7 @@ CFLAGS= -D __KVX_COS__ SIMU=kvx-cluster -- BACKENDLIB=Machblock.v Machblockgen.v Machblockgenproof.v\\ Asmblock.v Asmblockgen.v Asmblockgenproof0.v Asmblockgenproof1.v Asmblockgenproof.v Asmvliw.v Asmblockprops.v\\ + FPExtra.v \\ ForwardSimulationBlock.v PostpassScheduling.v PostpassSchedulingproof.v\\ Asmblockdeps.v DecBoolOps.v Chunks.v Peephole.v ExtValues.v ExtFloats.v\\ AbstractBasicBlocksDef.v SeqSimuTheory.v ImpSimuTest.v Parallelizability.v 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. -- cgit