2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief This file implements the common parts of IR transformation from
10 * @author Matthias Braun, Sebastian Buchwald
12 #ifndef FIRM_BE_IA32_IA32_COMMON_TRANSFORM_H
13 #define FIRM_BE_IA32_IA32_COMMON_TRANSFORM_H
15 #include "firm_types.h"
16 #include "bearch_ia32_t.h"
19 * An assembler constraint.
21 typedef struct constraint_t constraint_t;
23 const arch_register_class_t *cls;
24 unsigned allowed_registers;
25 char all_registers_allowed;
31 extern ir_heights_t *ia32_heights;
32 extern int ia32_no_pic_adjust;
34 ir_type *ia32_get_prim_type(const ir_mode *mode);
37 * Get an atomic entity that is initialized with a tarval forming
40 ir_entity *ia32_create_float_const_entity(ia32_isa_t *isa, ir_tarval *tv,
44 * Creates an immediate.
46 * @param irg The IR graph the node belongs to.
47 * @param symconst if set, create a SymConst immediate
48 * @param symconst_sign sign for the symconst
49 * @param val integer value for the immediate
51 ir_node *ia32_create_Immediate(ir_graph *irg, ir_entity *symconst, int symconst_sign, long val);
54 * returns register by name (used for determining clobber specifications in
57 const arch_register_t *ia32_get_clobber_register(const char *clobber);
60 * Return true if a mode can be stored in the GP register set.
62 int ia32_mode_needs_gp_reg(ir_mode *mode);
65 * generates code for a ASM node
67 ir_node *ia32_gen_ASM(ir_node *node);
70 * Transforms a CopyB node.
72 * @return The transformed node.
74 ir_node *ia32_gen_CopyB(ir_node *node);
77 * Transform the Thread Local Storage Proj.
79 ir_node *ia32_gen_Proj_tls(ir_node *node);
82 * This function just sets the register for the Unknown node
83 * as this is not done during register allocation because Unknown
84 * is an "ignore" node.
86 ir_node *ia32_gen_Unknown(ir_node *node);
88 const arch_register_req_t *ia32_parse_clobber(const char *clobber);
91 * Checks whether other node inputs depend on the am_candidate (via mem-proj).
93 int ia32_prevents_AM(ir_node *const block, ir_node *const am_candidate,
94 ir_node *const other);
96 ir_node *ia32_try_create_Immediate(ir_node *node, char immediate_constraint_type);