DSPRelated.com
Forums

How to convert __int64 (MSVC) to TI's syntax???

Started by Nguyen Pham Anh Khoa February 25, 2006
The standard defines the MINIMUM sizes for types. A C compiler
implementation is free to make a type larger than specified in the standard
(and therefore have different values than the defaults for the xxx_MAX
constants). 

Quote from the document referenced below regarding xxx_MAX constants.
"Their
implementation-defined values shall be equal or greater in magnitude
(absolute value) to those shown, with the same sign."

Therefore the minimum size of an unsigned long long as defined by the
standard is 64 bits. It could be larger depending on implementation. On C6x
it is 64bits.

Mike

-----Original Message-----
From: c6x@c6x@... [mailto:c6x@c6x@...] On Behalf Of Gregory
Lee
Sent: Wednesday, March 01, 2006 7:13 AM
To: c6x@c6x@...
Cc: Nguyen Pham Anh Khoa
Subject: Re: [c6x] How to convert __int64 (MSVC) to TI's syntax???

>From the combined C99 + TC1 + TC2 standard at
http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf the long
long types maximum value constant, ULLONG_MAX, is defined to be 2 ^ 64
- 1 which implies that the type must hold at least 64 bits of
information.

Also, I happen to use the unsigned long long type for a time value
from an NTP server which uses a 64-bit number to represent time and it
works fine on a DM642 with CCS 3.1.

Gregory Lee

On 3/1/06, Bhooshan Iyer <bhooshaniyer@bhoo...>
wrote:
>
> JS--
> My understanding is that:
> 40- bit long is NOT consisten with any other compiler, let alone being
> ANSI-C compliant; In fact I dont think ANSI is in the habbit of defining
> data type size beyond 32 bit. Am I wrong here?
>
> --Bhooshan
>
>
>
>
> On 3/1/06, sankaran <sankaran@sank...> wrote:
> > The correct data type is as follows:
> >
> > 64 bit integers; long long and unsigned long long
> >
> > 64 bit floating point; double.
> >
> > 40-bit: long
> >
> > This is consistent with Ansi-C.
> >
> > Regds
> > JS
> >
> > -----Original Message-----
> > From: c6x@c6x@... [mailto: c6x@c6x@...] On Behalf Of
venu
> > Sent: Tuesday, February 28, 2006 7:29 AM
> > To: mvgkbhat; Nguyen Pham Anh Khoa
> > Cc: c6x@c6x@...
> > Subject: Re: [c6x] How to convert __int64 (MSVC) to TI's
syntax???
> >
> > hi,
> > as far as i remember, long will take 40 bit in C6x.
> > so, i doubt long long will be equivalent to 64bit.
> > instead double should serve the purpose.
> > please correct me guys if i understood wrongly.
> > regards,
> > venu
> >
> > --- mvgkbhat <mvgkbhat@mvgk...> wrote:
> >
> > > Equivalent of __int64 is long long in C6x.
> > >
> > > Regards,
> > > Venu.
> > >
> > >
> > > On 2/25/06, Nguyen Pham Anh Khoa < npak243@npak...> wrote:
> > > >
> > > > Hi everybody,
> > > >
> > > > I'm Khoa. I'm working with C6713 board and Code
Composer
> > > Studio V3.1.
> > > >
> > > > I'd like to know how TI defines a 64bit integer ? (like
> > > __int64 in
> > > > Microsoft Visual C)?
> > > > I hope that you can help me to solve that problem.
> > > >
> > > > Thanks ,
> > > >
> > > > Anh Khoa
> > > >
> > >
> > >
> > >
> > >
> > > 
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> > 
> >
> >
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --
> -------------------------------
> "I've missed more than 9000 shots in my career.
> I've lost almost 300 games. 26 times I've been trusted to take
the game
> winning shot and missed.
> I've failed over and over again in my life.
> And that is why I succeed."
>         -- Michael Jordan
> --------------------------------
>
>
>  
>
>
>  
>
>  ________________________________
>
	--
Gregory Lee
	
#define today april_1st

I like the way the C language has been evolving: as machine word
will be getting bigger and bigger, someday our descendens would
be using long long long long type to work 128 bit integers. The
road is bright, straight and infinite!

Apparently, MS has chosen a different, and more effective mean to
extend data types, namely double underscore prefix and bit count
suffix, so their extended 64 bit type is __ then int then 64.
It is clear that a 128 bit integer type is an extension of the
extended type and it would be denoted as ____int128.

I hope my demise would happen before this "brave new world" :)

Andrew

P.S. One more obsevation: as the order of keywords does matter,
e.g. int unsigned is invalid, you can type long long, but cannot
long long. Prove me wrong! :)))

Also, keeping in mind that long is a shorthand for signed long int,
try to imagine what unsigned long long might mean :)

> Date: Wed, 1 Mar 2006 07:12:56 -0800
> From: "Gregory Lee" <tatsuling@tats...>
> Subject: Re: How to convert __int64 (MSVC) to TI's syntax???
>
> From the combined C99 + TC1 + TC2 standard at
> http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf the long
> long types maximum value constant, ULLONG_MAX, is defined to be 2 ^ 64
> - 1 which implies that the type must hold at least 64 bits of
> information.
>
> Also, I happen to use the unsigned long long type for a time value
> from an NTP server which uses a 64-bit number to represent time and it
> works fine on a DM642 with CCS 3.1.
>
> Gregory Lee
>
> On 3/1/06, Bhooshan Iyer <bhooshaniyer@bhoo...> wrote:
>>
>> JS--
>> My understanding is that:
>> 40- bit long is NOT consisten with any other compiler, let alone being
>> ANSI-C compliant; In fact I dont think ANSI is in the habbit of
defining
>> data type size beyond 32 bit. Am I wrong here?
>>
>> --Bhooshan
>>
>>
>>
>>
>> On 3/1/06, sankaran <sankaran@sank...> wrote:
>>> The correct data type is as follows:
>>>
>>> 64 bit integers; long long and unsigned long long
>>>
>>> 64 bit floating point; double.
>>>
>>> 40-bit: long
>>>
>>> This is consistent with Ansi-C.
>>>
>>> Regds
>>> JS
>>>
>>> -----Original Message-----
>>> From: c6x@c6x@... [mailto: c6x@c6x@...] On Behalf Of venu
>>> Sent: Tuesday, February 28, 2006 7:29 AM
>>> To: mvgkbhat; Nguyen Pham Anh Khoa
>>> Cc: c6x@c6x@...
>>> Subject: Re: [c6x] How to convert __int64 (MSVC) to TI's
syntax???
>>>
>>> hi,
>>> as far as i remember, long will take 40 bit in C6x.
>>> so, i doubt long long will be equivalent to 64bit.
>>> instead double should serve the purpose.
>>> please correct me guys if i understood wrongly.
>>> regards,
>>> venu
>>>
>>> --- mvgkbhat <mvgkbhat@mvgk...> wrote:
>>>
>>>> Equivalent of __int64 is long long in C6x.
>>>>
>>>> Regards,
>>>> Venu.
>>>>
>>>>
>>>> On 2/25/06, Nguyen Pham Anh Khoa < npak243@npak...>
wrote:
>>>>>
>>>>> Hi everybody,
>>>>>
>>>>> I'm Khoa. I'm working with C6713 board and Code
Composer
>>>> Studio V3.1.
>>>>>
>>>>> I'd like to know how TI defines a 64bit integer ?
(like
>>>> __int64 in
>>>>> Microsoft Visual C)?
>>>>> I hope that you can help me to solve that problem.
>>>>>
>>>>> Thanks ,
>>>>>
>>>>> Anh Khoa
>>>>>