X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firop.c;h=e542a5495763aaf9e33deed99bd5cd4f41f2f49e;hb=a947c2090825c6a49b3fbfaafc00c8c34d649a40;hp=c9ea42cb3eaffcb30a501a6fda0e32490e757046;hpb=816aa2f422d57ebc0b513fa3ca66a90fa6058387;p=libfirm diff --git a/ir/ir/irop.c b/ir/ir/irop.c index c9ea42cb3..e542a5495 100644 --- a/ir/ir/irop.c +++ b/ir/ir/irop.c @@ -23,13 +23,9 @@ * @author Christian Schaefer, Goetz Lindenmaier, Michael Beck * @version $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#ifdef HAVE_STRING_H -# include -#endif +#include #include "irop_t.h" #include "irnode_t.h" @@ -42,6 +38,8 @@ #include "xmalloc.h" +void be_init_op(void); + /** the available next opcode */ static unsigned next_iro = iro_MaxOpcode; @@ -61,6 +59,7 @@ ir_op *op_Const; ir_op *get_op_Const (void) { return op_Const; } ir_op *op_SymConst; ir_op *get_op_SymConst (void) { return op_SymConst; } ir_op *op_Call; ir_op *get_op_Call (void) { return op_Call; } +ir_op *op_Builtin; ir_op *get_op_Builtin (void) { return op_Builtin; } ir_op *op_Add; ir_op *get_op_Add (void) { return op_Add; } ir_op *op_Sub; ir_op *get_op_Sub (void) { return op_Sub; } ir_op *op_Minus; ir_op *get_op_Minus (void) { return op_Minus; } @@ -108,8 +107,6 @@ ir_op *op_EndExcept; ir_op *get_op_EndExcept (void) { return op_EndExcept; } ir_op *op_NoMem; ir_op *get_op_NoMem (void) { return op_NoMem; } ir_op *op_Mux; ir_op *get_op_Mux (void) { return op_Mux; } -ir_op *op_Min; ir_op *get_op_Min (void) { return op_Max; } -ir_op *op_Max; ir_op *get_op_Max (void) { return op_Max; } ir_op *op_CopyB; ir_op *get_op_CopyB (void) { return op_CopyB; } ir_op *op_Raise; ir_op *get_op_Raise (void) { return op_Raise; } @@ -118,6 +115,7 @@ ir_op *op_Bound; ir_op *get_op_Bound (void) { return op_Bound; } ir_op *op_Pin; ir_op *get_op_Pin (void) { return op_Pin; } ir_op *op_ASM; ir_op *get_op_ASM (void) { return op_ASM; } +ir_op *op_Dummy; ir_op *get_op_Dummy (void) { return op_Dummy; } ir_op *op_Anchor; ir_op *get_op_Anchor (void) { return op_Anchor; } /* @@ -235,10 +233,7 @@ new_ir_op(unsigned code, const char *name, op_pin_state p, unsigned flags, op_arity opar, int op_index, size_t attr_size, const ir_op_ops *ops) { - ir_op *res; - - res = (ir_op *)xmalloc(sizeof(*res)); - memset(res, 0, sizeof(*res)); + ir_op *res = XMALLOCZ(ir_op); res->code = code; res->name = new_id_from_chars(name, strlen(name)); @@ -353,8 +348,6 @@ init_op(void) op_NoMem = new_ir_op(iro_NoMem, "NoMem", op_pin_state_pinned, N|NB|NI, oparity_zero, -1, 0, NULL); op_Mux = new_ir_op(iro_Mux, "Mux", op_pin_state_floats, N, oparity_trinary, -1, 0, NULL); - op_Min = new_ir_op(iro_Min, "Min", op_pin_state_floats, N, oparity_binary, -1, 0, NULL); - op_Max = new_ir_op(iro_Max, "Max", op_pin_state_floats, N, oparity_binary, -1, 0, NULL); op_CopyB = new_ir_op(iro_CopyB, "CopyB", op_pin_state_mem_pinned, F|H|M, oparity_trinary,-1, sizeof(copyb_attr), NULL); op_InstOf = new_ir_op(iro_InstOf, "InstOf", op_pin_state_mem_pinned, H, oparity_unary, -1, sizeof(io_attr), NULL); @@ -364,6 +357,9 @@ init_op(void) op_Pin = new_ir_op(iro_Pin, "Pin", op_pin_state_pinned, H, oparity_unary, -1, 0, NULL); op_ASM = new_ir_op(iro_ASM, "ASM", op_pin_state_mem_pinned, K|M, oparity_variable, -1, sizeof(asm_attr), NULL); + op_Builtin = new_ir_op(iro_Builtin, "Builtin", op_pin_state_mem_pinned, M, oparity_variable, -1, sizeof(builtin_attr), NULL); + + op_Dummy = new_ir_op(iro_Dummy, "Dummy", op_pin_state_pinned, X|F|S|c|NB,oparity_zero, -1, 0, NULL); op_Anchor = new_ir_op(iro_Anchor, "Anchor", op_pin_state_pinned, N|NB, oparity_variable, -1, 0, NULL); @@ -378,6 +374,9 @@ init_op(void) #undef E #undef NB #undef NI + + /* initialize backend opcodes */ + be_init_op(); } /* init_op */ @@ -443,8 +442,6 @@ void finish_op(void) { free_ir_op (op_EndExcept); op_EndExcept = NULL; free_ir_op (op_NoMem ); op_NoMem = NULL; - free_ir_op (op_Max ); op_Max = NULL; - free_ir_op (op_Min ); op_Min = NULL; free_ir_op (op_Mux ); op_Mux = NULL; free_ir_op (op_CopyB ); op_CopyB = NULL; @@ -454,6 +451,7 @@ void finish_op(void) { free_ir_op (op_Pin ); op_Pin = NULL; free_ir_op (op_ASM ); op_ASM = NULL; + free_ir_op (op_Dummy ); op_Dummy = NULL; free_ir_op (op_Anchor ); op_Anchor = NULL; }