summary refs log tree commit diff stats
path: root/target/hexagon/genptr.c
diff options
context:
space:
mode:
authorTaylor Simpson <tsimpson@quicinc.com>2023-03-06 18:58:16 -0800
committerTaylor Simpson <tsimpson@quicinc.com>2023-03-06 20:47:12 -0800
commit242af2c0b3cc71d5b83fc81770b87d7c23808cd6 (patch)
tree128fa3034fc28d08aaafb775eb50e3c18f42166b /target/hexagon/genptr.c
parent5ef5fdba17126067950d843830efea7c6b2eef12 (diff)
downloadfocaccia-qemu-242af2c0b3cc71d5b83fc81770b87d7c23808cd6.tar.gz
focaccia-qemu-242af2c0b3cc71d5b83fc81770b87d7c23808cd6.zip
Hexagon (target/hexagon) Add overrides for callr
Add overrides for
    J2_callr
    J2_callrt
    J2_callrf

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230307025828.1612809-3-tsimpson@quicinc.com>
Diffstat (limited to 'target/hexagon/genptr.c')
-rw-r--r--target/hexagon/genptr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c
index 2bbe4e3a68..592438f61e 100644
--- a/target/hexagon/genptr.c
+++ b/target/hexagon/genptr.c
@@ -682,6 +682,13 @@ static void gen_call(DisasContext *ctx, int pc_off)
     gen_write_new_pc_pcrel(ctx, pc_off, TCG_COND_ALWAYS, NULL);
 }
 
+static void gen_callr(DisasContext *ctx, TCGv new_pc)
+{
+    TCGv next_PC = tcg_constant_tl(ctx->next_PC);
+    gen_log_reg_write(HEX_REG_LR, next_PC);
+    gen_write_new_pc_addr(ctx, new_pc, TCG_COND_ALWAYS, NULL);
+}
+
 static void gen_cond_call(DisasContext *ctx, TCGv pred,
                           TCGCond cond, int pc_off)
 {
@@ -697,6 +704,17 @@ static void gen_cond_call(DisasContext *ctx, TCGv pred,
     gen_set_label(skip);
 }
 
+static void gen_cond_callr(DisasContext *ctx,
+                           TCGCond cond, TCGv pred, TCGv new_pc)
+{
+    TCGv lsb = tcg_temp_new();
+    TCGLabel *skip = gen_new_label();
+    tcg_gen_andi_tl(lsb, pred, 1);
+    tcg_gen_brcondi_tl(cond, lsb, 0, skip);
+    gen_callr(ctx, new_pc);
+    gen_set_label(skip);
+}
+
 static void gen_endloop0(DisasContext *ctx)
 {
     TCGv lpcfg = tcg_temp_new();