projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a5bf546
)
Factorise code for binary emitters of ia32 fp operation with fp register.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 11 Nov 2012 21:44:03 +0000
(22:44 +0100)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 11 Nov 2012 22:19:06 +0000
(23:19 +0100)
ir/be/ia32/ia32_emitter.c
patch
|
blob
|
history
diff --git
a/ir/be/ia32/ia32_emitter.c
b/ir/be/ia32/ia32_emitter.c
index
c8579bd
..
385611b
100644
(file)
--- a/
ir/be/ia32/ia32_emitter.c
+++ b/
ir/be/ia32/ia32_emitter.c
@@
-3238,6
+3238,12
@@
static void bemit_fbinopp(const ir_node *node, unsigned const code)
bemit8(code + out->index);
}
bemit8(code + out->index);
}
+static void bemit_fop_reg(ir_node const *const node, unsigned char const op0, unsigned char const op1)
+{
+ bemit8(op0);
+ bemit8(op1 + get_ia32_x87_attr_const(node)->x87[0]->index);
+}
+
static void bemit_fabs(const ir_node *node)
{
(void)node;
static void bemit_fabs(const ir_node *node)
{
(void)node;
@@
-3403,23
+3409,17
@@
static void bemit_fmulp(const ir_node *node)
static void bemit_fpop(const ir_node *node)
{
static void bemit_fpop(const ir_node *node)
{
- const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
- bemit8(0xDD);
- bemit8(0xD8 + attr->x87[0]->index);
+ bemit_fop_reg(node, 0xDD, 0xD8);
}
static void bemit_fpush(const ir_node *node)
{
}
static void bemit_fpush(const ir_node *node)
{
- const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
- bemit8(0xD9);
- bemit8(0xC0 + attr->x87[0]->index);
+ bemit_fop_reg(node, 0xD9, 0xC0);
}
static void bemit_fpushcopy(const ir_node *node)
{
}
static void bemit_fpushcopy(const ir_node *node)
{
- const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
- bemit8(0xD9);
- bemit8(0xC0 + attr->x87[0]->index);
+ bemit_fop_reg(node, 0xD9, 0xC0);
}
static void bemit_fst(const ir_node *node)
}
static void bemit_fst(const ir_node *node)
@@
-3545,9
+3545,7
@@
static void bemit_fucomppfnstsw(const ir_node *node)
static void bemit_fxch(const ir_node *node)
{
static void bemit_fxch(const ir_node *node)
{
- const ia32_x87_attr_t *attr = get_ia32_x87_attr_const(node);
- bemit8(0xD9);
- bemit8(0xC8 + attr->x87[0]->index);
+ bemit_fop_reg(node, 0xD9, 0xC8);
}
/**
}
/**