summaryrefslogtreecommitdiff
path: root/sched/simplify.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-02 23:20:01 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-02 23:20:01 +0100
commitf2b28b4124015718dc4b392e00f4aade4eedc11c (patch)
tree23fd7fe368be899bd17daecfcbde81b0214ed03e /sched/simplify.ml
parentb93b112a57fec10ac9c78058749be1ee27b13d4a (diff)
downloadSystDigit-Projet-f2b28b4124015718dc4b392e00f4aade4eedc11c.tar.gz
SystDigit-Projet-f2b28b4124015718dc4b392e00f4aade4eedc11c.zip
Implement jr/jalr/jer/jner/jltr/jler/jltru/jleru ; add simplification to sched.
Diffstat (limited to 'sched/simplify.ml')
-rw-r--r--sched/simplify.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/sched/simplify.ml b/sched/simplify.ml
index 37e4539..c0cd07e 100644
--- a/sched/simplify.ml
+++ b/sched/simplify.ml
@@ -136,6 +136,14 @@ let arith_simplify p =
| Ebinop(Xor, Aconst([|false|]), x) -> Earg(x)
| Ebinop(Xor, x, Aconst([|false|])) -> Earg(x)
+ | Ebinop(Nand, Avar(a), Avar(b)) when a = b ->
+ Enot(Avar(a))
+ | Ebinop(Xor, Avar(a), Avar(b)) when a = b ->
+ let sz = Env.find a p.p_vars in
+ Earg(Aconst(Array.make sz false))
+ | Ebinop(_, Avar(a), Avar(b)) when a = b ->
+ Earg(Avar(a))
+
| Eslice(i, j, k) when i = j -> Eselect(i, k)
| Econcat(Aconst(a), Aconst(b)) ->