Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cpu_flags_x86
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54673
Location: 56N 3W

PostPosted: Sun Feb 01, 2015 8:45 pm    Post subject: Reply with quote

bandreabis,

Go with the script. You have
Code:
3dnow 3dnowext mmx mmxext pni sse sse2

Except for pni, the USE names are the same as the flags.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


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

PostPosted: Sun Feb 01, 2015 9:25 pm    Post subject: Reply with quote

pni is sse3, so that can be used.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
mgorny
Developer
Developer


Joined: 27 Apr 2007
Posts: 83

PostPosted: Mon Feb 02, 2015 2:55 pm    Post subject: Reply with quote

To all: the point of those flags is to signify that the assembly is allowed to use a particular instruction set, it's not that it must use it. So…

NeddySeagoon wrote:
If you have both sse and sse2 you really don't want mmx.
mmx uses the FPU registers for SIMD integer operations.
sse adds eight new registers for SIMD single precision floating point operations.
sse2 adds integer arithmetic to the eight sse registers and some other goodies, effectively moving mmx out of the FPU.

Why don't you want mmx in CPU_FLAGS_X86=
It stalls the FPU, so you can't execute mmx and FPU instructions at the same time.

This is not really something that the users should be concerned with. If people are playing with custom assembler bits, they should be responsible for keeping the result fast. If you see an app that mixes instruction sets in an insane manner, report a bug and/or fix it implicitly. I mean, like ignore USE=mmx when USE=sse does a better job alone. Do not require users to fine-tune flags for every package.

khayyam wrote:
Currently cpu_flags_x86_mmx is a REQUIRED_USE in the case of cpu_flags_x86_sse2 (media-video/ffmpeg):

Code:
The following REQUIRED_USE flag constraints are unsatisfied:
  cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )

Of course you could have filed a bug for this and had it fixed. But instead you prefer babbling about it on the forum, how we make your life miserable by making a semi-related change that triggers a bug in ebuild for you. But good news, a Funtoo user reported the issue and it is fixed now.

mv wrote:
I did not check, but I would be very surprised if it were not the upstream author who decided that --enable-sse implies --enable-mmx, so he should know what he is doing and why.

Yes, that's one of the issues and sadly not many ebuilds handle it correctly. Many people just assume SSE2 implies having SSE, etc. Some build systems automatically force that. Some ebuilds provide explicit REQUIRED_USE to make that explicit rather than implicit. But I suppose some may even fail to build when you enable a weird mix like USE='-sse sse2'.

bandreabis wrote:
So I MUST use mmx and sse beacuse I have sse2?

If the code using SSE2 also uses SSE and MMX instructions, you obviously have to use them. You want part of function to work? Do you expect upstreams to provide a dozen variants of every function in case you want fancy instruction set combinations enabled?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Feb 02, 2015 7:08 pm    Post subject: Reply with quote

mgorny wrote:
khayyam wrote:
Currently cpu_flags_x86_mmx is a REQUIRED_USE in the case of cpu_flags_x86_sse2 (media-video/ffmpeg):

Code:
The following REQUIRED_USE flag constraints are unsatisfied:
  cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )

Of course you could have filed a bug for this and had it fixed. But instead you prefer babbling about it on the forum, how we make your life miserable by making a semi-related change that triggers a bug in ebuild for you. But good news, a Funtoo user reported the issue and it is fixed now.

mgorny ... of course I *could* have ... but then I would have had to possibly interact with *you*. No thanks. For you to typify my comments in this thread as "babbling" only shows that you are playing the game of blacking anyone who happens to question *your* reasoning. Similarly, nowhere have I claimed you (or rather, the royal "we") "make [my] life miserable" ... you don't get to paint me whatever colour you like, this is a chat forum, not an agree with ${developer} forum. Way to alienate users (me in particular) who spend a considerable amount of time supporting users ... yes, surprisingly, while "babbling" on and on and on and on.

If this thread illustrates one thing its that you shouldn't ask basic straightforward questions about the reasons for a particular change, you'll be run through the ringer. Firstly that question will be typecast a "grumbling", then your "convinced that gentoo devs are out to ruin your life", and acting like you've been "slap[ed] in the face", or "being [...] hateful", and "babbling about it", like "how we make your life miserable" ... yeah, well, I'm a hater, what do you expect. So, take your black arts and cock it!

Once your rid of me, and other troublesome users, you'll be free of such babble and will be able to make such changes without a whisper of contention ... though I imagine that silence will be deafening ... particularly here on the forums.

best of luck with that ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54673
Location: 56N 3W

PostPosted: Mon Feb 02, 2015 8:14 pm    Post subject: Reply with quote

mgorny,

You are missing your own point.
mgorny wrote:
the assembly is allowed to use a particular instruction set ...
I mean, like ignore USE=mmx when USE=sse does a better job alone.


We are talking hand crafted assembly inserts, in mostly multimedia apps. At the time tho assembly inserts are created, tha author determines the instruction set that will be targeted.
If the author targets mmx and ignores the fact that sse/sse2 is more capable, setting USE="-mmx sse sse2" will at best, just drop the assembly insert.
sse/sse2 will not be used as the hand crafted code path is not present.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mgorny
Developer
Developer


Joined: 27 Apr 2007
Posts: 83

PostPosted: Mon Feb 02, 2015 10:16 pm    Post subject: Reply with quote

khayyam wrote:
mgorny ... of course I *could* have ... but then I would have had to possibly interact with *you*. No thanks.

Actually you wouldn't because I wouldn't be the assigned that bug. You get the pleasure of dealing with me for being unpleasant here. And yes, this could be a much more pleasant experience if you were able to ask simple questions without adding all the extra text that only makes people angry.
Back to top
View user's profile Send private message
mgorny
Developer
Developer


Joined: 27 Apr 2007
Posts: 83

PostPosted: Mon Feb 02, 2015 10:18 pm    Post subject: Reply with quote

NeddySeagoon wrote:
mgorny,

You are missing your own point.
mgorny wrote:
the assembly is allowed to use a particular instruction set ...
I mean, like ignore USE=mmx when USE=sse does a better job alone.


We are talking hand crafted assembly inserts, in mostly multimedia apps. At the time tho assembly inserts are created, tha author determines the instruction set that will be targeted.
If the author targets mmx and ignores the fact that sse/sse2 is more capable, setting USE="-mmx sse sse2" will at best, just drop the assembly insert.
sse/sse2 will not be used as the hand crafted code path is not present.

I think we didn't understand each other. That's pretty much exactly my point.

You should have CPU_FLAGS_X86="mmx sse sse2" to signify that can you handle all the three. The package is supposed to choose the most optimal code path available based on that. In particular, if enabling both mmx and sse code paths makes the final code slower, the package should itself ignore USE=mmx.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54673
Location: 56N 3W

PostPosted: Mon Feb 02, 2015 10:26 pm    Post subject: Reply with quote

mgorny,

Yes, we are agreed. We chose different use cases to illustrate the point.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1483

PostPosted: Tue Feb 03, 2015 2:02 am    Post subject: Reply with quote

Regarding the two flags
mmx sse2
Will the ffmpeg ebuild self optimize, or is it better still to build like this:
Code:
media-video/ffmpeg-2.5.3:0/54.56.56 
CPU_FLAGS_X86="-3dnow -3dnowext -avx -avx2 -fma3 -fma4 -mmx* -mmxext* sse sse2 sse3 sse4_1 -sse4_2 ssse3 -xop"
It builds now, but is it still better to disable mmx?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Feb 03, 2015 3:29 am    Post subject: Reply with quote

ulenrich ...

current wisdom has it that your CPU_FLAGS_X86 shouldn't need to change, the build system, and/or code, should make the optimal choice based on those flags.

best ... khay
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Feb 03, 2015 7:08 pm    Post subject: Reply with quote

mgorny wrote:
In package.use:

Code:
www-plugins/adobe-flash cpu_flags_x86_sse2


Unless Portage devs refuse to eventually merge the patch, portage-2.2.16 will also let you do:

Code:
www-plugins/adobe-flash CPU_FLAGS_X86: sse2

That's the more interesting change IMO - now that portage's configuration is becoming sane, I can `ln -s /etc/paludis/use.conf.d /etc/portage/package.use`...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54673
Location: 56N 3W

PostPosted: Tue Feb 03, 2015 7:11 pm    Post subject: Reply with quote

ulenrich,

You need to trust the guys that wrote the assembler inserts to handle any options they may have correctly.
Its forllows that you should enable all the flags your CPU has in CPU_FLAGS_X86.

Its up to the individual package how choices are implemented. Ideally at build time, so you don't build code you don't need but I can see it being done at run time too, Much like the kernel tests all of the XOR speeds available when the RAID system starts.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Ximik
n00b
n00b


Joined: 02 Aug 2011
Posts: 10

PostPosted: Mon Apr 06, 2015 7:05 pm    Post subject: Reply with quote

Don't want to create new topic.

Where should i see this new feature? E.g. for VIDEO_CARDS i can see the variable in emerge --info and in the installing/updating packages list. However i can see nothing for CPU_FLAGS_X86 (while having the string in make.conf). What's wrong?

Code:
> emerge --info
Portage 2.2.14 (python 2.7.9-final-0, !../../usr/portage/profiles/default/linux/amd64/13.0/desktop/kde, gcc-4.8.3, glibc-2.19-r1, 3.17.7-gentoo x86_64)
=================================================================
System uname: Linux-3.17.7-gentoo-x86_64-Intel-R-_Core-TM-_i5-4440_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:     3729632 total,   1300572 free
KiB Swap:    8483136 total,   8243028 free
Timestamp of tree: Mon, 06 Apr 2015 18:30:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-lang/perl:            5.20.2
dev-lang/python:          2.7.9-r1, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core-avx2 -O2 -pipe"
DISTDIR="/var/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://gentoo.kiev.ua/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY=""
USE="X a52 aac acl acpi alsa amd64 avx avx2 berkdb bluetooth branding bzip2 cairo cli consolekit cracklib crypt cups cxx dbus declarative dri dts emboss encode exif fam flac fma3 gdbm gif glamor gpm iconv ipv6 jpeg kde kipi lcms libnotify mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt qt3support qt4 readline sdl session spell sse sse2 sse3 sse4 sse4_1 sse4_2 sse4a ssl ssse3 startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vaapi vlc vorbis x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON


UPD: Just had to reset profile (via eselect).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
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