This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unreviewed patches

Hi Michael,

Thanks for reviewing the patches.

> > [RFA] sim/h8300/h8300.c: Fix the handling of bxor.
> >
> For this one, I find the expression "!!(ea & m)" a bit obscure.
> How about "(ea & m) != 0)"?

Sure.  Does this mean the patch is OK to apply with your sugestion?

> > [RFA] sim/h8300/compile.c: Fix the handling of extu.w.
> >
> When you say "an 8-bit wide register that does not exist", 
> do you mean "that isn't simulated"?  It seems to me that 
> the more correct solution is that breg[] is not big enough.
> It ought to be at least 24 words, if not 32.

Well, H8/300H and H8S have 8 32-bit registers, from er0 to er7.  Each
of them can be treated as two 16-bit wide registers.  That is, er0 is
split into e0 and r0.  Furthermore, the lower half, r0, can be divided
into two parts, r0h and r0l.  The organization of one register looks
like so:

31     24 23    16 15     8 7      0
|  N/A   |  N/A   |  r0h   |  r0l   |
|       e0        |       r0        |
|                er0                |

Now, "extu.w r0" zero-extends the value of r0l and stores the result
to r0.  The H8 simulator without my patch correctly handles this.  A
problem arises when the simulator sees "extu.w e0".  The correct
behavior is to zero-extend the lower half of e0 and store the result
into e0.  However, GET_B_REG in the simulator has no way to refer to
the lower half of the e0.  The real hardware does not even have this,
so I decided to take e0 and clear the upper half of e0, which also
works for "extu.w r0".  Just take r0 and clear the upper half of r0.

I hope this clarifies the motivation behind the patch.


Kazu Hirata

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]