diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-07 21:34:14 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-04-07 21:34:14 +0200 |
commit | 249482aed76d209ff203f9afeeb3f10db004e8c0 (patch) | |
tree | 80efa32a68a7b993ef94751e38acb4b49f849b7d /backend/Cminor.v | |
parent | 5a3d4adc631f5b5d3dc4585b7b28ea18b6faf633 (diff) | |
download | compcert-kvx-249482aed76d209ff203f9afeeb3f10db004e8c0.tar.gz compcert-kvx-249482aed76d209ff203f9afeeb3f10db004e8c0.zip |
start implementing expect as expr
Diffstat (limited to 'backend/Cminor.v')
-rw-r--r-- | backend/Cminor.v | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/Cminor.v b/backend/Cminor.v index 91a4c104..dcebbb86 100644 --- a/backend/Cminor.v +++ b/backend/Cminor.v @@ -77,6 +77,7 @@ Inductive unary_operation : Type := | Osingleoflongu: unary_operation. (**r unsigned long to float32 *) Inductive binary_operation : Type := + | Oexpect: typ -> binary_operation (**r first value, second is expected*) | Oadd: binary_operation (**r integer addition *) | Osub: binary_operation (**r integer subtraction *) | Omul: binary_operation (**r integer multiplication *) @@ -301,6 +302,7 @@ Definition eval_unop (op: unary_operation) (arg: val) : option val := Definition eval_binop (op: binary_operation) (arg1 arg2: val) (m: mem): option val := match op with + | Oexpect ty => Some (Val.normalize arg1 ty) | Oadd => Some (Val.add arg1 arg2) | Osub => Some (Val.sub arg1 arg2) | Omul => Some (Val.mul arg1 arg2) |