Skip to content

Commit 2f36d6a

Browse files
author
Lucas Coutinho
committed
target/ppc: Move slbfee to decodetree
1 parent dcfbf3a commit 2f36d6a

File tree

5 files changed

+38
-28
lines changed

5 files changed

+38
-28
lines changed

target/ppc/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ DEF_HELPER_FLAGS_4(tlbie_isa300, TCG_CALL_NO_WG, void, \
685685
DEF_HELPER_FLAGS_3(SLBMTE, TCG_CALL_NO_RWG, void, env, tl, tl)
686686
DEF_HELPER_2(SLBMFEE, tl, env, tl)
687687
DEF_HELPER_2(SLBMFEV, tl, env, tl)
688-
DEF_HELPER_2(find_slb_vsid, tl, env, tl)
688+
DEF_HELPER_2(SLBFEE, tl, env, tl)
689689
DEF_HELPER_FLAGS_2(SLBIA, TCG_CALL_NO_RWG, void, env, i32)
690690
DEF_HELPER_FLAGS_3(SLBIAG, TCG_CALL_NO_RWG, void, env, tl, i32)
691691
DEF_HELPER_FLAGS_2(SLBIE, TCG_CALL_NO_RWG, void, env, tl)

target/ppc/insn32.decode

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ SLBMTE 011111 ..... ----- ..... 0110010010 - @X_tb
767767
SLBMFEV 011111 ..... ----- ..... 1101010011 - @X_tb
768768
SLBMFEE 011111 ..... ----- ..... 1110010011 - @X_tb
769769

770+
SLBFEE 011111 ..... ----- ..... 1111010011 1 @X_tb
771+
770772
## TLB Management Instructions
771773

772774
&X_tlbie rb rs ric prs:bool r:bool

target/ppc/mmu-hash64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ target_ulong helper_SLBMFEE(CPUPPCState *env, target_ulong rb)
358358
return rt;
359359
}
360360

361-
target_ulong helper_find_slb_vsid(CPUPPCState *env, target_ulong rb)
361+
target_ulong helper_SLBFEE(CPUPPCState *env, target_ulong rb)
362362
{
363363
PowerPCCPU *cpu = env_archcpu(env);
364364
target_ulong rt = 0;

target/ppc/translate.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5351,31 +5351,6 @@ static void gen_mtsrin_64b(DisasContext *ctx)
53515351
#endif /* defined(CONFIG_USER_ONLY) */
53525352
}
53535353

5354-
5355-
static void gen_slbfee_(DisasContext *ctx)
5356-
{
5357-
#if defined(CONFIG_USER_ONLY)
5358-
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
5359-
#else
5360-
TCGLabel *l1, *l2;
5361-
5362-
if (unlikely(ctx->pr)) {
5363-
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
5364-
return;
5365-
}
5366-
gen_helper_find_slb_vsid(cpu_gpr[rS(ctx->opcode)], cpu_env,
5367-
cpu_gpr[rB(ctx->opcode)]);
5368-
l1 = gen_new_label();
5369-
l2 = gen_new_label();
5370-
tcg_gen_trunc_tl_i32(cpu_crf[0], cpu_so);
5371-
tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[rS(ctx->opcode)], -1, l1);
5372-
tcg_gen_ori_i32(cpu_crf[0], cpu_crf[0], CRF_EQ);
5373-
tcg_gen_br(l2);
5374-
gen_set_label(l1);
5375-
tcg_gen_movi_tl(cpu_gpr[rS(ctx->opcode)], 0);
5376-
gen_set_label(l2);
5377-
#endif
5378-
}
53795354
#endif /* defined(TARGET_PPC64) */
53805355

53815356
/*** Lookaside buffer management ***/
@@ -6821,7 +6796,6 @@ GEN_HANDLER2(mfsrin_64b, "mfsrin", 0x1F, 0x13, 0x14, 0x001F0001,
68216796
GEN_HANDLER2(mtsr_64b, "mtsr", 0x1F, 0x12, 0x06, 0x0010F801, PPC_SEGMENT_64B),
68226797
GEN_HANDLER2(mtsrin_64b, "mtsrin", 0x1F, 0x12, 0x07, 0x001F0001,
68236798
PPC_SEGMENT_64B),
6824-
GEN_HANDLER2(slbfee_, "slbfee.", 0x1F, 0x13, 0x1E, 0x001F0000, PPC_SEGMENT_64B),
68256799
#endif
68266800
GEN_HANDLER(tlbia, 0x1F, 0x12, 0x0B, 0x03FFFC01, PPC_MEM_TLBIA),
68276801
/*

target/ppc/translate/storage-ctrl-impl.c.inc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,40 @@ static bool trans_SLBMFEE(DisasContext *ctx, arg_SLBMFEE *a)
120120
return true;
121121
}
122122

123+
static bool trans_SLBFEE(DisasContext *ctx, arg_SLBFEE *a)
124+
{
125+
REQUIRE_64BIT(ctx);
126+
REQUIRE_INSNS_FLAGS(ctx, SEGMENT_64B);
127+
128+
#if defined(CONFIG_USER_ONLY)
129+
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
130+
#else
131+
132+
#if defined(TARGET_PPC64)
133+
TCGLabel *l1, *l2;
134+
135+
if (unlikely(ctx->pr)) {
136+
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
137+
return true;
138+
}
139+
gen_helper_SLBFEE(cpu_gpr[a->rt], cpu_env,
140+
cpu_gpr[a->rb]);
141+
l1 = gen_new_label();
142+
l2 = gen_new_label();
143+
tcg_gen_trunc_tl_i32(cpu_crf[0], cpu_so);
144+
tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[a->rt], -1, l1);
145+
tcg_gen_ori_i32(cpu_crf[0], cpu_crf[0], CRF_EQ);
146+
tcg_gen_br(l2);
147+
gen_set_label(l1);
148+
tcg_gen_movi_tl(cpu_gpr[a->rt], 0);
149+
gen_set_label(l2);
150+
#else
151+
qemu_build_not_reached();
152+
#endif
153+
#endif
154+
return true;
155+
}
156+
123157
static bool do_tlbie(DisasContext *ctx, arg_X_tlbie *a, bool local)
124158
{
125159
#if defined(CONFIG_USER_ONLY)

0 commit comments

Comments
 (0)