×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    51

    long long 64 bit type

    Hi,

    does Symbian target compiler (GCC) support the "long long" variable type for 64 bit integers, or is TInt64 the only way to get 64 bit integers?

    I need to use 64 bit ints in a lowel level CPU demanding loop. The cost of using objects (TInt64) is very expensive there, and I'm looking for a way to cut back.

    Thanx
    Yaron Tadmor

  2. #2
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267
    TInt64 is a macro, so you can find its definition in the "\epoc\include\" folder.

    May be it is something like

    typedef long long TInt64;

    that means you can use "long long" directly

  3. #3
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    chenziteng: TInt64 is a class where the value is represented as two TUints. See e32std.h.

    yaront: ARM does not natively support 64-bit arithmetic so 64-bit arithmetic functions have to be constructed from more basic building blocks. Symbian's TInt64 implementation is relatively efficient. So unless you can refactor your loop to work on e.g. 32-bit integers, TInt64 is probably your best shot.

    Lauri

  4. #4
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    51
    laa-laa:

    After checking, I noticed that ARM doesn't work with 64 bit at all. I know that on other platforms where the CPU doesn't suport it, the compiler itself (through the "long long" type) uses 2 32 bits integers to simulate a 64 int type.

    However the Symbian compiler doesn't recongnize the "long long" as a 64 bit value, and the only option is the TInt64.

    I'll believe you if you say it's an efficient implementation, however it's still a class, and there is the overhead of class construction which in low-level loops is a problem.

    The best solution to this problem is a built-in support by the compiler for the "long long" type.

    Yaron.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    Check how TInt64 is declared in e32std.h. Its constructors are inline so there is no function call overhead on construction - just setting a value to two 32-bit integer variables.

    Lauri

  6. #6
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267
    To laa-laa: I said "may be" which also means it may NOT be.

    Actually both of us are correct, as long as the version of the SDK and compiler are considered.

    In certain SDK, the definition of TInt64 is not a class in e32std.h but a macro in e32def.h.
    Of course the compiler bound with it can deal with "long long" keywords.

    To yaront: May be you have to wait for a long time to get such SDK and compiler.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×