mirror of https://github.com/xemu-project/xemu.git
target-ppc: add setb instruction
The CR number is provided in the opcode as - BFA (11:13) Returns: -1 if bit 0 of CR field is set 1 if bit 1 of CR field is set 0 otherwise. Signed-off-by: Vivek Andrew Sha <vivekandrewsha@gmail.com> [ reworded commit, used 32bit ops as crf is 32bits ] Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
082ce33005
commit
dc2ee038da
|
@ -4867,6 +4867,27 @@ static void gen_mtspr(DisasContext *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(TARGET_PPC64)
|
||||
/* setb */
|
||||
static void gen_setb(DisasContext *ctx)
|
||||
{
|
||||
TCGv_i32 t0 = tcg_temp_new_i32();
|
||||
TCGv_i32 t8 = tcg_temp_new_i32();
|
||||
TCGv_i32 tm1 = tcg_temp_new_i32();
|
||||
int crf = crfS(ctx->opcode);
|
||||
|
||||
tcg_gen_setcondi_i32(TCG_COND_GEU, t0, cpu_crf[crf], 4);
|
||||
tcg_gen_movi_i32(t8, 8);
|
||||
tcg_gen_movi_i32(tm1, -1);
|
||||
tcg_gen_movcond_i32(TCG_COND_GEU, t0, cpu_crf[crf], t8, tm1, t0);
|
||||
tcg_gen_ext_i32_tl(cpu_gpr[rD(ctx->opcode)], t0);
|
||||
|
||||
tcg_temp_free_i32(t0);
|
||||
tcg_temp_free_i32(t8);
|
||||
tcg_temp_free_i32(tm1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*** Cache management ***/
|
||||
|
||||
/* dcbf */
|
||||
|
@ -10185,6 +10206,7 @@ GEN_HANDLER(mftb, 0x1F, 0x13, 0x0B, 0x00000001, PPC_MFTB),
|
|||
GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00000801, PPC_MISC),
|
||||
#if defined(TARGET_PPC64)
|
||||
GEN_HANDLER(mtmsrd, 0x1F, 0x12, 0x05, 0x001EF801, PPC_64B),
|
||||
GEN_HANDLER_E(setb, 0x1F, 0x00, 0x04, 0x0003F801, PPC_NONE, PPC2_ISA300),
|
||||
#endif
|
||||
GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x001EF801, PPC_MISC),
|
||||
GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x00000000, PPC_MISC),
|
||||
|
|
Loading…
Reference in New Issue