2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief declarations for the mips assembler emitter
23 * @author Matthias Braun, Mehdi
26 #ifndef FIRM_BE_MIPS_MIPS_EMITTER_H
27 #define FIRM_BE_MIPS_MIPS_EMITTER_H
31 #include "../bearch.h"
32 #include "../beemitter.h"
34 #include "bearch_mips_t.h"
36 typedef struct mips_emit_env_t mips_emit_env_t;
38 struct mips_emit_env_t {
40 const arch_env_t *arch_env;
41 const mips_code_gen_t *cg;
45 void mips_emit_source_register(mips_emit_env_t *env, const ir_node *node, int pos);
46 void mips_emit_dest_register(mips_emit_env_t *env, const ir_node *node, int pos);
47 void mips_emit_immediate(mips_emit_env_t *env, const ir_node *node);
48 void mips_emit_jump_target(mips_emit_env_t *env, const ir_node *node);
49 void mips_emit_jump_target_proj(mips_emit_env_t *env, const ir_node *node,
52 void equalize_dest_src(FILE *F, ir_node *n);
54 int get_mips_reg_nr(ir_node *irn, int posi, int in_out);
55 const char *get_mips_in_reg_name(ir_node *irn, int pos);
57 void mips_register_emitters(void);
58 ir_node *mips_get_jump_block(const ir_node* node, int projn);
60 /** returns the label used for a block */
61 const char* mips_get_block_label(const ir_node* block);
62 /** returns the label for the jumptable */
63 const char* mips_get_jumptbl_label(const ir_node* switchjmp);
65 void mips_gen_routine(mips_code_gen_t *cg, ir_graph *irg);