diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-08 08:38:02 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-08 08:38:02 +0000 |
commit | bdac1f6aba5370b21b34c9ee12429c3920b3dffb (patch) | |
tree | bc81db2ee38bc44158a9032905830a76c888d04b /cfrontend/SimplLocalsproof.v | |
parent | 56257af93c1b0785d44e3feba9574e77250d420c (diff) |
Revised handling of int->float conversions:
- introduce Float.floatofint{,u} and use it in the semantics of C
- prove that it is equivalent to int->double conversion followed by
double->float rounding, and use this fact to justify code generation
in Cshmgen.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2294 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/SimplLocalsproof.v')
-rw-r--r-- | cfrontend/SimplLocalsproof.v | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cfrontend/SimplLocalsproof.v b/cfrontend/SimplLocalsproof.v index ad8a06a..83e7375 100644 --- a/cfrontend/SimplLocalsproof.v +++ b/cfrontend/SimplLocalsproof.v @@ -286,7 +286,10 @@ Proof. destruct v; inv H. constructor. (* float *) destruct ty; simpl in H; try discriminate; destruct v; inv H. - constructor. apply cast_float_float_idem. + constructor. unfold cast_float_float, cast_int_float. + destruct f; destruct s; auto. + rewrite Float.singleofint_floatofint. apply Float.singleoffloat_idem. + rewrite Float.singleofintu_floatofintu. apply Float.singleoffloat_idem. constructor. unfold cast_float_float, cast_long_float. destruct f; destruct s; auto. apply Float.singleoflong_idem. apply Float.singleoflongu_idem. constructor. apply cast_float_float_idem. |