* [Qemu-devel] [PATCH] Fix qemu_ld64 on arm
@ 2009-02-24 8:03 Pablo Virolainen
2009-02-24 8:27 ` Laurent Desnogues
2009-03-10 21:44 ` Aurelien Jarno
0 siblings, 2 replies; 5+ messages in thread
From: Pablo Virolainen @ 2009-02-24 8:03 UTC (permalink / raw)
To: qemu-devel
Emulating fldl on arm doesn't seem to work too well. It's the way
qemu_ld64 is translated to arm instructions.
tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
Consider case where data_reg==0, data_reg2==1, and addr_reg==0. First
load overwrited addr_reg. So let's put an if (data_ref==addr_reg).
Index: tcg-target.c
===================================================================
--- tcg-target.c (revision 6642)
+++ tcg-target.c (working copy)
@@ -1011,8 +1011,14 @@
case 3:
/* TODO: use block load -
* check that data_reg2 > data_reg or the other way */
- tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
- tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
+
+ if (data_reg==addr_reg) {
+ tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
+ tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
+ } else {
+ tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
+ tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
+ }
break;
}
#endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu_ld64 on arm
2009-02-24 8:03 [Qemu-devel] [PATCH] Fix qemu_ld64 on arm Pablo Virolainen
@ 2009-02-24 8:27 ` Laurent Desnogues
2009-02-24 8:44 ` Pablo Virolainen
2009-03-10 21:44 ` Aurelien Jarno
1 sibling, 1 reply; 5+ messages in thread
From: Laurent Desnogues @ 2009-02-24 8:27 UTC (permalink / raw)
To: qemu-devel
On Tue, Feb 24, 2009 at 9:03 AM, Pablo Virolainen
<Pablo.Virolainen@nomovok.com> wrote:
>
> Emulating fldl on arm doesn't seem to work too well. It's the way qemu_ld64
> is translated to arm instructions.
>
> tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
It seems you are using an old version of qemu. Taking a quick
look at current svn, I think your patch is not needed anymore.
Laurent
>
>
> Consider case where data_reg==0, data_reg2==1, and addr_reg==0. First load
> overwrited addr_reg. So let's put an if (data_ref==addr_reg).
>
> Index: tcg-target.c
> ===================================================================
> --- tcg-target.c (revision 6642)
> +++ tcg-target.c (working copy)
> @@ -1011,8 +1011,14 @@
> case 3:
> /* TODO: use block load -
> * check that data_reg2 > data_reg or the other way */
> - tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> - tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
> +
> + if (data_reg==addr_reg) {
> + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
> + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> + } else {
> + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
> + }
> break;
> }
> #endif
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu_ld64 on arm
2009-02-24 8:27 ` Laurent Desnogues
@ 2009-02-24 8:44 ` Pablo Virolainen
2009-02-24 8:57 ` Laurent Desnogues
0 siblings, 1 reply; 5+ messages in thread
From: Pablo Virolainen @ 2009-02-24 8:44 UTC (permalink / raw)
To: qemu-devel
Laurent Desnogues kirjoitti:
> On Tue, Feb 24, 2009 at 9:03 AM, Pablo Virolainen
> <Pablo.Virolainen@nomovok.com> wrote:
>> Emulating fldl on arm doesn't seem to work too well. It's the way qemu_ld64
>> is translated to arm instructions.
>>
>> tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
>> tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
>
> It seems you are using an old version of qemu. Taking a quick
> look at current svn, I think your patch is not needed anymore.
So I should get the source from other source than
svn co svn://svn.savannah.nongnu.org/qemu/trunk ?
Pablo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu_ld64 on arm
2009-02-24 8:44 ` Pablo Virolainen
@ 2009-02-24 8:57 ` Laurent Desnogues
0 siblings, 0 replies; 5+ messages in thread
From: Laurent Desnogues @ 2009-02-24 8:57 UTC (permalink / raw)
To: qemu-devel
On Tue, Feb 24, 2009 at 9:44 AM, Pablo Virolainen
<Pablo.Virolainen@nomovok.com> wrote:
> Laurent Desnogues kirjoitti:
>>
>> On Tue, Feb 24, 2009 at 9:03 AM, Pablo Virolainen
>> <Pablo.Virolainen@nomovok.com> wrote:
>>>
>>> Emulating fldl on arm doesn't seem to work too well. It's the way
>>> qemu_ld64
>>> is translated to arm instructions.
>>>
>>> tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
>>> tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
>>
>> It seems you are using an old version of qemu. Taking a quick
>> look at current svn, I think your patch is not needed anymore.
>
> So I should get the source from other source than
> svn co svn://svn.savannah.nongnu.org/qemu/trunk ?
OK, I am gonna get some more coffee... I mistakenly thought
you were talking about ARM front-end. Sorry for the
confusion.
Your patch looks correct (but bear in mind, that I did not take
more coffee and that I never played with ARM back-end).
Laurent
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu_ld64 on arm
2009-02-24 8:03 [Qemu-devel] [PATCH] Fix qemu_ld64 on arm Pablo Virolainen
2009-02-24 8:27 ` Laurent Desnogues
@ 2009-03-10 21:44 ` Aurelien Jarno
1 sibling, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2009-03-10 21:44 UTC (permalink / raw)
To: qemu-devel
On Tue, Feb 24, 2009 at 10:03:54AM +0200, Pablo Virolainen wrote:
>
> Emulating fldl on arm doesn't seem to work too well. It's the way
> qemu_ld64 is translated to arm instructions.
>
> tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
>
>
> Consider case where data_reg==0, data_reg2==1, and addr_reg==0. First
> load overwrited addr_reg. So let's put an if (data_ref==addr_reg).
Thanks, applied.
> Index: tcg-target.c
> ===================================================================
> --- tcg-target.c (revision 6642)
> +++ tcg-target.c (working copy)
> @@ -1011,8 +1011,14 @@
> case 3:
> /* TODO: use block load -
> * check that data_reg2 > data_reg or the other way */
> - tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> - tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
> +
> + if (data_reg==addr_reg) {
> + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
> + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> + } else {
> + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
> + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
> + }
> break;
> }
> #endif
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-10 21:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24 8:03 [Qemu-devel] [PATCH] Fix qemu_ld64 on arm Pablo Virolainen
2009-02-24 8:27 ` Laurent Desnogues
2009-02-24 8:44 ` Pablo Virolainen
2009-02-24 8:57 ` Laurent Desnogues
2009-03-10 21:44 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).