projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Deleted generated files from svn, there are (re-)created by sparc_spec.pl.
[libfirm]
/
ir
/
be
/
ppc32
/
ppc32_emitter.c
diff --git
a/ir/be/ppc32/ppc32_emitter.c
b/ir/be/ppc32/ppc32_emitter.c
index
1477df6
..
b49c38e
100644
(file)
--- a/
ir/be/ppc32/ppc32_emitter.c
+++ b/
ir/be/ppc32/ppc32_emitter.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-200
7
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-200
8
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-23,9
+23,7
@@
* @author Moritz Kroll, Jens Mueller
* @version $Id$
*/
* @author Moritz Kroll, Jens Mueller
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h"
-#endif
#include <limits.h>
#include <limits.h>
@@
-40,8
+38,8
@@
#include "irargs_t.h"
#include "error.h"
#include "irargs_t.h"
#include "error.h"
-#include "../besched
_t
.h"
-#include "../benode
_t
.h"
+#include "../besched.h"
+#include "../benode.h"
#include "ppc32_emitter.h"
#include "gen_ppc32_emitter.h"
#include "ppc32_emitter.h"
#include "gen_ppc32_emitter.h"
@@
-56,9
+54,6
@@
static char printbuf[SNPRINTF_BUF_LEN];
extern int isleaf;
extern int isleaf;
-static const arch_env_t *arch_env;
-static const ppc32_code_gen_t *cg;
-
/*************************************************************
* _ _ __ _ _
/*************************************************************
* _ _ __ _ _
@@
-83,7
+78,7
@@
static const arch_register_t *get_in_reg(const ir_node *irn, int pos) {
in register we need. */
op = get_irn_n(irn, pos);
in register we need. */
op = get_irn_n(irn, pos);
- reg = arch_get_irn_register(
arch_env,
op);
+ reg = arch_get_irn_register(op);
assert(reg && "no in register found");
return reg;
assert(reg && "no in register found");
return reg;
@@
-104,9
+99,9
@@
static const arch_register_t *get_out_reg(const ir_node *irn, int pos) {
/* Proj with the corresponding projnum for the register */
if (get_irn_mode(irn) != mode_T) {
/* Proj with the corresponding projnum for the register */
if (get_irn_mode(irn) != mode_T) {
- reg = arch_get_irn_register(
arch_env,
irn);
+ reg = arch_get_irn_register(irn);
} else if (is_ppc32_irn(irn)) {
} else if (is_ppc32_irn(irn)) {
- reg =
get_ppc32_out_reg
(irn, pos);
+ reg =
arch_irn_get_register
(irn, pos);
} else {
const ir_edge_t *edge;
} else {
const ir_edge_t *edge;
@@
-114,7
+109,7
@@
static const arch_register_t *get_out_reg(const ir_node *irn, int pos) {
proj = get_edge_src_irn(edge);
assert(is_Proj(proj) && "non-Proj from mode_T node");
if (get_Proj_proj(proj) == pos) {
proj = get_edge_src_irn(edge);
assert(is_Proj(proj) && "non-Proj from mode_T node");
if (get_Proj_proj(proj) == pos) {
- reg = arch_get_irn_register(
arch_env,
proj);
+ reg = arch_get_irn_register(proj);
break;
}
}
break;
}
}
@@
-141,7
+136,7
@@
void ppc32_emit_dest_register(const ir_node *node, int pos) {
}
void ppc32_emit_rlwimi_helper(const ir_node *n) {
}
void ppc32_emit_rlwimi_helper(const ir_node *n) {
- rlwimi_const_t *rlwimi_const = get_ppc32_rlwimi_const(n);
+
const
rlwimi_const_t *rlwimi_const = get_ppc32_rlwimi_const(n);
be_emit_irprintf("%i, %i, %i", rlwimi_const->shift,
rlwimi_const->maskA, rlwimi_const->maskB);
be_emit_irprintf("%i, %i, %i", rlwimi_const->shift,
rlwimi_const->maskA, rlwimi_const->maskB);
@@
-393,7
+388,7
@@
static void emit_ppc32_Switch(const ir_node *irn) {
* Emits code for a backend Copy node
*/
static void emit_be_Copy(const ir_node *irn) {
* Emits code for a backend Copy node
*/
static void emit_be_Copy(const ir_node *irn) {
- const arch_register_class_t *regclass = arch_get_irn_reg_class(
arch_env,
irn, 0);
+ const arch_register_class_t *regclass = arch_get_irn_reg_class(irn, 0);
if (regclass == &ppc32_reg_classes[CLASS_ppc32_gp]) {
be_emit_cstring("\tmr ");
if (regclass == &ppc32_reg_classes[CLASS_ppc32_gp]) {
be_emit_cstring("\tmr ");
@@
-415,7
+410,7
@@
static void emit_be_Copy(const ir_node *irn) {
* Emits code for a backend Perm node
*/
static void emit_be_Perm(const ir_node *irn) {
* Emits code for a backend Perm node
*/
static void emit_be_Perm(const ir_node *irn) {
- const arch_register_class_t *regclass = arch_get_irn_reg_class(
arch_env,
irn, 0);
+ const arch_register_class_t *regclass = arch_get_irn_reg_class(irn, 0);
if (regclass == &ppc32_reg_classes[CLASS_ppc32_gp]) {
be_emit_cstring("\txor ");
if (regclass == &ppc32_reg_classes[CLASS_ppc32_gp]) {
be_emit_cstring("\txor ");
@@
-494,7
+489,7
@@
static void emit_be_Perm(const ir_node *irn) {
static void emit_Proj(const ir_node *irn) {
ir_node *pred = get_Proj_pred(irn);
static void emit_Proj(const ir_node *irn) {
ir_node *pred = get_Proj_pred(irn);
- if (
get_irn_op(pred) == op_Start
) {
+ if (
is_Start(pred)
) {
if (get_Proj_proj(irn) == pn_Start_X_initial_exec) {
emit_Jmp(irn);
}
if (get_Proj_proj(irn) == pn_Start_X_initial_exec) {
emit_Jmp(irn);
}
@@
-539,7
+534,7
@@
typedef void (emit_func)(const ir_node *irn);
/**
* Set a node emitter. Make it a bit more type safe.
*/
/**
* Set a node emitter. Make it a bit more type safe.
*/
-static
INLINE
void set_emitter(ir_op *op, emit_func ppc32_emit_node) {
+static
inline
void set_emitter(ir_op *op, emit_func ppc32_emit_node) {
op->ops.generic = (op_func)ppc32_emit_node;
}
op->ops.generic = (op_func)ppc32_emit_node;
}
@@
-602,7
+597,7
@@
static void ppc32_gen_block(const ir_node *block) {
*/
static void ppc32_emit_start(ir_graph *irg) {
const char *irg_name = get_entity_ld_name(get_irg_entity(irg));
*/
static void ppc32_emit_start(ir_graph *irg) {
const char *irg_name = get_entity_ld_name(get_irg_entity(irg));
- int framesize = get_type_size_bytes(get_irg_frame_type(
cg->
irg));
+ int framesize = get_type_size_bytes(get_irg_frame_type(irg));
if(! strcmp(irg_name, "main")) { // XXX: underscore hack
irg_name = "_main";
if(! strcmp(irg_name, "main")) { // XXX: underscore hack
irg_name = "_main";
@@
-632,7
+627,7
@@
static void ppc32_emit_start(ir_graph *irg) {
* Emits code for function end
*/
static void ppc32_emit_end(ir_graph *irg) {
* Emits code for function end
*/
static void ppc32_emit_end(ir_graph *irg) {
- int framesize = get_type_size_bytes(get_irg_frame_type(
cg->
irg));
+ int framesize = get_type_size_bytes(get_irg_frame_type(irg));
(void) irg;
/* if(!isleaf) {
(void) irg;
/* if(!isleaf) {
@@
-671,14
+666,11
@@
void ppc32_gen_labels(ir_node *block, void *env) {
/**
* Main driver: generates code for one routine
*/
/**
* Main driver: generates code for one routine
*/
-void ppc32_gen_routine(const ppc32_code_gen_t *
ppc32_
cg, ir_graph *irg)
+void ppc32_gen_routine(const ppc32_code_gen_t *cg, ir_graph *irg)
{
ir_node *block;
int i, n;
{
ir_node *block;
int i, n;
- cg = ppc32_cg;
- arch_env = cg->arch_env;
-
ppc32_register_emitters();
ppc32_emit_start(irg);
ppc32_register_emitters();
ppc32_emit_start(irg);