diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-03 15:08:43 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-03 15:08:43 +0100 |
commit | 63c878610c5ef531731f5d9f83570f19c8c1acbc (patch) | |
tree | f1807b8e0af2752af42aac463bdd5936ba0bef6d /powerpc/CSE2deps.v | |
parent | a2b5e7c85dbbc6a27d941dcd931b36c4aa747fb5 (diff) | |
download | compcert-kvx-63c878610c5ef531731f5d9f83570f19c8c1acbc.tar.gz compcert-kvx-63c878610c5ef531731f5d9f83570f19c8c1acbc.zip |
CSE2 for powerpc
Diffstat (limited to 'powerpc/CSE2deps.v')
-rw-r--r-- | powerpc/CSE2deps.v | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/powerpc/CSE2deps.v b/powerpc/CSE2deps.v new file mode 100644 index 00000000..9db51bbb --- /dev/null +++ b/powerpc/CSE2deps.v @@ -0,0 +1,20 @@ +Require Import BoolEqual Coqlib. +Require Import AST Integers Floats. +Require Import Values Memory Globalenvs Events. +Require Import Op. + + +Definition can_swap_accesses_ofs ofsr chunkr ofsw chunkw := + (0 <=? ofsw) && (ofsw <=? (Ptrofs.modulus - largest_size_chunk)) + && (0 <=? ofsr) && (ofsr <=? (Ptrofs.modulus - largest_size_chunk)) + && ((ofsw + size_chunk chunkw <=? ofsr) || + (ofsr + size_chunk chunkr <=? ofsw)). + +Definition may_overlap chunk addr args chunk' addr' args' := + match addr, addr', args, args' with + | (Aindexed ofs), (Aindexed ofs'), + (base :: nil), (base' :: nil) => + if peq base base' + then negb (can_swap_accesses_ofs (Int.unsigned ofs') chunk' (Int.unsigned ofs) chunk) + else true | _, _, _, _ => true + end. |