1 #ifndef _ARM_NODES_ATTR_H_
2 #define _ARM_NODES_ATTR_H_
5 #include "../../common/firm_types.h"
8 * Possible ARM register shift types.
10 typedef enum _arm_shift_modifier {
11 ARM_SHF_NONE = 0, /**< no shift */
12 ARM_SHF_IMM = 1, /**< immediate operand with implicit ROR */
13 ARM_SHF_ASR = 2, /**< arithmetic shift right */
14 ARM_SHF_LSL = 3, /**< logical shift left */
15 ARM_SHF_LSR = 4, /**< logical shift right */
16 ARM_SHF_ROR = 5, /**< rotate right */
17 ARM_SHF_RRX = 6, /**< rotate with sign extend */
20 /** True, if the modifier implies a shift argument */
21 #define ARM_HAS_SHIFT(mod) ((mod) > ARM_SHF_IMM)
23 /** get the shift modifier from flags */
24 #define ARM_GET_SHF_MOD(attr) ((attr)->instr_fl & 7)
26 /** set the shift modifier to flags */
27 #define ARM_SET_SHF_MOD(attr, mod) ((attr)->instr_fl = (((attr)->instr_fl & ~7) | (mod)))
31 * Possible ARM condition codes.
33 typedef enum _arm_condition {
34 ARM_COND_EQ = 0, /**< Equal, Z set. */
35 ARM_COND_NE = 1, /**< Not Equal, Z clear */
36 ARM_COND_CS = 2, /**< Carry set, unsigned >=, C set */
37 ARM_COND_CC = 3, /**< Carry clear, unsigned <, C clear */
38 ARM_COND_MI = 4, /**< Minus/Negativ, N set */
39 ARM_COND_PL = 5, /**< Plus/Positiv or Zero, N clear */
40 ARM_COND_VS = 6, /**< Overflow, V set */
41 ARM_COND_VC = 7, /**< No overflow, V clear */
42 ARM_COND_HI = 8, /**< unsigned >, C set and Z clear */
43 ARM_COND_LS = 9, /**< unsigned <=, C clear or Z set */
44 ARM_COND_GE = 10, /**< signed >=, N == V */
45 ARM_COND_LT = 11, /**< signed <, N != V */
46 ARM_COND_GT = 12, /**< signed >, Z clear and N == V */
47 ARM_COND_LE = 13, /**< signed <=, Z set or N != V */
48 ARM_COND_AL = 14, /**< Always (unconditional) */
49 ARM_COND_NV = 15 /**< forbidden */
52 /** Get the condition code from flags */
53 #define ARM_GET_COND(attr) (((attr)->instr_fl >> 3) & 15)
55 /** Set the condition code to flags */
56 #define ARM_SET_COND(attr, code) ((attr)->instr_fl = (((attr)->instr_fl & ~(15 << 3)) | ((code) << 3)))
58 typedef struct _arm_attr_t {
59 arch_irn_flags_t flags; /**< indicating if spillable, rematerializeable ... etc. */
60 int n_res; /**< number of results for this node */
62 const arch_register_req_t **in_req; /**< register requirements for arguments */
63 const arch_register_req_t **out_req; /**< register requirements for results */
65 ir_mode *op_mode; /**< operation mode */
66 unsigned instr_fl; /**< condition code, shift modifier */
67 tarval *value; /**< immediate */
68 const char *symconst_label;
71 long default_proj_num;
73 /* must be last, dynamically allocated */
74 const arch_register_t *slots[1]; /**< register slots for assigned registers */
78 * Returns the shift modifier string.
80 const char *arm_shf_mod_name(arm_shift_modifier mod);
82 #endif /* _ARM_NODES_ATTR_H_ */