]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target-unicore32: Use clz opcode
authorRichard Henderson <rth@twiddle.net>
Wed, 16 Nov 2016 10:40:39 +0000 (11:40 +0100)
committerRichard Henderson <rth@twiddle.net>
Tue, 10 Jan 2017 16:06:11 +0000 (08:06 -0800)
Signed-off-by: Richard Henderson <rth@twiddle.net>
target/unicore32/helper.c
target/unicore32/helper.h
target/unicore32/translate.c

index d603bde2379a34f8d348079ef7debb7bf4f430b3..7a5613e776848251a8ed025dffa7d73307d2a7e9 100644 (file)
@@ -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)
index 941813749daa364fcb9e4c25c40a9aaf7dc10083..a4a5d45d1d97a29db5bd7b794ebe6411ae44f00f 100644 (file)
@@ -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)
index 514d460408be587e14ce69959eca9ce48878be6f..666a2016a83753f84a570eacaa5c13967dfd6c57 100644 (file)
@@ -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;
     }