2 * Header file for ia32 emitter, containing some function definitions and types.
3 * @author Christian Wuerdig
7 #ifndef _IA32_EMITTER_H_
8 #define _IA32_EMITTER_H_
10 #include "irargs_t.h" // this also inlucdes <libcore/lc_print.h>
14 #include "../bearch.h"
16 #include "bearch_ia32_t.h"
18 typedef struct _ia32_emit_env_t {
20 const arch_env_t *arch_env;
21 const ia32_code_gen_t *cg;
23 DEBUG_ONLY(firm_dbg_module_t *mod;)
26 const lc_arg_env_t *ia32_get_arg_env(void);
28 const char *ia32_emit_binop(const ir_node *irn, ia32_emit_env_t *env);
29 const char *ia32_emit_unop(const ir_node *irn, ia32_emit_env_t *env);
30 const char *ia32_emit_am(const ir_node *irn, ia32_emit_env_t *env);
31 const char *ia32_emit_adr(const ir_node *irn, ia32_emit_env_t *env);
33 const char *ia32_emit_x87_binop(const ir_node *n, ia32_emit_env_t *env);
35 int get_ia32_reg_nr(ir_node *irn, int posi, int in_out);
36 const char *get_ia32_in_reg_name(ir_node *irn, int pos);
38 void ia32_gen_routine(FILE *F, ir_graph *irg, const ia32_code_gen_t *cg);
43 typedef enum section_t {
44 NO_SECTION = -1, /**< no section selected yet. */
45 SECTION_TEXT = 0, /**< text section */
46 SECTION_DATA = 1, /**< data section */
47 SECTION_RODATA = 2, /**< rodata section */
48 SECTION_COMMON = 3, /**< common section */
49 SECTION_TLS = 4, /**< thread local storage section */
50 SECTION_CTOR = 5, /**< ctor section for instrumentation code init */
55 * Switch to a new section.
57 void ia32_switch_section(FILE *f, section_t sec);
59 typedef enum asm_flavour_t {
60 ASM_LINUX_GAS = 0, /**< Linux gas */
61 ASM_MINGW_GAS = 1, /**< MinGW gas */
65 extern asm_flavour_t asm_flavour;
67 #endif /* _IA32_EMITTER_H_ */