From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [5120] SH4: Convert remaining non-fp ops to TCG
Date: Mon, 01 Sep 2008 17:25:23 +0200 [thread overview]
Message-ID: <48BC0963.2010802@aurel32.net> (raw)
In-Reply-To: <f43fc5580809010734nfd8be3fq76f0c0053d08db33@mail.gmail.com>
Blue Swirl a écrit :
> On 9/1/08, Aurelien Jarno <aurelien@aurel32.net> wrote:
>> -void OPPROTO op_cmp_str_T0_T1(void)
>> -{
>> - cond_t((T0 & 0x000000ff) == (T1 & 0x000000ff) ||
>> - (T0 & 0x0000ff00) == (T1 & 0x0000ff00) ||
>> - (T0 & 0x00ff0000) == (T1 & 0x00ff0000) ||
>> - (T0 & 0xff000000) == (T1 & 0xff000000));
>> - RETURN();
>> -}
>
> The above version uses both T0 and T1, but the version below only cpu_T[0].
Yes, I have found my mistake when doing the cpu_T[] removal pass (r5122)
and noted that I have to fix that in this patch, but then I forget and
committed the patch as is.
Anyway the implementation in r5122 is correct.
>> + int label1 = gen_new_label();
>> + int label2 = gen_new_label();
>> + tcg_gen_xor_i32(cpu_T[0], cpu_gregs[REG(B7_4)], cpu_gregs[REG(B11_8)]);
>> + tcg_gen_andi_i32(cpu_T[0], cpu_T[0], 0xff000000);
>> + tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_T[0], 0, label1);
>> + tcg_gen_andi_i32(cpu_T[0], cpu_T[0], 0x00ff0000);
>> + tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_T[0], 0, label1);
>> + tcg_gen_andi_i32(cpu_T[0], cpu_T[0], 0x0000ff00);
>> + tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_T[0], 0, label1);
>> + tcg_gen_andi_i32(cpu_T[0], cpu_T[0], 0x000000ff);
>> + tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_T[0], 0, label1);
>> + tcg_gen_andi_i32(cpu_sr, cpu_sr, ~SR_T);
>> + tcg_gen_br(label2);
>> + gen_set_label(label1);
>> + tcg_gen_ori_i32(cpu_sr, cpu_sr, SR_T);
>> + gen_set_label(label2);
>
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
prev parent reply other threads:[~2008-09-01 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 13:09 [Qemu-devel] [5120] SH4: Convert remaining non-fp ops to TCG Aurelien Jarno
2008-09-01 14:34 ` Blue Swirl
2008-09-01 15:25 ` Aurelien Jarno [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48BC0963.2010802@aurel32.net \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.