Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: Martin Vaeth <martin@×××××.de>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Moving CPU flags into USE_EXPAND
Date: Thu, 15 Jan 2015 13:18:41
Message-Id: 20150115141826.2447544f@gentoo.org
In Reply to: [gentoo-dev] Re: Moving CPU flags into USE_EXPAND by Martin Vaeth
1 On Thu, 15 Jan 2015 12:03:27 +0000 (UTC)
2 Martin Vaeth <martin@×××××.de> wrote:
3
4 > Alexis Ballier <aballier@g.o> wrote:
5 > >> >>
6 > >> >> More precisely: When changing the names anyway,
7 > >> >> IMHO it would be a very good idea to follow the convention of
8 > >> >> the "flag" names in /proc/cpuinfo and add all flags supported
9 > >> >> there as possible USE-flags, no matter, whether they are
10 > >> >> currently used in some package or not.
11 > >> >
12 > >> > seriously ?
13 > >> >
14 > >> > $ grep flags /proc/cpuinfo | head -n 1 | wc -w
15 > >> > 94
16 >
17 > Well, currently, we have at least 10-20 already:
18 > At a very quick check (probably missing some), I found:
19 >
20 > mmx sse sse2 aes-ni ssse3 sse3 sse4 sse4a sse4.1 sse4.2
21 > 3des 3dnow 3dnowext
22 >
23 > and probably there are more to be added anyway
24 > in future packages.
25 >
26 > I am not even sure whether some of these sse4* are dupes
27 > or not since they do not follow /proc/cpuinfo convention.
28 > Some others do not follow this convention at all,
29 > e.g. "sse3" is called "pni" in /proc/cpuinfo
30 > or "aes-ni" is called "aes" in /proc/cpuinfo
31 >
32 > This is mainly what I meant: Currently, users have to look
33 > up how sse3 is called in /proc/cpuinfo to understand whether
34 > their processor has support for it. This could be automated.
35
36 /proc/cpuinfo is quite useless as a description
37
38 when i added such flags i tried to follow wikipedia naming and added
39 min cpu version that supported it in the description.
40 flags are usually extensively described in:
41 http://en.wikipedia.org/wiki/${uppercase flag}
42
43 algo, e.g. pni and aes pages are disambiguation ones, while SSE3 and
44 AES-NI are quite clear on what they are.
45
46 from wikipedia:
47 - SSE2, Willamette New Instructions (WNI)
48 - SSE3, also called Prescott New Instructions (PNI)
49 - SSSE3, Merom New Instructions (MNI)
50 - SSE4, Penryn New Instructions (PNI)
51 - AVX (Advanced Vector Extensions), Gesher New Instructions (GNI)
52
53
54 why do I have pni and avx in /proc/cpuinfo ?
55 this sounds quite inconsistent and is probably due to the fact that
56 those flags are added early in the kernel and have to stay forever,
57 while the naming might end up being a poor naming a few months or
58 years later. sys-apps/cpuid disambiguates it better.
59
60
61 I don't think it is a good idea to forward this inconsistency as-is:
62 better write a cpuinfo2useflags script that you could >> to make.conf
63 if automation is really the goal.
64
65 Alexis.