summaryrefslogtreecommitdiffhomepage
path: root/ir/be/mips
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-03-03 09:13:48 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2019-03-04 20:53:43 +0100
commitc8cf8d509fd41d301541a5e24ad6f19672a7e9af (patch)
treea6364b5334c59bd9d4400130a6bd56bfd8f22e08 /ir/be/mips
parentc47bf936ead28b59953e34fe45b7005e5d778ea7 (diff)
be: Factor out code to emit an unconditional jump in each backend.
Diffstat (limited to 'ir/be/mips')
-rw-r--r--ir/be/mips/mips_emitter.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ir/be/mips/mips_emitter.c b/ir/be/mips/mips_emitter.c
index b590953..9ae0e16 100644
--- a/ir/be/mips/mips_emitter.c
+++ b/ir/be/mips/mips_emitter.c
@@ -134,6 +134,13 @@ static void emit_mips_asm_operand(ir_node const *const node, char const modifier
panic("invalid asm operand kind");
}
+static void emit_jmp(ir_node const *const node, ir_node const *const target)
+{
+ BE_EMIT_JMP(mips, node, "b", target) {
+ mips_emitf(NULL, "nop");
+ }
+}
+
static void emit_be_ASM(const ir_node *node)
{
be_emit_asm(node, &emit_mips_asm_operand);
@@ -176,9 +183,7 @@ static void emit_be_Perm(ir_node const *const node)
static void emit_mips_b(ir_node const *const node)
{
- BE_EMIT_JMP(mips, node, "b", node) {
- mips_emitf(NULL, "nop");
- }
+ emit_jmp(node, node);
}
static void emit_mips_bcc(ir_node const *const node)
@@ -190,9 +195,7 @@ static void emit_mips_bcc(ir_node const *const node)
mips_emitf(node, fmt, mips_negate_cond(cond), projs.f);
} else {
mips_emitf(node, fmt, cond, projs.t);
- BE_EMIT_JMP(mips, node, "b", projs.f) {
- mips_emitf(NULL, "nop");
- }
+ emit_jmp(node, projs.f);
}
}