summaryrefslogtreecommitdiffhomepage
path: root/ir/be/riscv
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/riscv
parentc47bf936ead28b59953e34fe45b7005e5d778ea7 (diff)
be: Factor out code to emit an unconditional jump in each backend.
Diffstat (limited to 'ir/be/riscv')
-rw-r--r--ir/be/riscv/riscv_emitter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ir/be/riscv/riscv_emitter.c b/ir/be/riscv/riscv_emitter.c
index ce1a046..3d6fb14 100644
--- a/ir/be/riscv/riscv_emitter.c
+++ b/ir/be/riscv/riscv_emitter.c
@@ -94,6 +94,11 @@ unknown:
}
}
+static void emit_jmp(ir_node const *const node, ir_node const *const target)
+{
+ BE_EMIT_JMP(riscv, node, "j", target) {}
+}
+
static void emit_riscv_asm_operand(ir_node const *const node, char const modifier, unsigned const pos)
{
be_asm_attr_t const *const attr = get_be_asm_attr_const(node);
@@ -200,13 +205,13 @@ static void emit_riscv_bcc(ir_node const *const node)
riscv_emitf(node, fmt, riscv_negate_cond(cond), projs.f);
} else {
riscv_emitf(node, fmt, cond, projs.t);
- BE_EMIT_JMP(riscv, node, "j", projs.f) {}
+ emit_jmp(node, projs.f);
}
}
static void emit_riscv_j(ir_node const *const node)
{
- BE_EMIT_JMP(riscv, node, "j", node) {}
+ emit_jmp(node, node);
}
static void emit_jumptable_target(ir_entity const *const table, ir_node const *const proj_x)