Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Sep 2011 18:06:44 +0200
From:      Pietro Cerutti <gahr@FreeBSD.org>
To:        Alexey Dokuchaev <danfe@FreeBSD.org>
Cc:        cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/audio/beast Makefile
Message-ID:  <20110907160643.GR98648@gahrfit.gahr.ch>
In-Reply-To: <20110907155741.GA69663@FreeBSD.org>
References:  <201109071436.p87EaDGo097718@repoman.freebsd.org> <20110907155741.GA69663@FreeBSD.org>

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

--O8/n5iBOhiUtMkxf
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2011-Sep-07, 15:57, Alexey Dokuchaev wrote:
> On Wed, Sep 07, 2011 at 02:36:13PM +0000, Pietro Cerutti wrote:
> > gahr        2011-09-07 14:36:13 UTC
> >=20
> >   Modified files:
> >     audio/beast          Makefile=20
> >   Log:
> >   - Unbreak
> >   - Use sysctl to find out whether SSE is supported
>=20
> What's wrong with .if ${MACHINE_CPU:Msse} ?

I found out that MACHINE_CPU does not reflect the actual caps of the CPU
the process is currently running on. This leads to false negative (no
sse in MACHINE_CPU on SSE-capable CPUs). Look at these outputs from a
test machine of mine:

> make -V MACHINE_CPU
i486

> sysctl hw.instruction_sse
hw.instruction_sse: 1

> grep ^CPU /var/run/dmesg.boot
CPU: Intel(R) Pentium(R) 4 CPU 1.70GHz (1694.54-MHz 686-class CPU)

> grep Features /var/run/dmesg.boot
  Features=3D0x3febfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PG=
E,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM>

Unfortunately, using a sysctl here is the only reliable way I found to
determine SSE capabilities.

Any suggestions how to do it better is warmly welcome!

--=20
Pietro Cerutti
The FreeBSD Project
gahr@FreeBSD.org

PGP Public Key:
http://gahr.ch/pgp

--O8/n5iBOhiUtMkxf
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk5nlpMACgkQwMJqmJVx9442/ACgnHdJdxUVEAu857kszHdekmUh
ExIAniKFemXRZakEgymmaX8Vwb+38mZT
=/d1h
-----END PGP SIGNATURE-----

--O8/n5iBOhiUtMkxf--



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