diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-03 15:07:17 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-03 15:07:17 +0000 |
commit | a0aaa3552d53b20a99566ac7116063fbb31b9964 (patch) | |
tree | 72b86341e136accdba1c339230cee0f1ba5013d9 /backend/Cminor.v | |
parent | 18bbf6d3cfb15219c87ebc79a5dd58bf75f2b4c4 (diff) |
Treat casts int64 -> float32 as primitive operations instead of two
casts int64 -> float64 -> float32. The latter causes double rounding
errors.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2290 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/Cminor.v')
-rw-r--r-- | backend/Cminor.v | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/backend/Cminor.v b/backend/Cminor.v index 6b36b4d..9f7244b 100644 --- a/backend/Cminor.v +++ b/backend/Cminor.v @@ -49,7 +49,7 @@ Inductive unary_operation : Type := | Onotint: unary_operation (**r bitwise complement *) | Onegf: unary_operation (**r float opposite *) | Oabsf: unary_operation (**r float absolute value *) - | Osingleoffloat: unary_operation (**r float truncation *) + | Osingleoffloat: unary_operation (**r float truncation to float32 *) | Ointoffloat: unary_operation (**r signed integer to float *) | Ointuoffloat: unary_operation (**r unsigned integer to float *) | Ofloatofint: unary_operation (**r float to signed integer *) @@ -59,10 +59,12 @@ Inductive unary_operation : Type := | Ointoflong: unary_operation (**r long to int *) | Olongofint: unary_operation (**r signed int to long *) | Olongofintu: unary_operation (**r unsigned int to long *) - | Olongoffloat: unary_operation (**r signed long to float *) - | Olonguoffloat: unary_operation (**r unsigned long to float *) - | Ofloatoflong: unary_operation (**r float to signed long *) - | Ofloatoflongu: unary_operation. (**r float to unsigned long *) + | Olongoffloat: unary_operation (**r float to signed long *) + | Olonguoffloat: unary_operation (**r float to unsigned long *) + | Ofloatoflong: unary_operation (**r signed long to float *) + | Ofloatoflongu: unary_operation (**r unsigned long to float *) + | Osingleoflong: unary_operation (**r signed long to float32 *) + | Osingleoflongu: unary_operation. (**r unsigned long to float32 *) Inductive binary_operation : Type := | Oadd: binary_operation (**r integer addition *) @@ -271,6 +273,8 @@ Definition eval_unop (op: unary_operation) (arg: val) : option val := | Olonguoffloat => Val.longuoffloat arg | Ofloatoflong => Val.floatoflong arg | Ofloatoflongu => Val.floatoflongu arg + | Osingleoflong => Val.singleoflong arg + | Osingleoflongu => Val.singleoflongu arg end. Definition eval_binop |