* Implements "Strenght Reduction of Multiplications by Integer Constants" by Youfeng Wu.
* Implements Division and Modulo by Consts from "Hackers Delight",
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#include "ircons.h"
#include "irarch.h"
#include "irflag.h"
+#include "error.h"
#undef DEB
case ZERO:
return inst->irn = new_r_Const(current_ir_graph, env->blk, env->mode, get_mode_null(env->mode));
default:
- assert(0);
+ panic("Unsupported instruction kind");
return NULL;
}
}
case ZERO:
inst->costs = costs = env->evaluate(inst->kind, NULL);
return costs;
- default:
- assert(0);
- return 0;
}
+ panic("Unsupported instruction kind");
}
/**
#define SHL(a, b) tarval_shl(a, b)
#define SHR(a, b) tarval_shr(a, b)
#define ADD(a, b) tarval_add(a, b)
-#define SUB(a, b) tarval_sub(a, b)
+#define SUB(a, b) tarval_sub(a, b, NULL)
#define MUL(a, b) tarval_mul(a, b)
#define DIV(a, b) tarval_div(a, b)
#define MOD(a, b) tarval_mod(a, b)