} arch_register_class_flags_t;
typedef enum arch_register_type_t {
- arch_register_type_none = 0,
+ arch_register_type_none = 0,
arch_register_type_caller_save = 1, /**< The register must be saved by the caller
- upon a function call. It thus can be overwritten
- in the called function. */
+ upon a function call. It thus can be overwritten
+ in the called function. */
arch_register_type_callee_save = 2, /**< The register must be saved by the caller
- upon a function call. It thus can be overwritten
- in the called function. */
+ upon a function call. It thus can be overwritten
+ in the called function. */
arch_register_type_ignore = 4, /**< Do not consider this register when allocating. */
arch_register_type_joker = 8, /**< The emitter can choose an arbitrary register */
arch_register_type_virtual = 16, /**< This is just a virtual register.Virtual registers have
- nearly no constraints, it is a allowed to have multiple
- definition for the same register at a point) */
+ nearly no constraints, it is a allowed to have multiple
+ definition for the same register at a point) */
arch_register_type_state = 32, /**< The register represents a state that should be handled by
bestate code */
} arch_register_type_t;
-/**
- * Put all registers in a class into a bitset.
- * @param cls The class.
- * @param bs The bitset. May be NULL.
- * @return The number of registers in the class.
- */
-extern int arch_register_class_put(const arch_register_class_t *cls, bitset_t *bs);
-
typedef enum arch_operand_type_t {
- arch_operand_type_invalid,
+ arch_operand_type_invalid,
arch_operand_type_memory,
arch_operand_type_register,
arch_operand_type_immediate,
* Different types of register allocation requirements.
*/
typedef enum arch_register_req_type_t {
- arch_register_req_type_none = 0, /**< No register requirement. */
- arch_register_req_type_normal = 1, /**< All registers in the class are allowed. */
- arch_register_req_type_limited = 2, /**< Only a real subset of the class is allowed. */
- arch_register_req_type_should_be_same = 4, /**< The register should be equal to another one at the node. */
- arch_register_req_type_should_be_different = 8, /**< The register must be unequal from some other at the node. */
+ arch_register_req_type_none = 0, /**< No register requirement. */
+ arch_register_req_type_normal = 1, /**< All registers in the class are allowed. */
+ arch_register_req_type_limited = 2, /**< Only a real subset of the class is allowed. */
+ arch_register_req_type_should_be_same = 4, /**< The register should be equal to another one at the node. */
+ arch_register_req_type_must_be_different = 8, /**< The register must be unequal from some other at the node. */
} arch_register_req_type_t;
extern const arch_register_req_t *arch_no_register_req;
arch_irn_class_normal = 1 << 0,
arch_irn_class_spill = 1 << 1,
arch_irn_class_reload = 1 << 2,
- arch_irn_class_copy = 1 << 3,
- arch_irn_class_perm = 1 << 4,
- arch_irn_class_branch = 1 << 5,
- arch_irn_class_call = 1 << 6,
- arch_irn_class_load = 1 << 7,
- arch_irn_class_store = 1 << 8,
- arch_irn_class_stackparam = 1 << 9,
+ arch_irn_class_remat = 1 << 3,
+ arch_irn_class_copy = 1 << 4,
+ arch_irn_class_perm = 1 << 5,
+ arch_irn_class_branch = 1 << 6,
+ arch_irn_class_call = 1 << 7,
+ arch_irn_class_load = 1 << 8,
+ arch_irn_class_store = 1 << 9,
+ arch_irn_class_stackparam = 1 << 10,
} arch_irn_class_t;
/**
*/
extern const char *arch_irn_flag_str(arch_irn_flags_t flag);
-extern const arch_irn_ops_t *arch_get_irn_ops(const arch_env_t *env,
- const ir_node *irn);
+void arch_set_frame_offset(ir_node *irn, int bias);
-extern void arch_set_frame_offset(const arch_env_t *env, ir_node *irn, int bias);
-
-extern ir_entity *arch_get_frame_entity(const arch_env_t *env, const ir_node *irn);
-extern void arch_set_frame_entity(const arch_env_t *env, ir_node *irn, ir_entity *ent);
-extern int arch_get_sp_bias(const arch_env_t *env, ir_node *irn);
+ir_entity *arch_get_frame_entity(const ir_node *irn);
+void arch_set_frame_entity(ir_node *irn, ir_entity *ent);
+int arch_get_sp_bias(ir_node *irn);
extern int arch_get_op_estimated_cost(const arch_env_t *env, const ir_node *irn);
-extern arch_inverse_t *arch_get_inverse(const arch_env_t *env, const ir_node *irn, int i, arch_inverse_t *inverse, struct obstack *obstack);
-extern int arch_possible_memory_operand(const arch_env_t *env, const ir_node *irn, unsigned int i);
-extern void arch_perform_memory_operand(const arch_env_t *env, ir_node *irn, ir_node *spill, unsigned int i);
+arch_inverse_t *arch_get_inverse(const ir_node *irn, int i, arch_inverse_t *inverse, struct obstack *obstack);
+int arch_possible_memory_operand(const ir_node *irn, unsigned int i);
+void arch_perform_memory_operand(ir_node *irn, ir_node *spill, unsigned int i);
/**
* Get the register requirements for a node.
- * @param env The architecture environment.
* @param irn The node.
* @param pos The position of the operand you're interested in.
* @return A pointer to the register requirements. If NULL is returned, the
* operand was no register operand.
*/
-extern const arch_register_req_t *
-arch_get_register_req(const arch_env_t *env, const ir_node *irn, int pos);
+const arch_register_req_t *arch_get_register_req(const ir_node *irn, int pos);
/**
* Check if an operand is a register operand.
* a register class for an operand of a node.
* @param env The environment.
* @param irn The node.
- * @param pos The postition of the node's operand.
+ * @param pos The position of the node's operand.
* @param bs The bitset all allocatable registers shall be put into.
* Note, that you can also pass NULL here. If you don't,
* make sure, the bitset is as large as the register class
/**
* Put all registers which shall not be ignored by the register
* allocator in a bit set.
- * @param env The arch env.
* @param cls The register class to consider.
* @param bs The bit set to put the registers to.
*/
-extern void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls, bitset_t *bs);
+extern void arch_put_non_ignore_regs(const arch_register_class_t *cls, bitset_t *bs);
/**
* Check, if a register is assignable to an operand of a node.
* @param reg The register.
*/
extern void arch_set_irn_register(const arch_env_t *env, ir_node *irn,
- const arch_register_t *reg);
+ const arch_register_t *reg);
/**
* Classify a node.