Re: ARM7, DSP and mobile phone, how and why?
From: glen herrmannsfeldt (gah_at_ugcs.caltech.edu)
Date: 06/15/04
- Next message: kal: "Re: Making function private/ not supplying declaration in header file"
- Previous message: Jack Klein: "Re: Dynamic access to struct field names"
- Next in thread: Jack Klein: "Re: ARM7, DSP and mobile phone, how and why?"
- Reply: Jack Klein: "Re: ARM7, DSP and mobile phone, how and why?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 15 Jun 2004 03:27:55 GMT
(comp.lang.c added)
Wilco Dijkstra wrote:
> "42Bastian Schick" <bastian42@yahoo.com> wrote in message
> news:40cd3766.153017817@news.individual.de...
>>On Thu, 10 Jun 2004 16:50:47 -0400, Jerry Avins <jya@ieee.org> wrote:
>>>>This code doesn't look portable to me. shifts are not
>>>>guaranteed to fill with the sign bit.
>>>>Of course in the context of ARM compilers this should be OK.
(snip)
>>>HLL that doesn't offer both arithmetic and logical shifts when the
>>>processor supports the is a crippled abomination.
>>The question is, does the C or C++ standard define whether
>>right-shifts are signed or unsigned ?
(snip)
> However compiler writers agree on most of these things (if they didn't
> then their customers would force them anyway) so in reality most code
> is portable across many compilers and architectures with little effort.
> And yes I've never heard of a compiler that didn't support signed right
> shifts corectly. The reason C89 didn't define signed arithemetic properly
> was to allow 1-complements arithmetic. So if you want to make your
> code compliant think 1-complements whenever you do anything.
C supports both 1's complement and sign magnitude, though I
don't know of any current producers of fixed point sign
magnitude machines. I am told that Unisys still makes
ones complement machines. As long as that is true, you can't
rely on the results of signed shift.
I believe, though, that a conforming C implementation can do
logical right shift on signed data.
-- glen
- Next message: kal: "Re: Making function private/ not supplying declaration in header file"
- Previous message: Jack Klein: "Re: Dynamic access to struct field names"
- Next in thread: Jack Klein: "Re: ARM7, DSP and mobile phone, how and why?"
- Reply: Jack Klein: "Re: ARM7, DSP and mobile phone, how and why?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|