Re: G++ could optimize ASM code more

2012-05-09 Thread Marc Glisse
On Wed, 9 May 2012, Daniel Marschall wrote: I could sucessfully do a benchmark of my code. I found out that the no-typecast-version (imull+movslq) needed 47 secs for 12 working packages, while the typecast-version (imulq) needed only 38 secs per 12 working packages. That is incredible! Maybe

Re: G++ could optimize ASM code more

2012-05-09 Thread Daniel Marschall
Am 09.05.2012 20:30, schrieb Ian Lance Taylor: Daniel Marschall writes: I did understand that the compiler used "signed" multiplication instead of an unsigned one because char*char needs to be extended. Maybe I am wrong, but couldn't the compiler "know" that the result will be at least unsig

Re: G++ could optimize ASM code more

2012-05-09 Thread Daniel Marschall
Am 09.05.2012 21:48, schrieb Marc Glisse: On Wed, 9 May 2012, Daniel Marschall wrote: 1. I do not know my DisplayName/DisplayFamily (0f_2h or 0f_3h?). Ask your processor (cpuid). Or your kernel (/proc/cpuinfo on linux). /proc/cpuinfo says: processor : 0 vendor_id : GenuineIntel

Re: G++ could optimize ASM code more

2012-05-09 Thread Marc Glisse
On Wed, 9 May 2012, Daniel Marschall wrote: 1. I do not know my DisplayName/DisplayFamily (0f_2h or 0f_3h?). Ask your processor (cpuid). Or your kernel (/proc/cpuinfo on linux). 3. Should I compare Latency or Throughput if I want to produce fast code? Or doesn't it matter which value I compa

Re: G++ could optimize ASM code more

2012-05-09 Thread Daniel Marschall
Hello, Look for the Intel Optimization Manual on intel.com. The appendixes have latency and throughput information for the instruction set on various Intel processors. Uh-oh, that's hard. I tried to find the information, but I did only found a part of the informations I was looking for. Fi

Re: G++ could optimize ASM code more

2012-05-09 Thread Ian Lance Taylor
Daniel Marschall writes: > I did understand that the compiler used "signed" multiplication > instead of an unsigned one because char*char needs to be extended. > > Maybe I am wrong, but couldn't the compiler "know" that the result > will be at least unsigned because unsigned * unsigned = unsigned

Re: G++ could optimize ASM code more

2012-05-09 Thread Daniel Marschall
Hello and thanks for your quick reply! Am 09.05.2012 15:59, schrieb Ian Lance Taylor: Note that the current GCC release is 4.7.0. The problem with Debian Squeeze is always that I have to use "medieval" software... ;-) Maybe I should develop the server software on a local box using "unstab

Re: G++ could optimize ASM code more

2012-05-09 Thread Ian Lance Taylor
Daniel Marschall writes: > As I was optimizing my program, I found a few things which looked odd > to me in the assembler code. Thanks. It's often best to report missed optimizations at http://gcc.gnu.org/bugzilla/ . They will tend to be forgotten on the mailing list. > I am on an AMD x64_32