[opensuse-packaging] MMX/SSE in i586 packages
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Samstag, 12. Februar 2011, 22:38:05 schrieb Cristian Morales Vega:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
If it is for a i586.rpm, you need to patch it in any case to not use these flags. Because the binaries would not be runable on a i586 system. If these optimizations would speed up the code (this is not the case for most packages), you may build the libs a second time and put them below /usr/lib/sse2 directory (sse3 path is afaik not yet supported). The dynamic linker will look there first, if the hardware supports it. So the package is still runable on plain i586, but uses performance boost on newer 32bit hardware. (However, one could argue that fast systems are anyway 64bit these days and it is not worth the hazzle ...) bye adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am 14.02.2011 09:16, schrieb Adrian Schröter:
Am Samstag, 12. Februar 2011, 22:38:05 schrieb Cristian Morales Vega:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
If it is for a i586.rpm, you need to patch it in any case to not use these flags. Because the binaries would not be runable on a i586 system.
If these optimizations would speed up the code (this is not the case for most packages), you may build the libs a second time and put them below
/usr/lib/sse2
directory (sse3 path is afaik not yet supported). The dynamic linker will look there first, if the hardware supports it.
So the package is still runable on plain i586, but uses performance boost on newer 32bit hardware. (However, one could argue that fast systems are anyway 64bit these days and it is not worth the hazzle ...)
BTW. Can wrong usage of those flags be detected via post-build-checks or rpmlint? I could imagine that they may be used w/o being noticed by the packager. Wolfgang -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Montag, 14. Februar 2011, 09:23:43 schrieb Wolfgang Rosenauer:
Am 14.02.2011 09:16, schrieb Adrian Schröter:
Am Samstag, 12. Februar 2011, 22:38:05 schrieb Cristian Morales Vega:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
If it is for a i586.rpm, you need to patch it in any case to not use these flags. Because the binaries would not be runable on a i586 system.
If these optimizations would speed up the code (this is not the case for most packages), you may build the libs a second time and put them below
/usr/lib/sse2
directory (sse3 path is afaik not yet supported). The dynamic linker will look there first, if the hardware supports it.
So the package is still runable on plain i586, but uses performance boost on newer 32bit hardware. (However, one could argue that fast systems are anyway 64bit these days and it is not worth the hazzle ...)
BTW. Can wrong usage of those flags be detected via post-build-checks or rpmlint? I could imagine that they may be used w/o being noticed by the packager.
We could parse the gcc command lines at least, like we parse the gcc output messages. The problem is to handle this. If we make this an error, code which handles the the problem at runtime can't get build anymore. And if don't make this an error, no one will notice it ;) Even disassembling the binaries in /usr/lib/ and matching for the calls would not be enough, because there might be a condition around it ... So, I dunno how to add such a check in a trivial way ... bye adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
El 12/02/11 18:38, Cristian Morales Vega escribió:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
Yoy could also create a 686 package and be done with it, like the glibc ones. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Montag, 14. Februar 2011, 11:53:15 schrieb Cristian Rodríguez:
El 12/02/11 18:38, Cristian Morales Vega escribió:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
Yoy could also create a 686 package and be done with it, like the glibc ones.
i686 must neither use SSE by default, because the PentiumPro did not have it either. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Mon, 14 Feb 2011, Adrian Schröter wrote:
Am Montag, 14. Februar 2011, 11:53:15 schrieb Cristian Rodríguez:
El 12/02/11 18:38, Cristian Morales Vega escribió:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
Yoy could also create a 686 package and be done with it, like the glibc ones.
i686 must neither use SSE by default, because the PentiumPro did not have it either.
These all are good advices for the core distro. Caring for pure i586 or i686 for addon packages, where the author explicitely wanted to enable sse path (presumably for speed), is not really necessary. We'd have to know which package this was. If it is anything remotely having a connection with math, graphics, sound, or generally is a leaf package, I say, leave SSE in. There simply are no non-SSE capable CPUs anymore on which you'd want to run such type of software (that's the difference to core parts, infrastructure and server software, which conceivably some people like to run on old, Cyrix or transmeta hardware). Ciao, Michael.
On Mon, 14 Feb 2011, Michael Matz wrote:
Hi,
On Mon, 14 Feb 2011, Adrian Schröter wrote:
Am Montag, 14. Februar 2011, 11:53:15 schrieb Cristian Rodríguez:
El 12/02/11 18:38, Cristian Morales Vega escribió:
I have a program with a build system that adds "-mfpmath=sse -msse" to the CFLAGS. What do you think, should I patch it? And if it used -mmmx (gcc calls "i586" to a Pentium without MMX)?
Yoy could also create a 686 package and be done with it, like the glibc ones.
i686 must neither use SSE by default, because the PentiumPro did not have it either.
These all are good advices for the core distro. Caring for pure i586 or i686 for addon packages, where the author explicitely wanted to enable sse path (presumably for speed), is not really necessary.
We'd have to know which package this was. If it is anything remotely having a connection with math, graphics, sound, or generally is a leaf package, I say, leave SSE in. There simply are no non-SSE capable CPUs anymore on which you'd want to run such type of software (that's the difference to core parts, infrastructure and server software, which conceivably some people like to run on old, Cyrix or transmeta hardware).
I wonder if we can have rpm "dependencies" on HW capabilities? Richard. -- Richard Guenther <rguenther@suse.de> Novell / SUSE Labs SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex
participants (6)
-
Adrian Schröter
-
Cristian Morales Vega
-
Cristian Rodríguez
-
Michael Matz
-
Richard Guenther
-
Wolfgang Rosenauer