#include "besched.h"
#include "begnuas.h"
#include "beblocksched.h"
-#include "be_dbgout.h"
#include "amd64_emitter.h"
#include "gen_amd64_emitter.h"
#include "amd64_nodes_attr.h"
#include "amd64_new_nodes.h"
-#define SNPRINTF_BUF_LEN 128
-
#include "benode.h"
/*************************************************************
key.u.id = get_entity_ld_ident(attr->entity);
key.is_ident = 1;
key.label = 0;
- entry = (sym_or_tv_t *)set_insert(sym_or_tv, &key, sizeof(key), hash_ptr(key.u.generic));
+ entry = set_insert(sym_or_tv_t, sym_or_tv, &key, sizeof(key), hash_ptr(key.u.generic));
if (entry->label == 0) {
/* allocate a label */
entry->label = get_unique_label();
be_emit_cstring("\tjmp ");
amd64_emit_cfop_target(node);
} else {
- be_emit_cstring("\t/* fallthrough to ");
- amd64_emit_cfop_target(node);
- be_emit_cstring(" */");
+ if (be_options.verbose_asm) {
+ be_emit_cstring("\t/* fallthrough to ");
+ amd64_emit_cfop_target(node);
+ be_emit_cstring(" */");
+ }
}
be_emit_finish_line_gas(node);
}
*/
static void emit_amd64_Jcc(const ir_node *irn)
{
- const ir_edge_t *edge;
- const ir_node *proj_true = NULL;
- const ir_node *proj_false = NULL;
- const ir_node *block;
- const ir_node *next_block;
- const char *suffix;
- const amd64_attr_t *attr = get_amd64_attr_const(irn);
- ir_relation relation = attr->ext.relation;
- ir_node *op1 = get_irn_n(irn, 0);
- const amd64_attr_t *cmp_attr = get_amd64_attr_const(op1);
- bool is_signed = !cmp_attr->data.cmp_unsigned;
+ const ir_node *proj_true = NULL;
+ const ir_node *proj_false = NULL;
+ const ir_node *block;
+ const ir_node *next_block;
+ const char *suffix;
+ const amd64_attr_t *attr = get_amd64_attr_const(irn);
+ ir_relation relation = attr->ext.relation;
+ ir_node *op1 = get_irn_n(irn, 0);
+ const amd64_attr_t *cmp_attr = get_amd64_attr_const(op1);
+ bool is_signed = !cmp_attr->data.cmp_unsigned;
assert(is_amd64_Cmp(op1));
be_emit_finish_line_gas(proj_true);
if (get_cfop_target_block(proj_false) == next_block) {
- be_emit_cstring("\t/* fallthrough to ");
- amd64_emit_cfop_target(proj_false);
- be_emit_cstring(" */");
- be_emit_finish_line_gas(proj_false);
+ if (be_options.verbose_asm) {
+ be_emit_cstring("\t/* fallthrough to ");
+ amd64_emit_cfop_target(proj_false);
+ be_emit_cstring(" */");
+ be_emit_finish_line_gas(proj_false);
+ }
} else {
be_emit_cstring("\tjmp ");
amd64_emit_cfop_target(proj_false);
}
if (mode_is_float(mode)) {
- panic("emit_be_Copy: move not supported for FP");
+ panic("move not supported for FP");
} else if (mode_is_data(mode)) {
be_emit_cstring("\tmov ");
amd64_emit_source_register(irn, 0);
amd64_emit_dest_register(irn, 0);
be_emit_finish_line_gas(irn);
} else {
- panic("emit_be_Copy: move not supported for this mode");
+ panic("move not supported for this mode");
}
}
*/
static void amd64_gen_block(ir_node *block, void *data)
{
- ir_node *node;
(void) data;
if (! is_Block(block))
return;
- be_gas_emit_block_name(block);
- be_emit_char(':');
-
- be_emit_write_line();
+ be_gas_begin_block(block, true);
sched_foreach(block, node) {
amd64_emit_node(node);
blk_sched = be_create_block_schedule(irg);
- be_gas_emit_function_prolog(entity, 4);
+ be_gas_emit_function_prolog(entity, 4, NULL);
irg_block_walk_graph(irg, amd64_gen_labels, NULL, NULL);