aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index ac27debf..4c6569eb 100644
--- a/simplify.c
+++ b/simplify.c
@@ -535,6 +535,13 @@ static pseudo_t eval_op(int op, unsigned size, pseudo_t src1, pseudo_t src2)
ur = right & bits;
switch (op) {
+ case OP_NEG:
+ res = -left;
+ break;
+ case OP_NOT:
+ res = ~ul;
+ break;
+
case OP_ADD:
res = left + right;
break;
@@ -636,6 +643,11 @@ undef:
return NULL;
}
+static inline pseudo_t eval_unop(int op, unsigned size, pseudo_t src)
+{
+ return eval_op(op, size, src, VOID);
+}
+
///
// Simplifications
// ^^^^^^^^^^^^^^^