Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE flags and cpuinfo flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
paradigm-X
Apprentice
Apprentice


Joined: 19 Sep 2013
Posts: 168

PostPosted: Sat Feb 15, 2014 5:49 am    Post subject: USE flags and cpuinfo flags Reply with quote

When I compare the kernel flags to the list of USE flags to see where I might be able to tweak the builds, etc., sometimes I see flags that have similar characteristics such as sse3, sse4, and others like that sort. If I want to enable whatever USE flags would match my kernel flags, if possible, should I put both sse2 and sse3 flags into the '/etc/portage/make.conf' file, or would if be better to put only the highest one of these, like only sse3?
Back to top
View user's profile Send private message
calavicci
n00b
n00b


Joined: 28 Mar 2006
Posts: 50

PostPosted: Sat Feb 15, 2014 3:36 pm    Post subject: Reply with quote

I admit that I'm not expert on the internals; I don't know whether, e.g., SSE3 is intended to mean "the entire SSE3 instruction set" or "the 13 instructions in SSE3 that are not in SSE2," but I'm not sure it matters; keep reading. The standard practice seems to be to use the flags for all of the instruction sets supported by one's CPU in make.conf.

An important note is that these sorts of USE flags are distinct from any related CFLAGS. The latter determines the instructions that GCC will output when building your code. The practice of using USE flags in an ebuild to affect the CFLAGS for a particular package is typically discouraged. These flags are supposed to be used, e.g., when a package can streamline itself by using assembly code to produce particularly fast binaries for some operations. If you have them disabled at build, the package should still run, but just be slower.

Recommended practices aside, it's really sort of up to the package what to do with combinations of these flags. Assuming that the intent is that SSE3 indicates all of SSE3, including the SSE2 subset, one would hope that packages that see the SSE3 USE flag would implement SSE2 code; their authors, after all, are the ones that included both flags. However, a package that might build code using SSE2 might have the SSE2 flag but not the SSE3, in which case it would not realize that your USE="SSE3" is supposed to mean that it should build the SSE2 code.
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Sat Feb 15, 2014 9:59 pm    Post subject: Reply with quote

Code:
acoswt@PrimaPratica ~ $ equery hasuse sse2
 * Searching for USE flag sse2 ...
[IP-] [  ] dev-libs/openssl-1.0.1f:0
[I-O] [  ] kde-base/kdelibs-4.11.5:4/4.11
[I-O] [  ] kde-base/ksplash-4.11.5:4/4.11
[IP-] [  ] media-libs/lensfun-0.2.7:0
[IP-] [  ] media-libs/libsoundtouch-1.7.1:0
[IP-] [  ] media-libs/libvpx-1.1.0:0
[IP-] [  ] media-libs/qimageblitz-0.0.6-r1:0
[IP-] [  ] media-video/mplayer-1.1.1-r1:0
[IP-] [  ] media-video/transcode-1.1.7-r1:0
[IP-] [  ] sci-libs/fftw-3.3.3-r2:3.0
[IP-] [  ] www-plugins/adobe-flash-11.2.202.336:0
[IP-] [  ] x11-libs/pixman-0.32.4:0
acoswt@PrimaPratica ~ $ equery hasuse sse3
 * Searching for USE flag sse3 ...
[IP-] [  ] media-libs/libvpx-1.1.0:0

So, we can see on this system that if I set the sse3 use flag AND NOT the sse2 use flag then only libvpx will be tweaked.
If I want the packages from the first list to make use of the sse2 instruction set, I must explicitly set the sse2 use flag, irrespective of the sse3 use flag settings.
_________________
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Sat Feb 15, 2014 10:32 pm    Post subject: Reply with quote

sse & sse2 flags should be set in the default desktop profile ( emerge --info & look at USE= )

sse3/sse4 need to be set if you want to use them and your cpu can handle them
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
paradigm-X
Apprentice
Apprentice


Joined: 19 Sep 2013
Posts: 168

PostPosted: Sun Feb 16, 2014 11:17 pm    Post subject: Reply with quote

aCOSwt, hello. Your technique is excellent. I like how you can get to the crux of the issue promptly. The 'hasuse' equery is not something I have used much, until now. Thank you for the slick demo too.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum