X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Farm%2Farm_nodes_attr.h;h=70d611b6dbb742787c5bc56269c131a8bbfe68ce;hb=1872920c09708b361d06c0dc9f4c1fd0a03544f5;hp=3610181ebb99c8e6e7ab0eb9362ac473297ce68f;hpb=4d5c3365a58cba59993045a9e08e686d8ae079a7;p=libfirm diff --git a/ir/be/arm/arm_nodes_attr.h b/ir/be/arm/arm_nodes_attr.h index 3610181eb..70d611b6d 100644 --- a/ir/be/arm/arm_nodes_attr.h +++ b/ir/be/arm/arm_nodes_attr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -17,11 +17,18 @@ * PURPOSE. */ -#ifndef _ARM_NODES_ATTR_H_ -#define _ARM_NODES_ATTR_H_ +/** + * @file + * @brief declarations for ARM node attributes + * @author Oliver Richter, Tobias Gneist, Michael Beck + * @version $Id$ + */ +#ifndef FIRM_BE_ARM_ARM_NODES_ATTR_H +#define FIRM_BE_ARM_ARM_NODES_ATTR_H +#include "firm_types.h" +#include "irnode_t.h" #include "../bearch_t.h" -#include "../../common/firm_types.h" /** * Possible ARM register shift types. @@ -33,7 +40,7 @@ typedef enum _arm_shift_modifier { ARM_SHF_LSL = 3, /**< logical shift left */ ARM_SHF_LSR = 4, /**< logical shift right */ ARM_SHF_ROR = 5, /**< rotate right */ - ARM_SHF_RRX = 6, /**< rotate with sign extend */ + ARM_SHF_RRX = 6, /**< rotate right through carry bits */ } arm_shift_modifier; /** True, if the modifier implies a shift argument */ @@ -45,6 +52,12 @@ typedef enum _arm_shift_modifier { /** set the shift modifier to flags */ #define ARM_SET_SHF_MOD(attr, mod) ((attr)->instr_fl = (((attr)->instr_fl & ~7) | (mod))) +/** fpa immediate bit */ +#define ARM_FPA_IMM (1 << 3) /**< fpa floating point immediate */ + +#define ARM_GET_FPA_IMM(attr) ((attr)->instr_fl & ARM_FPA_IMM) +#define ARM_SET_FPA_IMM(attr) ((attr)->instr_fl |= ARM_FPA_IMM) +#define ARM_CLR_FPA_IMM(attr) ((attr)->instr_fl &= ~ARM_FPA_IMM) /** * Possible ARM condition codes. @@ -54,8 +67,8 @@ typedef enum _arm_condition { ARM_COND_NE = 1, /**< Not Equal, Z clear */ ARM_COND_CS = 2, /**< Carry set, unsigned >=, C set */ ARM_COND_CC = 3, /**< Carry clear, unsigned <, C clear */ - ARM_COND_MI = 4, /**< Minus/Negativ, N set */ - ARM_COND_PL = 5, /**< Plus/Positiv or Zero, N clear */ + ARM_COND_MI = 4, /**< Minus/Negative, N set */ + ARM_COND_PL = 5, /**< Plus/Positive or Zero, N clear */ ARM_COND_VS = 6, /**< Overflow, V set */ ARM_COND_VC = 7, /**< No overflow, V clear */ ARM_COND_HI = 8, /**< unsigned >, C set and Z clear */ @@ -69,33 +82,76 @@ typedef enum _arm_condition { } arm_condition; /** Get the condition code from flags */ -#define ARM_GET_COND(attr) (((attr)->instr_fl >> 3) & 15) +#define ARM_GET_COND(attr) (((attr)->instr_fl >> 4) & 15) /** Set the condition code to flags */ -#define ARM_SET_COND(attr, code) ((attr)->instr_fl = (((attr)->instr_fl & ~(15 << 3)) | ((code) << 3))) - +#define ARM_SET_COND(attr, code) ((attr)->instr_fl = (((attr)->instr_fl & ~(15 << 4)) | ((code) << 4))) + +/** Encoding for fpa immediates */ +enum fpa_immediates { + fpa_null = 0, + fpa_one, + fpa_two, + fpa_three, + fpa_four, + fpa_five, + fpa_ten, + fpa_half, + fpa_max +}; + +/** Generic ARM node attributes. */ typedef struct _arm_attr_t { - arch_irn_flags_t flags; /**< indicating if spillable, rematerializeable ... etc. */ - int n_res; /**< number of results for this node */ + except_attr exc; /**< the exception attribute. MUST be the first one. */ + arch_irn_flags_t flags; /**< indicating if spillable, rematerializeable ... etc. */ const arch_register_req_t **in_req; /**< register requirements for arguments */ const arch_register_req_t **out_req; /**< register requirements for results */ - ir_mode *op_mode; /**< operation mode */ - unsigned instr_fl; /**< condition code, shift modifier */ - tarval *value; /**< immediate */ - const char *symconst_label; - int proj_num; - int n_projs; - long default_proj_num; + ir_mode *op_mode; /**< operation mode if different from node's mode */ + unsigned instr_fl; /**< condition code, shift modifier */ + long imm_value; /**< immediate */ + int *out_flags; /**< flags for each produced value */ - /* must be last, dynamically allocated */ - const arch_register_t *slots[1]; /**< register slots for assigned registers */ + const arch_register_t **slots; /**< register slots for assigned registers */ } arm_attr_t; +/** Attributes for a SymConst */ +typedef struct _arm_SymConst_attr_t { + arm_attr_t attr; /**< base attributes */ + ident *symconst_id; /**< for SymConsts: its ident */ +} arm_SymConst_attr_t; + +/** Attributes for a CondJmp */ +typedef struct _arm_CondJmp_attr_t { + arm_attr_t attr; /**< base attributes */ + int proj_num; +} arm_CondJmp_attr_t; + +/** Attributes for a SwitchJmp */ +typedef struct _arm_SwitchJmp_attr_t { + arm_attr_t attr; /**< base attributes */ + int n_projs; + long default_proj_num; +} arm_SwitchJmp_attr_t; + +/** Attributes for a fpaConst */ +typedef struct _arm_fpaConst_attr_t { + arm_attr_t attr; /**< base attributes */ + tarval *tv; /**< the tarval representing the FP const */ +} arm_fpaConst_attr_t; + /** * Returns the shift modifier string. */ const char *arm_shf_mod_name(arm_shift_modifier mod); -#endif /* _ARM_NODES_ATTR_H_ */ +/** + * Return the fpa immediate from the encoding. + */ +const char *arm_get_fpa_imm_name(long imm_value); + +#define CAST_ARM_ATTR(type,ptr) ((type *)(ptr)) +#define CONST_CAST_ARM_ATTR(type,ptr) ((const type *)(ptr)) + +#endif