Comment 9 for bug 1663280

Revision history for this message
In , Carlos (carlos-redhat-bugs) wrote :

(In reply to Oleg Strikov from comment #4)
> Hi Carlos,
>
> Many thanks for looking into this! Could you please confirm that you used
> the following command to compile pow test with gcc:
>
> $ gcc -O3 -march=x86-64 -mavx -o pow pow.c -lm

I can confirm that I used these options on an F25 system.

The dynamic loader trampoline is only called once in the loop to resolve the singular math function call, and after that it's the same sequence over and over again without any explicit software save/restore (though the CPU might do something for the transition).

carlos@athas rhbz1421121]$ gcc -O3 -march=x86-64 -mavx -o pow-test pow-test.c -lm
[carlos@athas rhbz1421121]$ time ./pow-test
154964150.331550

real 0m1.829s
user 0m1.819s
sys 0m0.002s
[carlos@athas rhbz1421121]$ time LD_BIND_NOW=1 ./pow-test
154964150.331550

real 0m1.833s
user 0m1.819s
sys 0m0.005s

gcc version 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC)

> Passing -mavx is the key thing for this example to work as expected. You
> want to compile pow() test WITH -mavx but exp() test WITHOUT -mavx.
>
> I'd also appreciate if you tell me on which CPU you do testing. It's
> impossible for me run this test on every possible CPU (tried on Sandy Bridge
> and Ivy Bridge machines so far) and this information would be really helpful.

I ran this on an i5-4690K, so a Haswell series CPU, but without AVX512.