Skip to content

Commit

Permalink
target-unicore32: Use clz opcode
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
rth7680 committed Jan 10, 2017
1 parent 0efa820 commit 03a733d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
10 changes: 0 additions & 10 deletions target/unicore32/helper.c
Expand Up @@ -32,16 +32,6 @@ UniCore32CPU *uc32_cpu_init(const char *cpu_model)
return UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model));
}

uint32_t HELPER(clo)(uint32_t x)
{
return clo32(x);
}

uint32_t HELPER(clz)(uint32_t x)
{
return clz32(x);
}

#ifndef CONFIG_USER_ONLY
void helper_cp0_set(CPUUniCore32State *env, uint32_t val, uint32_t creg,
uint32_t cop)
Expand Down
3 changes: 0 additions & 3 deletions target/unicore32/helper.h
Expand Up @@ -13,9 +13,6 @@ DEF_HELPER_3(cp0_get, i32, env, i32, i32)
DEF_HELPER_1(cp1_putc, void, i32)
#endif

DEF_HELPER_1(clz, i32, i32)
DEF_HELPER_1(clo, i32, i32)

DEF_HELPER_2(exception, void, env, i32)

DEF_HELPER_3(asr_write, void, env, i32, i32)
Expand Down
6 changes: 3 additions & 3 deletions target/unicore32/translate.c
Expand Up @@ -1479,10 +1479,10 @@ static void do_misc(CPUUniCore32State *env, DisasContext *s, uint32_t insn)
/* clz */
tmp = load_reg(s, UCOP_REG_M);
if (UCOP_SET(26)) {
gen_helper_clo(tmp, tmp);
} else {
gen_helper_clz(tmp, tmp);
/* clo */
tcg_gen_not_i32(tmp, tmp);
}
tcg_gen_clzi_i32(tmp, tmp, 32);
store_reg(s, UCOP_REG_D, tmp);
return;
}
Expand Down

0 comments on commit 03a733d

Please sign in to comment.