Added the bearch files to the makefile
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Mon, 14 Mar 2005 15:45:44 +0000 (15:45 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Mon, 14 Mar 2005 15:45:44 +0000 (15:45 +0000)
ir/be/Makefile.in
ir/be/bearch.c
ir/be/bearch.h

index f3aa6c3..3de14ab 100644 (file)
@@ -15,7 +15,7 @@ srcdir = @srcdir@
 topdir = ../..
 subdir := ir/be
 
-INSTALL_HEADERS = be.h
+INSTALL_HEADERS = be.h bearch.h bearch_obj.def
 
 SOURCES = $(INSTALL_HEADERS)
 
index 7aa7b55..c00de53 100644 (file)
@@ -6,6 +6,8 @@
  * $Id$
  */
 
+#include <string.h>
+
 #include "bearch_t.h"
 
 #include "firm_config.h"
@@ -237,7 +239,7 @@ arch_insn_t *arch_add_insn(arch_insn_format_t *fmt, const char *name)
        return insn;
 }
 
-arch_insn_format_t *arch_find_insn_format(arch_isa_t *isa, const char *name)
+arch_insn_format_t *arch_find_insn_format(const arch_isa_t *isa, const char *name)
 {
        return arch_data_find(insn_format, isa, name);
 }
@@ -247,6 +249,11 @@ arch_isa_t *arch_find_isa(const char *name)
        return arch_data_find(isa, NULL, name);
 }
 
+arch_insn_t *arch_find_insn(const arch_isa_t *isa, const char *name)
+{
+       return arch_data_find(insn, isa, name);
+}
+
 arch_register_class_t *arch_find_register_class_t(arch_isa_t *isa, const char *name)
 {
        return arch_data_find(register_class, isa, name);
@@ -279,3 +286,8 @@ ir_node *arch_new_node_bare(const arch_insn_t *insn, ir_graph *irg, int arity)
 
        return arch_new_node(insn, irg, new_Unknown(mode_BB), mode_Is, arity, in);
 }
+
+ir_mode *arch_get_unknown_mode(void)
+{
+       return mode_Is;
+}
index 743002c..3ba2e90 100644 (file)
@@ -2,7 +2,11 @@
 #ifndef _FIRM_BEARCH_H
 #define _FIRM_BEARCH_H
 
-#include "bitset.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bitset_t;
 
 /*
  * Define the types of the arch facility.
@@ -19,7 +23,7 @@
  * @param pos                          The number of the insn's operand to consider.
  * @param valid_regs   A bitset where all valid registers are put.
  */
-typedef void (arch_register_callback_t)(ir_node *irn, int pos, bitset_t *valid_regs);
+typedef void (arch_register_callback_t)(ir_node *irn, int pos, struct bitset_t *valid_regs);
 
 
 /**
@@ -99,7 +103,7 @@ arch_insn_t *arch_add_insn(arch_insn_format_t *fmt, const char *name);
  * @return The instruction format, if it was added before, or NULL if it
  * is unknown.
  */
-arch_insn_format_t *arch_find_insn_format(arch_isa_t *isa, const char *name);
+arch_insn_format_t *arch_find_insn_format(const arch_isa_t *isa, const char *name);
 
 /**
  * Find an isa.
@@ -108,6 +112,14 @@ arch_insn_format_t *arch_find_insn_format(arch_isa_t *isa, const char *name);
  */
 arch_isa_t *arch_find_isa(const char *name);
 
+/**
+ * Find an sintrsuction in the instruction set architecture.
+ * @param isa The instruction set architecture.
+ * @param name The name of the instruction.
+ * @return The instruction or NULL if no such instruction exists.
+ */
+arch_insn_t *arch_find_insn(const arch_isa_t *isa, const char *name);
+
 /**
  * Find a register class of an isa.
  * @param isa The isa.
@@ -126,5 +138,33 @@ arch_register_class_t *arch_find_register_class(arch_isa_t *isa, const char *nam
  */
 arch_register_set_t *arch_get_register_set_for_class(arch_register_class_t *cls);
 
+/**
+ * Get a mode which is a placeholder for an unknown mode.
+ * @return Some mode to use, if you don't know which mode you will need,
+ * yet.
+ */
+ir_mode *arch_get_unknown_mode(void);
+
+/**
+ * Make a new bare instance of an insn.
+ * @param insn The instruction.
+ * @param irg The graph.
+ * @param arity The number of operands to reserve for the ir_node.
+ * @return An ir node. Its block and operands are set to an Unknown
+ * node.
+ */
+ir_node *arch_new_node_bare(const arch_insn_t *insn, ir_graph *irg, int arity);
+
+/**
+ * Make a new instance of an insn.
+ * This functions works like new_ir_node() and uses the op in the
+ * insn.
+ */
+ir_node *arch_new_node(const arch_insn_t *insn, ir_graph *irg, ir_node *block,
+               ir_mode *mode, int arity, ir_node **in);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif