Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Dec 2017 10:12:15 -0800
From:      Yuri <yuri@rawbw.com>
To:        "ports@freebsd.org" <ports@freebsd.org>
Subject:   Should building for different SIMD levels be supported using flavors?
Message-ID:  <61cfc2b2-d121-64ad-ad80-c81ff08916f6@rawbw.com>

next in thread | raw e-mail | index | archive | help
Some projects rely on SIMD to perform computations. Sometimes, utilizing 
specific SIMD instructions can result in 10 times better performance, so 
it is important for the ports system to properly support SIMD. There are 
some projects that do automatic run-time SIMD detection, like Embree, 
but there are many that do not.


I proposed the solution for this using flavors, see the proposed port 
science/g2o: https://reviews.freebsd.org/D13610

It maps SIMD levels into port flavors. So that g2o-sse42 is for SSE42, 
and g2o-nosimd is not using SIMD.

Later, the user will to install the flavor corresponding to his 
machine's SIMD support.

Further, ports framework and tools (pkg) should automatically detect 
machine's SIMD, and install the ports with the correct SIMD flavor for it.


It seems to me that this is the right solution, and that flavors fit the 
purpose very well. Flavors are defined as needed for situations when the 
whole project needs to be rebuilt, and in this case it needs to be 
rebuilt because SIMD instructions inside are different.


Sadly, Mathieu disagreed, and asked to "Always build with the lowest 
available instructions."

How can FreeBSD support SSE then? There should be some consistent path 
forward on SIMD support. Just always using the lowest SIMD isn't an answer.


Yuri




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?61cfc2b2-d121-64ad-ad80-c81ff08916f6>