Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 2015 16:03:24 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        R0B_ROD <witchdoctor.mdf@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Connection
Message-ID:  <8567CEA9-55BC-4B36-9C6A-10BE47F74D3F@FreeBSD.org>
In-Reply-To: <20150228025936.GA1640@p4-bsd>
References:  <20150228025936.GA1640@p4-bsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_47B52067-457A-44F5-8068-9F7FD407B4A1
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 28 Feb 2015, at 03:59, R0B_ROD <witchdoctor.mdf@gmail.com> wrote:
> The optimization level -O3
> in "CFLAGS and COPTFLAGS -O3 -pipe -funroll-loops"
> options in /etc/make.conf, have any relation to the
> CPU having SSE3 and SSE4A features??

This depends on which architecture you are using (e.g. amd64 or i386),
and on the specific CPU type you are compiling for.  The CPU type, set
by CPUTYPE in make.conf, determines the features the compiler can use,
such as different levels of SSE.

The 'optimization level' selected by -O1, -O2 and -O3 is only a shortcut
notation for selecting more and more specific optimization passes, in
the hope that the resulting executable will run faster.  The tradeoff
is slower compilation, and in some cases unexpected side effects.

The -pipe option is traditionally added to avoid writing temporary
files, but it is mostly ineffective when using clang, since it produces
object files directly from source, via internal transformations, instead
of the classic model of having a separate preprocessor, compiler and
assembler.

Lastly, the -funroll-loops option is usually unnecessary with clang, as
it is already automatically enabled for -O2 and higher.  When it is able
to use SSE, it will automatically try to vectorize loops and other parts
of the code [1].


> I have built over a dozen kernels for my laptop
> with 10.1-STABLE.

In case of the kernel, you will not gain anything from SSE, as it is
explicitly disabled for building the kernel code.  In kernel context,
no floating point or SSE instructions are allowed.

-Dimitry

[1] http://llvm.org/docs/Vectorizers.html


--Apple-Mail=_47B52067-457A-44F5-8068-9F7FD407B4A1
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.26

iEYEARECAAYFAlTx2MQACgkQsF6jCi4glqMBjACgl9st1wGecFvEZILCpfh3KZcz
irUAoL/pWbIqF7buxSeod95uZi5GRkj9
=fbeO
-----END PGP SIGNATURE-----

--Apple-Mail=_47B52067-457A-44F5-8068-9F7FD407B4A1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8567CEA9-55BC-4B36-9C6A-10BE47F74D3F>