X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fmips%2Fmips_emitter.h;h=6b11d3b0b275b32fd03e760fc1255288c79fa93d;hb=9e56dbf066d3698df877e2a9f78caeca29ea5a03;hp=993788ae1ddd881dfea60812fc5b1ede48953255;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/be/mips/mips_emitter.h b/ir/be/mips/mips_emitter.h index 993788ae1..6b11d3b0b 100644 --- a/ir/be/mips/mips_emitter.h +++ b/ir/be/mips/mips_emitter.h @@ -1,35 +1,64 @@ -#ifndef _mips_EMITTER_H_ -#define _mips_EMITTER_H_ +/* + * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/** + * @file + * @brief declarations for the mips assembler emitter + * @author Matthias Braun, Mehdi + * @version $Id$ + */ +#ifndef FIRM_BE_MIPS_MIPS_EMITTER_H +#define FIRM_BE_MIPS_MIPS_EMITTER_H -#include "irargs_t.h" // this also inlucdes #include "irnode.h" -#include "debug.h" #include "../bearch.h" +#include "../beemitter.h" #include "bearch_mips_t.h" -typedef struct _mips_emit_env_t { - FILE *out; - const arch_env_t *arch_env; - const mips_code_gen_t *cg; - DEBUG_ONLY(firm_dbg_module_t *mod;) -} mips_emit_env_t; - -const lc_arg_env_t *mips_get_arg_env(void); +typedef struct mips_emit_env_t mips_emit_env_t; -void equalize_dest_src(FILE *F, ir_node *n); +struct mips_emit_env_t { + be_emit_env_t *emit; + const arch_env_t *arch_env; + const mips_code_gen_t *cg; + mips_isa_t *isa; +}; -int get_mips_reg_nr(ir_node *irn, int posi, int in_out); -const char *get_mips_in_reg_name(ir_node *irn, int pos); +void mips_emit_source_register(mips_emit_env_t *env, const ir_node *node, int pos); +void mips_emit_dest_register(mips_emit_env_t *env, const ir_node *node, int pos); +void mips_emit_immediate(mips_emit_env_t *env, const ir_node *node); +void mips_emit_jump_target(mips_emit_env_t *env, const ir_node *node); +void mips_emit_jump_target_proj(mips_emit_env_t *env, const ir_node *node, + long pn); +void mips_emit_jump_or_fallthrough(mips_emit_env_t *env, const ir_node *node, + long pn); -void mips_gen_routine(FILE *F, ir_graph *irg, const mips_code_gen_t *cg); void mips_register_emitters(void); -ir_node *mips_get_jump_block(const ir_node* node, int projn); +ir_node *mips_get_jump_block(const ir_node* node, long projn); /** returns the label used for a block */ const char* mips_get_block_label(const ir_node* block); /** returns the label for the jumptable */ const char* mips_get_jumptbl_label(const ir_node* switchjmp); -#endif /* _mips_EMITTER_H_ */ +void mips_gen_routine(mips_code_gen_t *cg, ir_graph *irg); + +#endif