http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53346
Uros Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com --- Comment #14 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-18 17:17:45 UTC --- Compile and execute slow assembly: gfortran rnflow.s && time ./a.out real 0m24.454s user 0m24.167s sys 0m0.231s Apply following patch that changes cmove in very fast loops (cptrf2) to jumps: --cut here-- --- rnflow.s 2012-05-18 19:00:22.314102061 +0200 +++ rnflow1.s 2012-05-18 19:10:59.363428625 +0200 @@ -1305,7 +1305,9 @@ movslq %edx, %rbx movss -4(%rdi,%rbx,4), %xmm0 ucomiss (%r9), %xmm0 - cmova %ecx, %edx + jbe .L183x + movl %ecx, %edx +.L183x: subl $1, %ecx subq $4, %r9 cmpl %r10d, %ecx @@ -1329,7 +1331,9 @@ movslq %ecx, %r10 movss -4(%rdi,%r10,4), %xmm0 ucomiss (%r9), %xmm0 - cmova %r11d, %ecx + jbe .L192x + movl %r11d, %ecx +.L192x: subl $1, %r11d subq $4, %r9 cmpl %eax, %r11d @@ -1485,7 +1489,9 @@ movslq %edx, %r10 movss -4(%rdi,%r10,4), %xmm0 ucomiss (%r9), %xmm0 - cmova %ecx, %edx + jbe .L179x + movl %ecx, %edx +.L179x: subq $4, %r9 subl $1, %ecx jne .L179 --cut here-- gfortran rnflow.s && time ./a.out real 0m18.170s user 0m17.907s sys 0m0.223s WTF happened here?! Relevant part of my /proc/cpuinfo: vendor_id : GenuineIntel cpu family : 6 model : 42 Adding CC.