diff options
author | Richard Henderson <rth@twiddle.net> | 2016-11-16 11:17:45 +0100 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-01-10 08:06:11 -0800 |
commit | 555baef8d0369fea9d0849ef420841665639c209 (patch) | |
tree | efa17e16c2b3e06eb84b4cb68f9fa277ee8f9181 /target/openrisc/translate.c | |
parent | 1a0196c5c7f197fad7b079074d587b3204bcfb0f (diff) | |
download | qemu-555baef8d0369fea9d0849ef420841665639c209.zip qemu-555baef8d0369fea9d0849ef420841665639c209.tar.gz qemu-555baef8d0369fea9d0849ef420841665639c209.tar.bz2 |
target-openrisc: Use clz and ctz opcodes
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/openrisc/translate.c')
-rw-r--r-- | target/openrisc/translate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 229361a..03fa7db 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -602,11 +602,13 @@ static void dec_calc(DisasContext *dc, uint32_t insn) switch (op1) { case 0x00: /* l.ff1 */ LOG_DIS("l.ff1 r%d, r%d, r%d\n", rd, ra, rb); - gen_helper_ff1(cpu_R[rd], cpu_R[ra]); + tcg_gen_ctzi_tl(cpu_R[rd], cpu_R[ra], -1); + tcg_gen_addi_tl(cpu_R[rd], cpu_R[rd], 1); break; case 0x01: /* l.fl1 */ LOG_DIS("l.fl1 r%d, r%d, r%d\n", rd, ra, rb); - gen_helper_fl1(cpu_R[rd], cpu_R[ra]); + tcg_gen_clzi_tl(cpu_R[rd], cpu_R[ra], TARGET_LONG_BITS); + tcg_gen_subfi_tl(cpu_R[rd], TARGET_LONG_BITS, cpu_R[rd]); break; default: |