qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] regs_to_env() ?
@ 2010-07-22  2:06 Jun Koi
  2010-07-22 22:08 ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Koi @ 2010-07-22  2:06 UTC (permalink / raw)
  To: qemu-devel

Hi,

Function regs_to_env() in target-i386/exec.h has a code like below:

...
#ifdef reg_EAX
env->regs[R_EAX] = EAX
#endif
...

However, elsewhere we have EAX defined as:

#define EAX (env->regs[R_EAX])

This means effectively, we have code like:

env->regs[R_EAX] = env->regs[R_EAX];

What is the meaning of this code? That looks pointless to me, but I
guess I must be wrong here...

Thanks,
Jun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] regs_to_env() ?
  2010-07-22  2:06 [Qemu-devel] regs_to_env() ? Jun Koi
@ 2010-07-22 22:08 ` Blue Swirl
  2010-07-23  1:43   ` Jun Koi
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2010-07-22 22:08 UTC (permalink / raw)
  To: Jun Koi; +Cc: qemu-devel

On Thu, Jul 22, 2010 at 2:06 AM, Jun Koi <junkoi2004@gmail.com> wrote:
> Hi,
>
> Function regs_to_env() in target-i386/exec.h has a code like below:
>
> ...
> #ifdef reg_EAX
> env->regs[R_EAX] = EAX
> #endif
> ...
>
> However, elsewhere we have EAX defined as:
>
> #define EAX (env->regs[R_EAX])
>
> This means effectively, we have code like:
>
> env->regs[R_EAX] = env->regs[R_EAX];
>
> What is the meaning of this code? That looks pointless to me, but I
> guess I must be wrong here...

Yes, those lines don't exist anymore, they were used before TCG. IIRC
EAX was defined to AREG1 etc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] regs_to_env() ?
  2010-07-22 22:08 ` Blue Swirl
@ 2010-07-23  1:43   ` Jun Koi
  2010-07-23  1:51     ` Jun Koi
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Koi @ 2010-07-23  1:43 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

On Fri, Jul 23, 2010 at 7:08 AM, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Thu, Jul 22, 2010 at 2:06 AM, Jun Koi <junkoi2004@gmail.com> wrote:
>> Hi,
>>
>> Function regs_to_env() in target-i386/exec.h has a code like below:
>>
>> ...
>> #ifdef reg_EAX
>> env->regs[R_EAX] = EAX
>> #endif
>> ...
>>
>> However, elsewhere we have EAX defined as:
>>
>> #define EAX (env->regs[R_EAX])
>>
>> This means effectively, we have code like:
>>
>> env->regs[R_EAX] = env->regs[R_EAX];
>>
>> What is the meaning of this code? That looks pointless to me, but I
>> guess I must be wrong here...
>
> Yes, those lines don't exist anymore, they were used before TCG. IIRC
> EAX was defined to AREG1 etc.
>

hey, that sounds funny.

will you take a patch removing both regs_to_env() and env_to_regs() ?

thanks,
J

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] regs_to_env() ?
  2010-07-23  1:43   ` Jun Koi
@ 2010-07-23  1:51     ` Jun Koi
  0 siblings, 0 replies; 4+ messages in thread
From: Jun Koi @ 2010-07-23  1:51 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

On Fri, Jul 23, 2010 at 10:43 AM, Jun Koi <junkoi2004@gmail.com> wrote:
> On Fri, Jul 23, 2010 at 7:08 AM, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On Thu, Jul 22, 2010 at 2:06 AM, Jun Koi <junkoi2004@gmail.com> wrote:
>>> Hi,
>>>
>>> Function regs_to_env() in target-i386/exec.h has a code like below:
>>>
>>> ...
>>> #ifdef reg_EAX
>>> env->regs[R_EAX] = EAX
>>> #endif
>>> ...
>>>
>>> However, elsewhere we have EAX defined as:
>>>
>>> #define EAX (env->regs[R_EAX])
>>>
>>> This means effectively, we have code like:
>>>
>>> env->regs[R_EAX] = env->regs[R_EAX];
>>>
>>> What is the meaning of this code? That looks pointless to me, but I
>>> guess I must be wrong here...
>>
>> Yes, those lines don't exist anymore, they were used before TCG. IIRC
>> EAX was defined to AREG1 etc.
>>
>
> hey, that sounds funny.
>
> will you take a patch removing both regs_to_env() and env_to_regs() ?

oops that was removed in latest code already. (i looked at 0.12.4 code)

thanks,
J

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-23  1:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22  2:06 [Qemu-devel] regs_to_env() ? Jun Koi
2010-07-22 22:08 ` Blue Swirl
2010-07-23  1:43   ` Jun Koi
2010-07-23  1:51     ` Jun Koi

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).