X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fbe%2Fia32%2Fia32_emitter.h;h=4f45feee891f1a2b4c8099f700e6d4df0e74851d;hb=808762e7935fe025e83507254156d8c7d1fc8b46;hp=4245b4cbbf9be7a6918bf5a987ba27afbeb5d838;hpb=c7aae220f908ae663ee138672a16a14aceab2aa4;p=libfirm diff --git a/ir/be/ia32/ia32_emitter.h b/ir/be/ia32/ia32_emitter.h index 4245b4cbb..4f45feee8 100644 --- a/ir/be/ia32/ia32_emitter.h +++ b/ir/be/ia32/ia32_emitter.h @@ -1,25 +1,73 @@ -#ifndef _IA32_EMITTER_H_ -#define _IA32_EMITTER_H_ +/* + * Copyright (C) 1995-2008 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. + */ -#include "irargs_t.h" // this also inlucdes -#include "irnode.h" -#include "set.h" - -#include "debug.h" +/** + * @file + * @brief This file implements the ia32 node emitter. + * @author Christian Wuerdig, Matthias Braun + */ +#ifndef FIRM_BE_IA32_IA32_EMITTER_H +#define FIRM_BE_IA32_IA32_EMITTER_H -typedef struct _emit_env_t { - firm_dbg_module_t *mod; - FILE *out; - set *reg_set; -} emit_env_t; +#include "irnode.h" -const lc_arg_env_t *ia32_get_arg_env(void); +#include "bearch.h" -void equalize_dest_src(FILE *F, ir_node *n); +#include "bearch_ia32_t.h" -int get_ia32_in_regnr(ir_node *irn, int pos); -const char *get_ia32_in_reg_name(ir_node *irn, int pos); +/** + * fmt parameter output + * ---- ---------------------- --------------------------------------------- + * %% % + * %AF address mode or x87 register + * %AM address mode of the node + * %AR arch_register_t const* address mode of the node or register + * %ASx address mode of the node or source register x + * %B operands for binary operation + * %Dx destination register x + * %Fx x87 register x + * %FM x87 mode suffix + * %FX SSE mode suffix + * %I immediate of the node + * %L control flow target of the node + * %M mode suffix of the node + * %Px condition code + * %PX int condition code + * %R arch_register_t const* register + * %Sx source register x + * %s char const* string + * %u unsigned int unsigned int + * %d signed int signed int + * + * x starts at 0 + * # modifier for %ASx, %D, %R, and %S uses ls mode of node to alter register width + * # modifier for %M for extend suffix + * * modifier does not prefix immediates with $, but AM with * + * l modifier for %lu and %ld + * > modifier to output high 8bit register (ah, bh) + * < modifier to output low 8bit register (al, bl) + */ +void ia32_emitf(ir_node const *node, char const *fmt, ...); -void ia32_gen_routine(FILE *F, ir_graph *irg, set *reg_set); +void ia32_gen_routine(ir_graph *irg); +void ia32_gen_binary_routine(ir_graph *irg); -#endif /* _IA32_EMITTER_H_ */ +/** Initializes the Emitter. */ +void ia32_init_emitter(void); +#endif