You are not logged in.

#1 2004-09-30 21:59:45

combo
Member
Registered: 2004-09-22
Posts: 28

lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

Hi!
I may be a lamer, but the lame 3.96 version doesn't seem to be compiled with (asm) CPU optimalization. Or it just doesn't show during encoding. But if you have an i686 CPU, it has MMX support(?). So anyone who uses i686 can run MMX optimized progz. And lame has CPU recognition feature, so you can compile it with 3dnow, SSE ... support, it'll be run all Arch system. The same problem with XMMS mpg123lib mp3-decoder plug-in: It is compiled without MMX/3DNow optimization. You may say, that this is not important for mp3-playing, but if my CPU has cool 3dnow commands, I'd like to use it. (For mp3-encoding this is more important.) And all packages can be compiled with MMX support...:)
I didn't want to hurt you, this is my favourite distro, I just want to make it even better: so I may upload the mmx/3dnow enabled mpg123-plugin, if possible. I don't want to upload lame, because it's in original distro, so I upload gogo-no-coda instead.
THX for Arch...:)

edited: Unfortunately it turned out that even not all i686 CPU have MMX commands eighter:(

Offline

#2 2004-09-30 22:45:42

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

uploading something that already exist is not needed

it would be better to explain the way, how did you recompiled it for your cpu, so that others can reproduce it

i'm not really sure about the command-spaces of cpu's but 3dnow is only on amd's available, as i understand it now (so a pkg that is using 3dnow will not work correctly on an intel - or?)


The impossible missions are the only ones which succeed.

Offline

#3 2004-09-30 23:07:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

First, SSE is not 686 specific as it was first introduced in the P3.

And while MMX and 3DNow use the same FPU registers, the instruction sets are different.

To elaborate:
MMX was introduced in the original Pentium core, but only for integer operands (it was very very crappy), AMD built upon the MMX ISA and created 3DNow! for the AMD K6-2 which went over and above the MMX specifications.  However, 3DNow! is still backwards compatible with MMX.
In the Pentium 3 core, Intel introduced SSE (Streaming SIMD Extensions, IIRC... and SIMD => Single Instruction, Multiple Data) which beat out AMD's 3DNow!.  Then, in the Athlon chipset, AMD added Enhanced 3DNow! which bested SSE instructions but was not compatable with it.... 3DNow! Professional (later Athlons) was fully backward compatable with SSE.  Finally the Pentium 4 introduced SSE-2 instructions (AMD was supposed to beat this again, last I checked.... not sure if it happened).

The progression goes like this:

MMX -----> 3DNow! -----> SSE -----> 3DNow! Professional -----> SSE-2 -----> ???
                           |         ^
                           |         |
                           |         |
                           v         |
                         Enhanced 3DNow!

Each branch is fully backwards compatable with it's ancestors.

Seeing as MMX was the only one guarenteed to exist in ALL 686 cores (as it was introduced in the 586 line) and MMX is fully compatible with all existing Multimedia ISAs, it is the only one safe to include in Arch.

CONCLUSION: Enabling MMX is fine and should be done in multimedia applications (however, performance gains will be negligable on modern processors).  Anything beyond MMX is breaking compatiblity with all 686 cores.

I must point out that you will have no noticable difference in performance.  The MMX extensions were originally for DSP uses (which did include audio) however most compilers do not make direct use of these instructions, and even gcc would be leery about using these - the code structure would have to be specifically written to take advantage of MMX/SSE

Offline

#4 2004-09-30 23:36:11

combo
Member
Registered: 2004-09-22
Posts: 28

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

Hi!
I said the same as you:
1. All MMX optimized apps will run, as phrakture said. I dunno if GCC has MMX support (because I'm using 3dnow!), but I think with MMX optimalizon a prog can only run faster (or GCC is buggy:) than without it.

edited: I had to edit this message too, because it turned out that not all i686 CPU have MMX commands.

2. I spoke about programs which have special (usually written in ASSEMBLY by the prog's author) CPU support. Both program (what I've mentioned) can recognize what kind of CPU you have, and will use the proper code-part (function) for its job. If you think these progz are much bigger, you're only partly right, because the extra asm parts are (relatively) small and only the effectively used parts are optimized.
Sorry for my bad English.

Offline

#5 2004-10-01 12:23:39

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

phrakture, thanx a lot for this nice explaination

combo, sorry if i misunderstood you - i was changing something on xmms to make it _better_ about a year ago and was not longer able to run it on a P2 (compiled on a P4) - if you know a good way to compile one of these pkgs you mentioned and to keep compatiblity for all i686 cpus, you can open feature-requests @ bugs.archlinux.org providing the information what you did to change the pkg to compile on any i686 for any i686 (it must be able to be compiled on P2 to run on P4 or to be compiled on AMD A38 and run on P3 or any other combination) ... if this is possible, this would be great; if not, i would advise you to recompile the pkgs you want 100% optimized for your machine


The impossible missions are the only ones which succeed.

Offline

#6 2004-10-02 22:18:31

combo
Member
Registered: 2004-09-22
Posts: 28

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

Hi!
Compiling XMMS with 3dnow/mmx/fpu optimization is quite easy: You just run configure script with the --enable-simd switch. I'm sure that this XMMS will run on all i686 computer (all modern computer has at least FPU:). The forum readers can test it by compiling with this option, or I can upload only the libmpg123.so plugin to incoming if needed. If anyone has problem with it, please tell it us.
By(t)e

Offline

#7 2004-10-02 23:46:41

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

combo wrote:

Hi!
Compiling XMMS with 3dnow/mmx/fpu optimization is quite easy: You just run configure script with the --enable-simd switch. I'm sure that this XMMS will run on all i686 computer (all modern computer has at least FPU:). The forum readers can test it by compiling with this option, or I can upload only the libmpg123.so plugin to incoming if needed. If anyone has problem with it, please tell it us.
By(t)e

open a bug against xmms (feature requestment - optimized rebuilt), upload your binary there as attachemtn and tell people to test it with different archs - then if no fail-reports come, the maintainer will maybe consider your change a good one and addapt it


The impossible missions are the only ones which succeed.

Offline

#8 2005-01-26 16:38:00

combo
Member
Registered: 2004-09-22
Posts: 28

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

As I know, nothing has happened. I asked my friends using linux about this lame and xmms optimization, and the answers: EVEN THE (UN?)OFFICIAL I386 DEBIAN LAME AND XMMS PACKAGES ARE COMPILED WITH MMX/3DNOW! SUPPORT. So my suggestions MUST work on even an i386 machine (the debian-community is huge), as I expected. People using this cool distro want an OS for modern computers, so (since ArchLinux is i686 based) these changes must be done! I don't want to disturb Judd with direct e-mail, but Archlinux's philosophy would be hurted without these modifications.
THX. I'm happy with the new 0.7 anyway:)
Sorry for by bad English

Offline

#9 2005-01-27 15:15:31

combo
Member
Registered: 2004-09-22
Posts: 28

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

Probably liblame isn't MMX/3DNow/SSE optimized in Arch, either:(
I can see, that nobody believes me, so I uploaded the optimized i686 lame 3.96.1 (only the binary) to my homepage: http://petra.hos.u-szeged.hu/~ngaba/linux/lame/lame.bz2
I'd like to ask everyone to download and test this file and write the impressions about it to this topic. I'm sure that it will run on even such P2 machines which have no MMX (because lame has runtime CPU detection, and MMX/3Dnow/SSE is unswitchable from command-line).

Offline

#10 2005-01-29 10:32:48

combo
Member
Registered: 2004-09-22
Posts: 28

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

Hopefully the problem will be corrected:)
Matt Hewitt (maybe after reading this topic) opened a new feature request here: http://bugs.archlinux.org/index.php?do=details&id=2090

Offline

#11 2005-01-31 08:27:47

combo
Member
Registered: 2004-09-22
Posts: 28

Re: lame-3.96.1-2.pkg.tar.gz with MMX/3DNow!/SSE support

Hi!
Yes, the problem has been solved. You can download lame-3.96.1-2.pkg.tar.gz from current (so I may remove my binary from my homepage).
Recommended update.

Offline

Board footer

Powered by FluxBB