svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk

David Chisnall theraven at FreeBSD.org
Sat Nov 14 18:30:29 UTC 2015


On 26 Oct 2015, at 16:21, Eric van Gyzen <vangyzen at FreeBSD.org> wrote:
> 
> One counter-argument to this change is that most applications already
>  use SIMD, and the number of applications and amount of SIMD usage
>  are only increasing.

Note that SSE and SIMD are not the same thing.  The x86-64 ABI uses SSE registers for floating point arguments, so even a purely scalar application that uses floating point will end up faulting in the SSE state.  This is not the case on IA32, where x87 registers are used (though when compiling for i686, SSE is used by default because register allocation for x87 is a huge pain).

I believe that the no-sse option for clang is ABI-preserving, so will not actually disable all SSE unless you also specify -msoft-float.  I don’t think that libthr uses floating point anywhere, but libc does and you only need to call one function that takes a floating point argument in between context switches to lose this gain on x86-64.  With this change, we’re making the compiler emit less efficient code, on the assumption that nothing will touch the fpu in the quantum before the next context switch.  I’d really like to see the set of applications that you benchmarked the change with on x86-64 to reach the conclusion that this is a net win overall. 

Or, to put it another way: How many applications are multithreaded but don’t use any floating point code?

David



More information about the svn-src-all mailing list