ia32_register_init(isa);
ia32_create_opcodes();
+ ia32_register_copy_attr_func();
isa->regs_16bit = pmap_create();
isa->regs_8bit = pmap_create();
#include "ia32_nodes_attr.h"
#include "ia32_new_nodes.h"
#include "gen_ia32_regalloc_if.h"
-#include "gen_ia32_new_nodes.h"
#ifdef obstack_chunk_alloc
# undef obstack_chunk_alloc
ia32_attr_t *attr = get_ia32_attr(node);
if (num) {
- attr->slots = xcalloc(num, sizeof(attr->slots[0]));
+ attr->slots = NEW_ARR_D(arch_register_t *, get_irg_obstack(get_irn_irg(node)), num);
+ memset(attr->slots, 0, sizeof(attr->slots[0]) * num);
}
else {
attr->slots = NULL;
memcpy((void *)attr_new->slots, (void *)attr_old->slots, sizeof(attr_new->slots[0]) * n_res);
}
+/**
+ * Registers the ia32_copy_attr function for all ia32 opcodes.
+ */
void ia32_register_copy_attr_func(void) {
unsigned i, f = get_ia32_opcode_first(), l = get_ia32_opcode_last();
void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, const ia32_register_req_t **in_reqs, \
const ia32_register_req_t **out_reqs, int n_res);
+/**
+ * Registers the ia32_copy_attr function for all ia32 opcodes.
+ */
+void ia32_register_copy_attr_func(void);
+
/* Include the generated headers */
#include "gen_ia32_new_nodes.h"
ir_graph *irg = env->irg;
ir_mode *src_mode = get_irn_mode(op);
ir_mode *tgt_mode = env->mode;
+ int src_bits = get_mode_size_bits(src_mode);
int tgt_bits = get_mode_size_bits(tgt_mode);
ir_node *block = env->block;
ir_node *new_op = NULL;
proj = new_rd_Proj(dbg, irg, block, new_op, mode_Is, 0);
- if (tgt_bits == 8) {
+ if (tgt_bits == 8 || src_bits == 8) {
new_op = new_rd_ia32_Conv_I2I8Bit(dbg, irg, block, noreg, noreg, proj, nomem, mode_T);
}
else {
}
else {
DB((mod, LEVEL_1, "create Conv(int, int) ...", src_mode, tgt_mode));
- if (tgt_bits == 8) {
+ if (tgt_bits == 8 || src_bits == 8) {
new_op = new_rd_ia32_Conv_I2I8Bit(dbg, irg, block, noreg, noreg, op, nomem, mode_T);
}
else {