Re: GCC has problems with 64-bit multiplication

2007-02-26 Thread Hans Petter Selasky
On Thursday 08 February 2007 16:02, Graham Stott wrote: All, Not a bug in GCC the result is correct as you've only asked for a 32-bit multiply. Hi again, The problem was not that mull is used, but that gcc 3.4.6 generates highly un-optimized code when I for example multiply a 16-bit integer

GCC has problems with 64-bit multiplication

2007-02-08 Thread Hans Petter Selasky
Test program: #include stdio.h #include sys/types.h int main() { int32_t a = 0x4000; int16_t b = 0x4000; int64_t c = a * b; printf(0x%016llx\n, c); return 0; } %cc test.c %./a.out 0x %gcc --version gcc (GCC) 3.4.6 [FreeBSD]

Re: GCC has problems with 64-bit multiplication

2007-02-08 Thread Graham Stott
All, Not a bug in GCC the result is correct as you've only asked for a 32-bit multiply. --- Hans Petter Selasky [EMAIL PROTECTED] wrote: Test program: #include stdio.h #include sys/types.h int main() { int32_t a = 0x4000; int16_t b = 0x4000;

Re: GCC has problems with 64-bit multiplication

2007-02-08 Thread Hans Petter Selasky
On Thursday 08 February 2007 16:02, Graham Stott wrote: All, Not a bug in GCC the result is correct as you've only asked for a 32-bit multiply. Ok, thanks. But really I don't want to do ((int64_t)a) * b, which I know works, hence that is very much slower than a * b on intel processors, hence