DSPRelated.com
Forums

How To Get 64-bit Integers on the TI C6000?

Started by Randy Yates September 15, 2005
I'm stumped. The compiler manual clearly states
that there is a "signed long long" and "unsigned
long long" for 64-bit signed and unsigned integer
types, but if I try putting one in my program I
get "error: the type 'long long' is nonstandard".

No combination of -pr and -pk options help, either.

This is version 4.32 of the compiler.

--RY

the "long long" type was added to ansi C standard more than 2 years ago. If 
the compiler claims that it support ansi C it should support "long long". It 
is standard.

"Randy Yates" <yates@ieee.org> wrote in message 
news:1126807079.366184.283540@g44g2000cwa.googlegroups.com...
> I'm stumped. The compiler manual clearly states > that there is a "signed long long" and "unsigned > long long" for 64-bit signed and unsigned integer > types, but if I try putting one in my program I > get "error: the type 'long long' is nonstandard". > > No combination of -pr and -pk options help, either. > > This is version 4.32 of the compiler. > > --RY >
Tom wrote:

> the "long long" type was added to ansi C standard more than 2 years ago. If > the compiler claims that it support ansi C it should support "long long". It > is standard. >
When programmers refer to "ANSI C" they mean (or should be understood to mean) ANSI C87, as described in K&R 2nd Ed. Stuff like long long, complex, and bool was introduced for the new C99 version of C, which strictly speaking is not ANSI C but ISO/IEC 9899:1999. So I think it is, legally and techically speaking, incorrect to call C99 "ANSI C". Even ANSI C++ does not support "long long", which must still be regarded as a non-standard extension. gcc is probably the only widely available compiler supporting C99. But gcc is famous/notorious for adding all sorts of stuff to C, that has little or nothing to do with ANSI anything. For more info, try: http://www.open-std.org/jtc1/sc22/wg14/ Richard Dobson
Randy,
  gcc and  cl6x compiler differs on data types sizes. For 6x  just
"long" is 64bit

int is 32 bit
short is 16 bit
char remain same 8 bit.
double is again bits.
SM

PS: double is again 64 bits

PS: double is again 64 bits
-SM

"soumit" <soumit.mukherjee@gmail.com> writes:

> Randy, > gcc and cl6x compiler differs on data types sizes. For 6x just > "long" is 64bit
Hi soumit, Thanks for the response. According to the C6000 compiler manual, a long is 40 bits. Here's part of the table from the manual: Table 7-1. TMS320C6000 C/C++ Data Types Type Size char, signed char 8 bits unsigned char 8 bits short 16 bits unsigned short 16 bits int, signed int 32 bits unsigned int 32 bits long, signed long 40 bits unsigned long 40 bits long long, signed long 64 bits long unsigned long long 64 bits enum 32 bits float 32 bits double 64 bits long double 64 bits pointers, references, 32 bits pointer to data members -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
Yeah Thats true, I always find it out using sizeof() operator.
Document is wrong. I have checked same code on C6200 and C6400
platforms.
I use DM642 which is on 64x, long is indeed 8 bytes 64 bits.
-SM

"Tom" <Tomdarel@yahoo.com> writes:

> the "long long" type was added to ansi C standard more than 2 years ago. If > the compiler claims that it support ansi C it should support "long long". It > is standard.
Hmmm. There is one option I hadn't tried since I thought it was going in the wrong direction: -ps means do strict ISO interpretation. Perhaps that is the ticket? -- % Randy Yates % "How's life on earth? %% Fuquay-Varina, NC % ... What is it worth?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
"soumit" <soumit.mukherjee@gmail.com> writes:

> Yeah Thats true, I always find it out using sizeof() operator. > Document is wrong. I have checked same code on C6200 and C6400 > platforms. > I use DM642 which is on 64x, long is indeed 8 bytes 64 bits.
Wow, thanks soumit. Have you verified that the range matches that of a 64-bit integer as well? -- % Randy Yates % "My Shangri-la has gone away, fading like %% Fuquay-Varina, NC % the Beatles on 'Hey Jude'" %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Shangri-La', *A New World Record*, ELO http://home.earthlink.net/~yatescr