Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2015 17:43:56 -0400
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        Rui Paulo <rpaulo@me.com>
Cc:        current@FreeBSD.org
Subject:   Re: SSE in libthr
Message-ID:  <5515CF1C.8010409@FreeBSD.org>
In-Reply-To: <3A96AAEC-9C1C-444E-9A73-3CD2AED33116@me.com>
References:  <5515AED9.8040408@FreeBSD.org> <3A96AAEC-9C1C-444E-9A73-3CD2AED33116@me.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/27/2015 16:49, Rui Paulo wrote:
>
> Regarding your patch, I think we should disable even more, if possible.  How about:
>
> CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3

Yes, I was considering copying all of the similar flags that we use in the
kernel.  That seems wise.  According to comments in sys/conf/kern.mk, only
no-mmx and no-sse would be necessary, as they imply the others.

dim@ raised the possibility of CPUTYPE=foo on i386, so I would also apply this
change to i386.

An updated patch is below.

Eric


Index: base/head/lib/libthr/arch/amd64/Makefile.inc
===================================================================
--- base/head/lib/libthr/arch/amd64/Makefile.inc    (revision 280703)
+++ base/head/lib/libthr/arch/amd64/Makefile.inc    (working copy)
@@ -1,3 +1,8 @@
 #$FreeBSD$
 
 SRCS+=    _umtx_op_err.S
+
+# Using SSE incurs extra overhead per context switch,
+# which measurably impacts performance when the application
+# does not otherwise use FP/SSE.
+CFLAGS+=-mno-sse -mno-mmx
Index: base/head/lib/libthr/arch/i386/Makefile.inc
===================================================================
--- base/head/lib/libthr/arch/i386/Makefile.inc    (revision 280703)
+++ base/head/lib/libthr/arch/i386/Makefile.inc    (working copy)
@@ -1,3 +1,8 @@
 # $FreeBSD$
 
 SRCS+=    _umtx_op_err.S
+
+# Using SSE incurs extra overhead per context switch,
+# which measurably impacts performance when the application
+# does not otherwise use FP/SSE.
+CFLAGS+=-mno-sse -mno-mmx




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5515CF1C.8010409>