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.
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.
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.
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.
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.