diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-20 13:05:53 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-20 13:05:53 +0000 |
commit | 7698300cfe2d3f944ce2e1d4a60a263620487718 (patch) | |
tree | 74292bb5f65bc797906b5c768df2e2e937e869b6 /ia32/CombineOp.v | |
parent | c511207bd0f25c4199770233175924a725526bd3 (diff) | |
download | compcert-7698300cfe2d3f944ce2e1d4a60a263620487718.tar.gz compcert-7698300cfe2d3f944ce2e1d4a60a263620487718.zip |
Merge of branch value-analysis.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2381 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'ia32/CombineOp.v')
-rw-r--r-- | ia32/CombineOp.v | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ia32/CombineOp.v b/ia32/CombineOp.v index 07d5a79a..ca54ba1b 100644 --- a/ia32/CombineOp.v +++ b/ia32/CombineOp.v @@ -17,14 +17,10 @@ Require Import Coqlib. Require Import AST. Require Import Integers. Require Import Op. -Require SelectOp. +Require Import CSEdomain. Definition valnum := positive. -Inductive rhs : Type := - | Op: operation -> list valnum -> rhs - | Load: memory_chunk -> addressing -> list valnum -> rhs. - Section COMBINE. Variable get: valnum -> option rhs. @@ -80,7 +76,7 @@ Function combine_addr (addr: addressing) (args: list valnum) : option(addressing match addr, args with | Aindexed n, x::nil => match get x with - | Some(Op (Olea a) ys) => Some(SelectOp.offset_addressing a n, ys) + | Some(Op (Olea a) ys) => Some(offset_addressing_total a n, ys) | _ => None end | _, _ => None @@ -93,6 +89,21 @@ Function combine_op (op: operation) (args: list valnum) : option(operation * lis | Some(addr', args') => Some(Olea addr', args') | None => None end + | Oandimm n, x :: nil => + match get x with + | Some(Op (Oandimm m) ys) => Some(Oandimm (Int.and m n), ys) + | _ => None + end + | Oorimm n, x :: nil => + match get x with + | Some(Op (Oorimm m) ys) => Some(Oorimm (Int.or m n), ys) + | _ => None + end + | Oxorimm n, x :: nil => + match get x with + | Some(Op (Oxorimm m) ys) => Some(Oxorimm (Int.xor m n), ys) + | _ => None + end | Ocmp cond, _ => match combine_cond cond args with | Some(cond', args') => Some(Ocmp cond', args') |