From 7e521780d6aad97182dd5332770a2e38eeef39c0 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Tue, 3 Mar 2015 17:49:57 +0100 Subject: [PATCH] Two more optimizations TODO --- lslopt/lslfoldconst.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 0c19300..511c54e 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -108,6 +108,8 @@ class foldconst(object): # when possible. Or if one is bool and the other is not, to an # expression of the form !(a&-b) (if b is bool). + # TODO: Convert bool(x < 0) to bool(x & 0x80000000) + def CopyNode(self, node): # This is mainly for simple_expr so no need to go deeper than 1 level. @@ -851,6 +853,7 @@ class foldconst(object): return if nt == 'IF': + # TODO: Swap IF/ELSE if both present and nonempty and cond starts with ! self.FoldTree(child, 0) self.FoldCond(child, 0) if child[0]['nt'] == 'CONST':