Re: arm9e: how do I invert sign of a halfword?
- From: "Wilco Dijkstra" <Wilco.removethisDijkstra@xxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 11:49:29 +0100
"CBFalconer" <cbfalconer@xxxxxxxxx> wrote in message news:4890FCB4.383827B8@xxxxxxxxxxxx
Wilco Dijkstra wrote:
"CBFalconer" <cbfalconer@xxxxxxxxx> wrote:... snip ...
Just consider the meaning and action on machines using ones
complement or sign-magnitude conventions. Also the fact that the
occurence of an overflow can cause implementation defined action.
I did consider that and this is exactly why the C standard is
incorrect:
Arithmetic one-complement shifts shift the sign into either the
MSB (right shift) or LSB (left shift). Sign magnitude only shifts
the magnitude for both left and right shift. This gives the
correct arithmetic results, ie. -0 stays -0, -1 becomes -0 on a
right shift, and -2 on a left shift etc.
Please give a reference section (s) in the C99 standard that
imposes this.
The standard has nothing to do with this. Remember you asked me to
"consider the meaning and action on machines using ones complement
or sign-magnitude conversions". That's what I did, and I described how
shifts work on such machines, and that there is clearly no reason for
left shifts to be undefined when right shifts are implementation defined.
Once you understand that, you'll understand the C standard is incorrect.
Wilco
.
- Follow-Ups:
- Re: arm9e: how do I invert sign of a halfword?
- From: CBFalconer
- Re: arm9e: how do I invert sign of a halfword?
- References:
- Re: arm9e: how do I invert sign of a halfword?
- From: Everett M. Greene
- Re: arm9e: how do I invert sign of a halfword?
- From: CBFalconer
- Re: arm9e: how do I invert sign of a halfword?
- From: Wilco Dijkstra
- Re: arm9e: how do I invert sign of a halfword?
- From: CBFalconer
- Re: arm9e: how do I invert sign of a halfword?
- From: Wilco Dijkstra
- Re: arm9e: how do I invert sign of a halfword?
- From: CBFalconer
- Re: arm9e: how do I invert sign of a halfword?
- From: Wilco Dijkstra
- Re: arm9e: how do I invert sign of a halfword?
- From: CBFalconer
- Re: arm9e: how do I invert sign of a halfword?
- Prev by Date: Re: arm9e: how do I invert sign of a halfword?
- Next by Date: Re: arm9e: how do I invert sign of a halfword?
- Previous by thread: Re: arm9e: how do I invert sign of a halfword?
- Next by thread: Re: arm9e: how do I invert sign of a halfword?
- Index(es):
Relevant Pages
|