diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2021-02-01 14:34:30 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2021-02-01 14:34:30 +0100 |
commit | 6eabac7e12de09dc4b2a32fa2458e3b91fb34471 (patch) | |
tree | 8bd8229c2433ad204d173502318dfded3c89123e /riscV/ExtValues.v | |
parent | fc36b9c17b8bfd020258944f555d4d9c68eb8dad (diff) | |
download | compcert-kvx-6eabac7e12de09dc4b2a32fa2458e3b91fb34471.tar.gz compcert-kvx-6eabac7e12de09dc4b2a32fa2458e3b91fb34471.zip |
define some semantics in Asm
Diffstat (limited to 'riscV/ExtValues.v')
-rw-r--r-- | riscV/ExtValues.v | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/riscV/ExtValues.v b/riscV/ExtValues.v index 5e6ebf02..4edd2e3d 100644 --- a/riscV/ExtValues.v +++ b/riscV/ExtValues.v @@ -3,6 +3,18 @@ Require Import Integers. Require Import Values. Require Import Floats. +Definition bits_of_float x := + match x with + | Vfloat f => Vlong (Float.to_bits f) + | _ => Vundef + end. + +Definition bits_of_single x := + match x with + | Vsingle f => Vint (Float32.to_bits f) + | _ => Vundef + end. + Definition bitwise_select_int b vtrue vfalse := Val.or (Val.and (Val.neg b) vtrue) (Val.and (Val.sub b Vone) vfalse). @@ -76,3 +88,8 @@ Proof. rewrite Int64.or_commut. apply Int64.or_zero. Qed. + +(* +Compute (Int.unsigned (Float32.to_bits (Float32.of_int (Int.repr 4200)))). +Compute (Int64.unsigned (Float.to_bits (Float.of_int (Int.repr 4233)))). +*) |