Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
04580e62
Commit
04580e62
authored
Jan 02, 2016
by
Matthias Braun
Browse files
be: gen_xxx_new_nodes.c.inl -> gen_xxx_new_nodes.c
parent
ca1a30a4
Changes
13
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
04580e62
...
...
@@ -287,7 +287,7 @@ function(add_backend name)
${
GEN_DIR
}
/ir/be/
${
name
}
/gen_
${
name
}
_regalloc_if.c
${
SPEC
}
)
begen
(
generate_new_opcodes.pl
${
GEN_DIR
}
/ir/be/
${
name
}
/gen_
${
name
}
_new_nodes.c
.inl
${
GEN_DIR
}
/ir/be/
${
name
}
/gen_
${
name
}
_new_nodes.c
${
SPEC
}
)
set
(
SOURCES
${
SOURCES
}
PARENT_SCOPE
)
include_directories
(
...
...
Makefile
View file @
04580e62
...
...
@@ -91,13 +91,12 @@ $$(gendir)/ir/be/$(1)/gen_$(1)_regalloc_if.h $$(gendir)/ir/be/$(1)/gen_$(1)_rega
$(1)_GEN_SOURCES
+=
ir/be/
$(1)
/gen_
$(1)
_regalloc_if.c
$(1)_GEN_HEADERS
+=
$
$(gendir)
/ir/be/
$(1)
/gen_
$(1)
_regalloc_if.h
$$(gendir)/ir/be/$(1)/gen_$(1)_new_nodes.h $$(gendir)/ir/be/$(1)/gen_$(1)_new_nodes.c
.inl
:
$$($(1)_SPEC) $$(OPCODES_GENERATOR)
$$(gendir)/ir/be/$(1)/gen_$(1)_new_nodes.h $$(gendir)/ir/be/$(1)/gen_$(1)_new_nodes.c
:
$$($(1)_SPEC) $$(OPCODES_GENERATOR)
@
echo
GEN
$$
@
$(Q)
$
$(OPCODES_GENERATOR)
$$
<
$
$(gendir)
/ir/be/
$(1)
$(1)_GEN_SOURCES
+=
ir/be/
$(1)
/gen_
$(1)
_new_nodes.c
$(1)_GEN_HEADERS
+=
$
$(gendir)
/ir/be/
$(1)
/gen_
$(1)
_new_nodes.h
$$(srcdir)/ir/be/$(1)/$(1)_new_nodes.c
:
$$(gendir)/ir/be/$(1)/gen_$(1)_new_nodes.c.inl
# We need to inform make of the headers it doesn't know yet...
$(1)_OBJECTS
=
$$
(
$(1)
_SOURCES:%.c
=
$
$(builddir)
/%.o
)
$$
(
$(1)
_GEN_SOURCES:%.c
=
$
$(builddir)
/%.o
)
$$($(1)_OBJECTS)
:
$$($(1)_GEN_HEADERS)
...
...
ir/be/TEMPLATE/TEMPLATE_new_nodes.c
View file @
04580e62
...
...
@@ -23,16 +23,10 @@
#include "bedump.h"
#include "TEMPLATE_nodes_attr.h"
#include "TEMPLATE_new_nodes.h"
#include "TEMPLATE_new_nodes
_t
.h"
#include "gen_TEMPLATE_regalloc_if.h"
/**
* Dumper interface for dumping TEMPLATE nodes in vcg.
* @param F the output file
* @param n the node to dump
* @param reason indicates which kind of information should be dumped
*/
static
void
TEMPLATE_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
void
TEMPLATE_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
{
switch
(
reason
)
{
case
dump_node_opcode_txt
:
...
...
@@ -67,20 +61,18 @@ TEMPLATE_attr_t *get_TEMPLATE_attr(ir_node *node)
return
(
TEMPLATE_attr_t
*
)
get_irn_generic_attr
(
node
);
}
static
void
set_TEMPLATE_value
(
ir_node
*
const
node
,
ir_entity
*
const
entity
,
ir_tarval
*
const
value
)
void
set_TEMPLATE_value
(
ir_node
*
const
node
,
ir_entity
*
const
entity
,
ir_tarval
*
const
value
)
{
TEMPLATE_attr_t
*
attr
=
get_TEMPLATE_attr
(
node
);
attr
->
entity
=
entity
;
attr
->
value
=
value
;
}
static
int
TEMPLATE_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
TEMPLATE_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
TEMPLATE_attr_t
*
attr_a
=
get_TEMPLATE_attr_const
(
a
);
const
TEMPLATE_attr_t
*
attr_b
=
get_TEMPLATE_attr_const
(
b
);
return
attr_a
->
value
==
attr_b
->
value
&&
attr_a
->
entity
==
attr_b
->
entity
;
}
/* Include the generated constructor functions */
#include "gen_TEMPLATE_new_nodes.c.inl"
ir/be/TEMPLATE/TEMPLATE_new_nodes_t.h
0 → 100644
View file @
04580e62
/*
* This file is part of libFirm.
* Copyright (C) 2016 Matthias Braun
*/
/**
* @file
* @brief Internal declarations used by gen_new_nodes.c
*/
#ifndef FIRM_BE_TEMPLATE_TEMPLATE_NEW_NODES_T_H
#define FIRM_BE_TEMPLATE_TEMPLATE_NEW_NODES_T_H
#include "TEMPLATE_new_nodes.h"
void
TEMPLATE_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
);
void
set_TEMPLATE_value
(
ir_node
*
const
node
,
ir_entity
*
const
entity
,
ir_tarval
*
const
value
);
int
TEMPLATE_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
#endif
ir/be/amd64/amd64_new_nodes.c
View file @
04580e62
...
...
@@ -25,6 +25,7 @@
#include "amd64_nodes_attr.h"
#include "amd64_new_nodes.h"
#include "amd64_new_nodes_t.h"
#include "bearch_amd64_t.h"
#include "gen_amd64_regalloc_if.h"
...
...
@@ -116,13 +117,7 @@ static const char *get_insn_mode_string(amd64_insn_mode_t mode)
return
"invalid insn_mode"
;
}
/**
* Dumper interface for dumping amd64 nodes in vcg.
* @param F the output file
* @param n the node to dump
* @param reason indicates which kind of information should be dumped
*/
static
void
amd64_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
void
amd64_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
{
switch
(
reason
)
{
case
dump_node_opcode_txt
:
...
...
@@ -175,18 +170,17 @@ static void amd64_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
}
}
static
void
init_amd64_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
,
amd64_op_mode_t
op_mode
)
void
init_amd64_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
,
amd64_op_mode_t
op_mode
)
{
be_info_init_irn
(
node
,
flags
,
in_reqs
,
n_res
);
amd64_attr_t
*
attr
=
get_amd64_attr
(
node
);
attr
->
op_mode
=
op_mode
;
}
static
void
init_amd64_switch_attributes
(
ir_node
*
node
,
const
ir_switch_table
*
table
,
ir_entity
*
table_entity
)
void
init_amd64_switch_attributes
(
ir_node
*
node
,
const
ir_switch_table
*
table
,
ir_entity
*
table_entity
)
{
amd64_switch_jmp_attr_t
*
attr
=
get_amd64_switch_jmp_attr
(
node
);
attr
->
table
=
table
;
...
...
@@ -197,18 +191,16 @@ static void init_amd64_switch_attributes(ir_node *node,
}
}
static
void
init_amd64_cc_attributes
(
ir_node
*
node
,
x86_condition_code_t
cc
,
amd64_insn_mode_t
insn_mode
)
void
init_amd64_cc_attributes
(
ir_node
*
node
,
x86_condition_code_t
cc
,
amd64_insn_mode_t
insn_mode
)
{
amd64_cc_attr_t
*
attr
=
get_amd64_cc_attr
(
node
);
attr
->
cc
=
cc
;
attr
->
insn_mode
=
insn_mode
;
}
static
void
init_amd64_movimm_attributes
(
ir_node
*
node
,
amd64_insn_mode_t
insn_mode
,
const
amd64_imm64_t
*
imm
)
void
init_amd64_movimm_attributes
(
ir_node
*
node
,
amd64_insn_mode_t
insn_mode
,
const
amd64_imm64_t
*
imm
)
{
amd64_movimm_attr_t
*
attr
=
get_amd64_movimm_attr
(
node
);
attr
->
insn_mode
=
insn_mode
;
...
...
@@ -231,14 +223,14 @@ static bool amd64_addrs_equal(const amd64_addr_t *const am0,
&&
am0
->
segment
==
am1
->
segment
;
}
static
int
amd64_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
amd64_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
amd64_attr_t
*
attr_a
=
get_amd64_attr_const
(
a
);
const
amd64_attr_t
*
attr_b
=
get_amd64_attr_const
(
b
);
return
attr_a
->
op_mode
==
attr_b
->
op_mode
;
}
static
int
amd64_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
amd64_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
amd64_addr_attr_t
*
attr_a
=
get_amd64_addr_attr_const
(
a
);
const
amd64_addr_attr_t
*
attr_b
=
get_amd64_addr_attr_const
(
b
);
...
...
@@ -247,8 +239,7 @@ static int amd64_addr_attrs_equal(const ir_node *a, const ir_node *b)
&&
attr_a
->
insn_mode
==
attr_b
->
insn_mode
;
}
static
int
amd64_binop_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
amd64_binop_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
amd64_binop_addr_attr_t
*
attr_a
=
get_amd64_binop_addr_attr_const
(
a
);
const
amd64_binop_addr_attr_t
*
attr_b
=
get_amd64_binop_addr_attr_const
(
b
);
...
...
@@ -262,8 +253,7 @@ static int amd64_binop_addr_attrs_equal(const ir_node *a,
}
}
static
int
amd64_movimm_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_movimm_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
const
amd64_movimm_attr_t
*
const
attr_a
=
get_amd64_movimm_attr_const
(
a
);
const
amd64_movimm_attr_t
*
const
attr_b
=
get_amd64_movimm_attr_const
(
b
);
...
...
@@ -272,8 +262,7 @@ static int amd64_movimm_attrs_equal(const ir_node *const a,
&&
attr_a
->
insn_mode
==
attr_b
->
insn_mode
;
}
static
int
amd64_shift_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_shift_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
const
amd64_shift_attr_t
*
const
attr_a
=
get_amd64_shift_attr_const
(
a
);
const
amd64_shift_attr_t
*
const
attr_b
=
get_amd64_shift_attr_const
(
b
);
...
...
@@ -282,16 +271,14 @@ static int amd64_shift_attrs_equal(const ir_node *const a,
&&
attr_a
->
insn_mode
==
attr_b
->
insn_mode
;
}
static
int
amd64_cc_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_cc_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
const
amd64_cc_attr_t
*
const
attr_a
=
get_amd64_cc_attr_const
(
a
);
const
amd64_cc_attr_t
*
const
attr_b
=
get_amd64_cc_attr_const
(
b
);
return
amd64_attrs_equal
(
a
,
b
)
&&
attr_a
->
cc
==
attr_b
->
cc
;
}
static
int
amd64_switch_jmp_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_switch_jmp_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
const
amd64_switch_jmp_attr_t
*
const
attr_a
=
get_amd64_switch_jmp_attr_const
(
a
);
...
...
@@ -300,8 +287,7 @@ static int amd64_switch_jmp_attrs_equal(const ir_node *const a,
return
amd64_attrs_equal
(
a
,
b
)
&&
attr_a
->
table
==
attr_b
->
table
;
}
static
int
amd64_call_addr_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_call_addr_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
const
amd64_call_addr_attr_t
*
const
attr_a
=
get_amd64_call_addr_attr_const
(
a
);
...
...
@@ -310,26 +296,21 @@ static int amd64_call_addr_attrs_equal(const ir_node *const a,
return
amd64_addr_attrs_equal
(
a
,
b
)
&&
attr_a
->
call_tp
==
attr_b
->
call_tp
;
}
static
int
amd64_x87_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_x87_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
/* we ignore x87 attributes for now */
return
amd64_attrs_equal
(
a
,
b
);
}
static
int
amd64_x87_addr_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_x87_addr_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
/* ignore x87 part for now */
return
amd64_addr_attrs_equal
(
a
,
b
);
}
static
int
amd64_x87_binop_addr_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
int
amd64_x87_binop_addr_attrs_equal
(
const
ir_node
*
const
a
,
const
ir_node
*
const
b
)
{
/* ignore x87 part for now */
return
amd64_binop_addr_attrs_equal
(
a
,
b
);
}
/* Include the generated constructor functions */
#include "gen_amd64_new_nodes.c.inl"
ir/be/amd64/amd64_new_nodes_t.h
0 → 100644
View file @
04580e62
/*
* This file is part of libFirm.
* Copyright (C) 2016 Matthias Braun
*/
/**
* @file
* @brief Internal declarations used by gen_new_nodes.c
*/
#ifndef FIRM_BE_AMD64_AMD64_NEW_NODES_T_H
#define FIRM_BE_AMD64_AMD64_NEW_NODES_T_H
void
amd64_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
);
void
init_amd64_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
,
amd64_op_mode_t
op_mode
);
void
init_amd64_switch_attributes
(
ir_node
*
node
,
const
ir_switch_table
*
table
,
ir_entity
*
table_entity
);
void
init_amd64_cc_attributes
(
ir_node
*
node
,
x86_condition_code_t
cc
,
amd64_insn_mode_t
insn_mode
);
void
init_amd64_movimm_attributes
(
ir_node
*
node
,
amd64_insn_mode_t
insn_mode
,
const
amd64_imm64_t
*
imm
);
int
amd64_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_binop_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_movimm_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_shift_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_cc_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_switch_jmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_call_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_x87_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_x87_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
amd64_x87_binop_addr_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
#endif
ir/be/arm/arm_new_nodes.c
View file @
04580e62
...
...
@@ -23,7 +23,7 @@
#include "irprintf.h"
#include "xmalloc.h"
#include "arm_new_nodes.h"
#include "arm_new_nodes
_t
.h"
#include "arm_nodes_attr.h"
#include "arm_optimize.h"
#include "bearch_arm_t.h"
...
...
@@ -60,13 +60,7 @@ static bool has_farith_attr(const ir_node *node)
||
is_arm_Dvf
(
node
)
||
is_arm_Mvf
(
node
)
||
is_arm_FltX
(
node
);
}
/**
* Dumper interface for dumping arm nodes in vcg.
* @param F the output file
* @param n the node to dump
* @param reason indicates which kind of information should be dumped
*/
static
void
arm_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
void
arm_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
{
switch
(
reason
)
{
case
dump_node_opcode_txt
:
...
...
@@ -270,19 +264,18 @@ void set_arm_CondJmp_relation(ir_node *node, ir_relation relation)
}
/* Set the ARM machine node attributes to default values. */
static
void
init_arm_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
)
void
init_arm_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
)
{
be_info_init_irn
(
node
,
flags
,
in_reqs
,
n_res
);
arm_attr_t
*
const
attr
=
get_arm_attr
(
node
);
attr
->
is_load_store
=
false
;
}
static
void
init_arm_load_store_attributes
(
ir_node
*
res
,
ir_mode
*
ls_mode
,
ir_entity
*
entity
,
int
entity_sign
,
long
offset
,
bool
is_frame_entity
)
void
init_arm_load_store_attributes
(
ir_node
*
res
,
ir_mode
*
ls_mode
,
ir_entity
*
entity
,
int
entity_sign
,
long
offset
,
bool
is_frame_entity
)
{
arm_load_store_attr_t
*
attr
=
get_arm_load_store_attr
(
res
);
attr
->
load_store_mode
=
ls_mode
;
...
...
@@ -293,10 +286,10 @@ static void init_arm_load_store_attributes(ir_node *res, ir_mode *ls_mode,
attr
->
base
.
is_load_store
=
true
;
}
static
void
init_arm_shifter_operand
(
ir_node
*
res
,
unsigned
shifter_op_input
,
unsigned
immediate_value
,
arm_shift_modifier_t
shift_modifier
,
unsigned
shift_immediate
)
void
init_arm_shifter_operand
(
ir_node
*
res
,
unsigned
shifter_op_input
,
unsigned
immediate_value
,
arm_shift_modifier_t
shift_modifier
,
unsigned
shift_immediate
)
{
arm_shifter_operand_t
*
attr
=
get_arm_shifter_operand_attr
(
res
);
attr
->
immediate_value
=
immediate_value
;
...
...
@@ -305,28 +298,27 @@ static void init_arm_shifter_operand(ir_node *res, unsigned shifter_op_input,
attr
->
shift_immediate
=
shift_immediate
;
}
static
void
init_arm_cmp_attr
(
ir_node
*
res
,
bool
ins_permuted
,
bool
is_unsigned
)
void
init_arm_cmp_attr
(
ir_node
*
res
,
bool
ins_permuted
,
bool
is_unsigned
)
{
arm_cmp_attr_t
*
attr
=
get_arm_cmp_attr
(
res
);
attr
->
ins_permuted
=
ins_permuted
;
attr
->
is_unsigned
=
is_unsigned
;
}
static
void
init_arm_Address_attributes
(
ir_node
*
res
,
ir_entity
*
entity
,
int
offset
)
void
init_arm_Address_attributes
(
ir_node
*
res
,
ir_entity
*
entity
,
int
offset
)
{
arm_Address_attr_t
*
attr
=
get_arm_Address_attr
(
res
);
attr
->
entity
=
entity
;
attr
->
fp_offset
=
offset
;
}
static
void
init_arm_farith_attributes
(
ir_node
*
res
,
ir_mode
*
mode
)
void
init_arm_farith_attributes
(
ir_node
*
res
,
ir_mode
*
mode
)
{
arm_farith_attr_t
*
attr
=
get_arm_farith_attr
(
res
);
attr
->
mode
=
mode
;
}
static
void
init_arm_SwitchJmp_attributes
(
ir_node
*
res
,
const
ir_switch_table
*
table
)
void
init_arm_SwitchJmp_attributes
(
ir_node
*
res
,
const
ir_switch_table
*
table
)
{
arm_SwitchJmp_attr_t
*
attr
=
get_arm_SwitchJmp_attr
(
res
);
attr
->
table
=
table
;
...
...
@@ -336,14 +328,14 @@ static void init_arm_SwitchJmp_attributes(ir_node *res,
}
}
static
int
arm_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
(
void
)
a
;
(
void
)
b
;
return
true
;
}
static
int
arm_Address_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_Address_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_Address_attr_t
*
attr_a
=
get_arm_Address_attr_const
(
a
);
const
arm_Address_attr_t
*
attr_b
=
get_arm_Address_attr_const
(
b
);
...
...
@@ -352,28 +344,27 @@ static int arm_Address_attrs_equal(const ir_node *a, const ir_node *b)
&&
attr_a
->
fp_offset
==
attr_b
->
fp_offset
;
}
static
int
arm_CondJmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_CondJmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_CondJmp_attr_t
*
attr_a
=
get_arm_CondJmp_attr_const
(
a
);
const
arm_CondJmp_attr_t
*
attr_b
=
get_arm_CondJmp_attr_const
(
b
);
return
arm_attrs_equal
(
a
,
b
)
&&
attr_a
->
relation
==
attr_b
->
relation
;
}
static
int
arm_SwitchJmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_SwitchJmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_SwitchJmp_attr_t
*
attr_a
=
get_arm_SwitchJmp_attr_const
(
a
);
const
arm_SwitchJmp_attr_t
*
attr_b
=
get_arm_SwitchJmp_attr_const
(
b
);
return
arm_attrs_equal
(
a
,
b
)
&&
attr_a
->
table
==
attr_b
->
table
;
}
static
int
arm_fConst_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_fConst_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_fConst_attr_t
*
attr_a
=
get_arm_fConst_attr_const
(
a
);
const
arm_fConst_attr_t
*
attr_b
=
get_arm_fConst_attr_const
(
b
);
return
arm_attrs_equal
(
a
,
b
)
&&
attr_a
->
tv
==
attr_b
->
tv
;
}
arm_load_store_attr_t
*
get_arm_load_store_attr
(
ir_node
*
node
)
{
return
(
arm_load_store_attr_t
*
)
get_irn_generic_attr
(
node
);
...
...
@@ -405,7 +396,7 @@ const arm_cmp_attr_t *get_arm_cmp_attr_const(const ir_node *node)
return
(
const
arm_cmp_attr_t
*
)
get_irn_generic_attr_const
(
node
);
}
static
int
arm_load_store_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_load_store_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_load_store_attr_t
*
attr_a
=
get_arm_load_store_attr_const
(
a
);
const
arm_load_store_attr_t
*
attr_b
=
get_arm_load_store_attr_const
(
b
);
...
...
@@ -415,7 +406,7 @@ static int arm_load_store_attrs_equal(const ir_node *a, const ir_node *b)
&&
attr_a
->
offset
==
attr_b
->
offset
;
}
static
int
arm_shifter_operands_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_shifter_operands_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_shifter_operand_t
*
attr_a
=
get_arm_shifter_operand_attr_const
(
a
);
const
arm_shifter_operand_t
*
attr_b
=
get_arm_shifter_operand_attr_const
(
b
);
...
...
@@ -425,7 +416,7 @@ static int arm_shifter_operands_equal(const ir_node *a, const ir_node *b)
&&
attr_a
->
shift_immediate
==
attr_b
->
shift_immediate
;
}
static
int
arm_cmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_cmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_cmp_attr_t
*
attr_a
=
get_arm_cmp_attr_const
(
a
);
const
arm_cmp_attr_t
*
attr_b
=
get_arm_cmp_attr_const
(
b
);
...
...
@@ -434,12 +425,9 @@ static int arm_cmp_attrs_equal(const ir_node *a, const ir_node *b)
&&
attr_a
->
is_unsigned
==
attr_b
->
is_unsigned
;
}
static
int
arm_farith_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
int
arm_farith_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_farith_attr_t
*
attr_a
=
get_arm_farith_attr_const
(
a
);
const
arm_farith_attr_t
*
attr_b
=
get_arm_farith_attr_const
(
b
);
return
arm_attrs_equal
(
a
,
b
)
&&
attr_a
->
mode
==
attr_b
->
mode
;
}
/* Include the generated constructor functions */
#include "gen_arm_new_nodes.c.inl"
ir/be/arm/arm_new_nodes_t.h
0 → 100644
View file @
04580e62
/*
* This file is part of libFirm.
* Copyright (C) 2016 Matthias Braun
*/
/**
* @file
* @brief Internal declarations used by gen_new_nodes.c
*/
#ifndef FIRM_BE_ARM_ARM_NEW_NODES_T_H
#define FIRM_BE_ARM_ARM_NEW_NODES_T_H
#include "arm_new_nodes.h"
void
init_arm_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
);
void
init_arm_load_store_attributes
(
ir_node
*
res
,
ir_mode
*
ls_mode
,
ir_entity
*
entity
,
int
entity_sign
,
long
offset
,
bool
is_frame_entity
);
void
init_arm_shifter_operand
(
ir_node
*
res
,
unsigned
shifter_op_input
,
unsigned
immediate_value
,
arm_shift_modifier_t
shift_modifier
,
unsigned
shift_immediate
);
void
init_arm_cmp_attr
(
ir_node
*
res
,
bool
ins_permuted
,
bool
is_unsigned
);
void
init_arm_Address_attributes
(
ir_node
*
res
,
ir_entity
*
entity
,
int
offset
);
void
init_arm_farith_attributes
(
ir_node
*
res
,
ir_mode
*
mode
);
void
init_arm_SwitchJmp_attributes
(
ir_node
*
res
,
const
ir_switch_table
*
table
);
int
arm_Address_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_CondJmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_SwitchJmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_cmp_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_fConst_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_farith_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_load_store_attrs_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
int
arm_shifter_operands_equal
(
const
ir_node
*
a
,
const
ir_node
*
b
);
void
arm_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
);
#endif
ir/be/ia32/ia32_new_nodes.c
View file @
04580e62
...
...
@@ -34,7 +34,7 @@
#include "bearch_ia32_t.h"
#include "ia32_nodes_attr.h"
#include "ia32_new_nodes.h"
#include "ia32_new_nodes
_t
.h"
#include "gen_ia32_regalloc_if.h"
#include "x86_x87.h"
...
...
@@ -121,7 +121,8 @@ static char const *get_frame_use_str(ir_node const *const node)
}
#endif
static
void
ia32_dump_immediate
(
FILE
*
const
F
,
ir_entity
*
const
entity
,
int32_t
const
offset
)
static
void
ia32_dump_immediate
(
FILE
*
const
F
,
ir_entity
*
const
entity
,
int32_t
const
offset
)
{
if
(
entity
)
{
fputs
(
get_entity_name
(
entity
),
F
);
...
...
@@ -132,14 +133,7 @@ static void ia32_dump_immediate(FILE *const F, ir_entity *const entity, int32_t
}
}
/**
* Dumper interface for dumping ia32 nodes in vcg.
* @param n the node to dump
* @param F the output file
* @param reason indicates which kind of information should be dumped
* @return 0 on success or != 0 on failure
*/
static
void
ia32_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
void
ia32_dump_node
(
FILE
*
F
,
const
ir_node
*
n
,
dump_reason_t
reason
)
{
ir_mode
*
mode
=
NULL
;
...
...
@@ -643,9 +637,8 @@ void ia32_swap_left_right(ir_node *node)
set_irn_n
(
node
,
n_ia32_binary_right
,
left
);
}
static
void
init_ia32_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
)
void
init_ia32_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
arch_register_req_t
**
in_reqs
,
int
n_res
)
{
be_info_init_irn
(
node
,
flags
,
in_reqs
,
n_res
);
...
...
@@ -655,7 +648,7 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
#endif
}
static
void
init_ia32_x87_attributes
(
ir_node
*
res
)
void
init_ia32_x87_attributes
(
ir_node
*
res
)
{
#ifndef NDEBUG
ia32_attr_t
*
attr
=
get_ia32_attr
(
res
);
...
...
@@ -665,8 +658,7 @@ static void init_ia32_x87_attributes(ir_node *res)
ia32_request_x87_sim
(
irg
);
}
static
void
init_ia32_immediate_attributes
(
ir_node
*
res
,
x86_imm32_t
const
*
const
imm
)
void
init_ia32_immediate_attributes
(
ir_node
*
res
,
x86_imm32_t
const
*
const
imm
)
{
ia32_immediate_attr_t
*
attr
=
(
ia32_immediate_attr_t
*
)
get_irn_generic_attr
(
res
);
...
...
@@ -676,8 +668,7 @@ static void init_ia32_immediate_attributes(ir_node *res,
attr
->
imm
=
*
imm
;
}
static
void
init_ia32_call_attributes
(
ir_node
*
res
,
unsigned
pop
,
ir_type
*
call_tp
)
void
init_ia32_call_attributes
(
ir_node
*
res
,
unsigned
pop
,
ir_type
*
call_tp
)
{
ia32_call_attr_t
*
attr
=
(
ia32_call_attr_t
*
)
get_irn_generic_attr
(
res
);
...
...
@@ -688,7 +679,7 @@ static void init_ia32_call_attributes(ir_node* res, unsigned pop,
attr
->
call_tp
=
call_tp
;
}