aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-11-16 11:40:39 +0100
committerRichard Henderson <rth@twiddle.net>2017-01-10 08:06:11 -0800
commit03a733dc62de8bcf85bba59ac2776ed3d4adcbf1 (patch)
tree0d360717bb7680fbb005bbb705c3a5c003f51210
parent0efa8208544e3e5984d7089ec751d3fbcfd43156 (diff)
target-unicore32: Use clz opcode
Signed-off-by: Richard Henderson <rth@twiddle.net>
-rw-r--r--target/unicore32/helper.c10
-rw-r--r--target/unicore32/helper.h3
-rw-r--r--target/unicore32/translate.c6
3 files changed, 3 insertions, 16 deletions
diff --git a/target/unicore32/helper.c b/target/unicore32/helper.c
index d603bde237..7a5613e776 100644
--- a/target/unicore32/helper.c
+++ b/target/unicore32/helper.c
@@ -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)
diff --git a/target/unicore32/helper.h b/target/unicore32/helper.h
index 941813749d..a4a5d45d1d 100644
--- a/target/unicore32/helper.h
+++ b/target/unicore32/helper.h
@@ -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)
diff --git a/target/unicore32/translate.c b/target/unicore32/translate.c
index 514d460408..666a2016a8 100644
--- a/target/unicore32/translate.c
+++ b/target/unicore32/translate.c
@@ -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;
}