X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbearch.h;h=9c56e5233e018d19ca176a65bfa0051bde40ebce;hb=0318dc1a48ce72b311592c28affc31fabc95f026;hp=4952624ac0c7f5e9f6848272b915bd64237f2f23;hpb=6c3146b96bc65d9de18f3f2b59faf33b8b9935d6;p=libfirm diff --git a/ir/be/bearch.h b/ir/be/bearch.h index 4952624ac..9c56e5233 100644 --- a/ir/be/bearch.h +++ b/ir/be/bearch.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -40,6 +40,13 @@ #include "beirg.h" #include "error.h" +/** + * this constant is returned by the get_sp_bias functions if the stack + * is reset (usually because the frame pointer is copied to the stack + * pointer + */ +#define SP_BIAS_RESET INT_MIN + typedef enum arch_register_class_flags_t { arch_register_class_flag_none = 0, /** don't do automatic register allocation for this class */ @@ -47,6 +54,7 @@ typedef enum arch_register_class_flags_t { /** the register models an abstract state (example: fpu rounding mode) */ arch_register_class_flag_state = 1U << 1 } arch_register_class_flags_t; +ENUM_BITSET(arch_register_class_flags_t) typedef enum arch_register_type_t { arch_register_type_none = 0, @@ -69,6 +77,7 @@ typedef enum arch_register_type_t { * code */ arch_register_type_state = 1U << 5, } arch_register_type_t; +ENUM_BITSET(arch_register_type_t) /** * Different types of register allocation requirements. @@ -93,6 +102,7 @@ typedef enum arch_register_req_type_t { * rewiring logic) */ arch_register_req_type_produces_sp = 1U << 6, } arch_register_req_type_t; +ENUM_BITSET(arch_register_req_type_t) extern const arch_register_req_t *arch_no_register_req; @@ -111,12 +121,14 @@ void arch_dump_reqs_and_registers(FILE *F, const ir_node *node); * Node classification. Used for statistics and for detecting reload nodes. */ typedef enum arch_irn_class_t { + arch_irn_class_none = 0, arch_irn_class_spill = 1 << 0, arch_irn_class_reload = 1 << 1, arch_irn_class_remat = 1 << 2, arch_irn_class_copy = 1 << 3, arch_irn_class_perm = 1 << 4 } arch_irn_class_t; +ENUM_BITSET(arch_irn_class_t) void arch_set_frame_offset(ir_node *irn, int bias); @@ -230,12 +242,13 @@ void be_register_isa_if(const char *name, const arch_isa_if_t *isa); * A register. */ struct arch_register_t { - const char *name; /**< The name of the register. */ - const arch_register_class_t *reg_class; /**< The class of the register */ - unsigned short index; /**< The index of the register in - the class. */ - unsigned short global_index; - arch_register_type_t type; /**< The type of the register. */ + const char *name; /**< The name of the register. */ + const arch_register_class_t *reg_class; /**< The class of the register */ + unsigned short index; /**< The index of the register in + the class. */ + unsigned short global_index; /** The global index this register + in the architecture. */ + arch_register_type_t type; /**< The type of the register. */ /** register constraint allowing just this register */ const arch_register_req_t *single_req; }; @@ -256,15 +269,6 @@ static inline const char *arch_register_get_name(const arch_register_t *reg) return reg->name; } -/** - * Convenience macro to check for register type. - * @param req A pointer to register. - * @param kind The kind of type to check for (see arch_register_type_t). - * @return 1, If register is of given kind, 0 if not. - */ -#define arch_register_type_is(reg, kind) \ - (((reg)->type & arch_register_type_ ## kind) != 0) - /** * A class of registers. * Like general purpose or floating point. @@ -461,6 +465,12 @@ struct arch_isa_if_t { */ arch_env_t *(*init)(FILE *file_handle); + /** + * lowers current program for target. See the documentation for + * be_lower_for_target() for details. + */ + void (*lower_for_target)(void); + /** * Free the isa instance. */ @@ -625,7 +635,7 @@ static inline unsigned arch_irn_get_n_outs(const ir_node *node) if (info->out_infos == NULL) return 0; - return ARR_LEN(info->out_infos); + return (unsigned)ARR_LEN(info->out_infos); } static inline const arch_irn_ops_t *get_irn_ops_simple(const ir_node *node)