* @brief This file implements the creation of the achitecture specific firm
* opcodes and the coresponding node constructors for the sparc
* assembler irg.
- * @version $Id: TEMPLATE_new_nodes.c 26673 2009-10-01 16:43:13Z matze $
+ * @version $Id$
*/
#include "config.h"
/**
* Dumper interface for dumping sparc nodes in vcg.
- * @param n the node to dump
* @param F the output file
+ * @param n the node to dump
* @param reason indicates which kind of information should be dumped
- * @return 0 on success or != 0 on failure
*/
-static int sparc_dump_node(ir_node *n, FILE *F, dump_reason_t reason)
+static void sparc_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
{
ir_mode *mode = NULL;
}
break;
+ case dump_node_info_txt:
+ arch_dump_reqs_and_registers(F, n);
+ break;
+
case dump_node_nodeattr_txt:
/* TODO: dump some attributes which should show up */
/* in node name in dump (e.g. consts or the like) */
+ //fputs("\n", F);
- break;
+ if (is_sparc_FrameAddr(n)) {
+ const sparc_symconst_attr_t *attr = get_sparc_symconst_attr_const(n);
+ fprintf(F, "fp_offset: 0x%X\n", attr->fp_offset);
+ }
+
+ if (is_sparc_Load(n) || is_sparc_Store(n)) {
+ const sparc_load_store_attr_t *attr = get_sparc_load_store_attr_const(n);
+ fprintf(F, "offset: 0x%lX\n", attr->offset);
+ fprintf(F, "is_frame_entity: %s\n", attr->is_frame_entity == true ? "true" : "false");
+ }
- case dump_node_info_txt:
- arch_dump_reqs_and_registers(F, n);
break;
}
-
- return 0;
}
/* ATTRIBUTE INIT SETTERS / HELPERS */
return (const sparc_attr_t *)get_irn_generic_attr_const(node);
}
-
-
sparc_load_store_attr_t *get_sparc_load_store_attr(ir_node *node)
{
assert(is_sparc_irn(node) && "need sparc node to get attributes");
return (const sparc_jmp_switch_attr_t *)get_irn_generic_attr_const(node);
}
-
sparc_cmp_attr_t *get_sparc_cmp_attr(ir_node *node)
{
assert(is_sparc_irn(node) && "need sparc node to get attributes");
return (const sparc_cmp_attr_t *)get_irn_generic_attr_const(node);
}
+
+sparc_save_attr_t *get_sparc_save_attr(ir_node *node)
+{
+ assert(is_sparc_Save(node) && "need sparc Save node to get attributes");
+ return (sparc_save_attr_t *)get_irn_generic_attr_const(node);
+}
+
+const sparc_save_attr_t *get_sparc_save_attr_const(const ir_node *node)
+{
+ assert(is_sparc_Save(node) && "need sparc Save node to get attributes");
+ return (const sparc_save_attr_t *)get_irn_generic_attr_const(node);
+}
+
/**
* Returns the argument register requirements of a sparc node.
*/
bool is_frame_entity)
{
sparc_load_store_attr_t *attr = get_irn_generic_attr(res);
- attr->load_store_mode = ls_mode;
+ attr->load_store_mode = ls_mode;
attr->entity = entity;
attr->entity_sign = entity_sign;
attr->is_frame_entity = is_frame_entity;
attr->fp_offset = 0;
}
+static void init_sparc_save_attr(ir_node *res, int initial_stacksize)
+{
+ sparc_save_attr_t *attr = get_irn_generic_attr(res);
+ attr->initial_stacksize = initial_stacksize;
+}
+
/**
* copies sparc attributes of node
*/
|| attr_a->is_unsigned != attr_b->is_unsigned;
}
+static int cmp_attr_sparc_save(ir_node *a, ir_node *b)
+{
+ const sparc_save_attr_t *attr_a = get_sparc_save_attr_const(a);
+ const sparc_save_attr_t *attr_b = get_sparc_save_attr_const(b);
+
+ if (cmp_attr_sparc(a, b))
+ return 1;
+
+ return attr_a->initial_stacksize != attr_b->initial_stacksize;
+}
+
/* Include the generated constructor functions */
#include "gen_sparc_new_nodes.c.inl"