Re: [gentoo-user] USE flags: mmx sse sse2
Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) speaking of manually added options to CFLAGS*, not of use flags The only place where mathematics count on a server is encryption ? (notice the question mark) Mayor part of server software use integer math that are not so enhanced by optimizations. The code produced is less stable, and difficult to debug, this bring to the question: why take the risk ? just my two cents -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
On Friday 13 January 2006 07:45, Francesco Riosa wrote: Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) speaking of manually added options to CFLAGS*, not of use flags The only place where mathematics count on a server is encryption ? (notice the question mark) Mayor part of server software use integer math that are not so enhanced by optimizations. The code produced is less stable, and difficult to debug, this bring to the question: why take the risk ? actually, mmx (MultiMedia eXtensions) , sse and sse2 instructions are designed primarily for multimedia and gaming type applications, which _do_ use floating-point math, and AFAIK, encryption is going to be all-integer too (floating-point math is not perfectly precise) And, like I said earlier, if you put a program with an sse or sse2 instruction on a PII, the program will most likely spontaneously abort when it tries to execute the unsupported instruction. -- # # electronerd, the electronerdian from electronerdia # pgpi1Bf5sd8ou.pgp Description: PGP signature
Re: [gentoo-user] USE flags: mmx sse sse2
Actually, mmx doesn't really mean anything: http://en.wikipedia.org/wiki/MMX mplayer and the X server gain performance by using these extensions (mmx, sse, sse2). One of the reasons why X is much faster in Gentoo than in Debian. (Personal Experience, please, no flames) 2006/1/13, John Myers [EMAIL PROTECTED]: On Friday 13 January 2006 07:45, Francesco Riosa wrote: Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) speaking of manually added options to CFLAGS*, not of use flags The only place where mathematics count on a server is encryption ? (notice the question mark) Mayor part of server software use integer math that are not so enhanced by optimizations. The code produced is less stable, and difficult to debug, this bring to the question: why take the risk ? actually, mmx (MultiMedia eXtensions) , sse and sse2 instructions are designed primarily for multimedia and gaming type applications, which _do_ use floating-point math, and AFAIK, encryption is going to be all-integer too (floating-point math is not perfectly precise) And, like I said earlier, if you put a program with an sse or sse2 instruction on a PII, the program will most likely spontaneously abort when it tries to execute the unsupported instruction. -- # # electronerd, the electronerdian from electronerdia # -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
On 1/12/06, John Myers [EMAIL PROTECTED] wrote: On Thursday 12 January 2006 18:45, Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) If a program uses an instruction that the processor doesn't support, the program will be sent SIGILL, the default action of which is to terminate immediately. Are you absolutely positive of that? I *thought* (would have thought) compilers these days would compile in conditional use of such instructions? That way if large blocks could benefit from these new instructions, they would use them, otherwise fall back to a common set of instructions. Of course this wouldn't be very beneficial for small sections of code. I've been wondering about this for quite some time though, but never bothered to investigate. -- # # electronerd, the electronerdian from electronerdia # -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
On 1/13/06, Raphael Melo de Oliveira Bastos Sales [EMAIL PROTECTED] wrote: Actually, mmx doesn't really mean anything: http://en.wikipedia.org/wiki/MMX mplayer and the X server gain performance by using these extensions (mmx, sse, sse2). One of the reasons why X is much faster in Gentoo than in Debian. (Personal Experience, please, no flames) Yes, MMX is quite an improvement if actually used in code. I once had to squeeze microseconds out of some windows code that I was writing, in order to speed up RS232 communication, and it made a HUGE difference. The code was originally taking a few ms, but I got it down to a few hundred microseconds by using MMX. MMX can operate on 64bit integers, where standard IA32 instructions can only operate on 32bit integers. 2006/1/13, John Myers [EMAIL PROTECTED]: On Friday 13 January 2006 07:45, Francesco Riosa wrote: Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) speaking of manually added options to CFLAGS*, not of use flags The only place where mathematics count on a server is encryption ? (notice the question mark) Mayor part of server software use integer math that are not so enhanced by optimizations. The code produced is less stable, and difficult to debug, this bring to the question: why take the risk ? actually, mmx (MultiMedia eXtensions) , sse and sse2 instructions are designed primarily for multimedia and gaming type applications, which _do_ use floating-point math, and AFAIK, encryption is going to be all-integer too (floating-point math is not perfectly precise) And, like I said earlier, if you put a program with an sse or sse2 instruction on a PII, the program will most likely spontaneously abort when it tries to execute the unsupported instruction. -- # # electronerd, the electronerdian from electronerdia # -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
On Friday 13 January 2006 14:24, Trenton Adams wrote: On 1/12/06, John Myers [EMAIL PROTECTED] wrote: On Thursday 12 January 2006 18:45, Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) If a program uses an instruction that the processor doesn't support, the program will be sent SIGILL, the default action of which is to terminate immediately. Are you absolutely positive of that? I *thought* (would have thought) compilers these days would compile in conditional use of such instructions? That way if large blocks could benefit from these new instructions, they would use them, otherwise fall back to a common set of instructions. Of course this wouldn't be very beneficial for small sections of code. I've been wondering about this for quite some time though, but never bothered to investigate. I'm not _absolutely_ positive, but to do so would likely result in _slower_ code, maybe breaking even occasionally. Using C/C++ as the language: - blocks of multiply-compiled code can be no larger than a single fuction, as the compiler does not know what other functions call that function, and given current build systems, _cannot_ know. Exceptions: inline functions count where the function is inlined, and file-scope (static) functions can be optimized together, but only if they are only called by other file-scope functions, as the compiler can generate a complete list of callers. - the code must be recalculated and duplicated not just for each technology, but for each meaningful and distinct combination of technologies, meaning more conditionals and more branches (and larger code) - code size plays a large role in program performance. Many people report that gcc -Os often gives faster executables than gcc -O3 - How far back do you want to go? Each generation (and brand) of processors adds new technologies and techniques, and the fastest code for one processor may be the slowest for another. -- # # electronerd, the electronerdian from electronerdia # pgpIiINz58oPn.pgp Description: PGP signature
Re: [gentoo-user] USE flags: mmx sse sse2
On Thu, Jan 12, 2006 at 03:09:40PM -0700, Penguin Lover Tom Smith squawked: Are these flags mutually exclusive? I know, for example, that if I have a Pentium II that the MMX flag should apply while the sse and sse2 flags would not. But what if I have a Pentium III or IV? Would I only use the most recent optimization or do I need to add all three to take advantage of each one? I checked the USE flag descriptions and there wasn't anything indicating indicating whether the can or should be used together. Not quite sure how it works officially. But I run a Pentium IV, and I have mmx mmxext sse sse2 enabled, so they are at least NOT mutually exclusive. W -- All science is either physics or stamp collecting. ~Ernest Rutherford Sortir en Pantoufles: up 61 days, 15:40 -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
Certain program have support for either of these extentions. The program will most likely use the best one for the job. They can be mutually exclusive, however, if you use the CFLAG -mfpmath=sse,387. As far as I know it, it will try to use SSE instructions for math where possible, in detriment of using the 387 math co-processor. But this only get any advantage when using AMD64 processors. I never tested it, I just copied what the Gentoo Wiki says about it. ;P 2006/1/12, Willie Wong [EMAIL PROTECTED]: On Thu, Jan 12, 2006 at 03:09:40PM -0700, Penguin Lover Tom Smith squawked: Are these flags mutually exclusive? I know, for example, that if I have a Pentium II that the MMX flag should apply while the sse and sse2 flags would not. But what if I have a Pentium III or IV? Would I only use the most recent optimization or do I need to add all three to take advantage of each one? I checked the USE flag descriptions and there wasn't anything indicating indicating whether the can or should be used together. Not quite sure how it works officially. But I run a Pentium IV, and I have mmx mmxext sse sse2 enabled, so they are at least NOT mutually exclusive. W -- All science is either physics or stamp collecting. ~Ernest Rutherford Sortir en Pantoufles: up 61 days, 15:40 -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) Raphael Melo de Oliveira Bastos Sales wrote: Certain program have support for either of these extentions. The program will most likely use the best one for the job. They can be mutually exclusive, however, if you use the CFLAG -mfpmath=sse,387. As far as I know it, it will try to use SSE instructions for math where possible, in detriment of using the 387 math co-processor. But this only get any advantage when using AMD64 processors. I never tested it, I just copied what the Gentoo Wiki says about it. ;P 2006/1/12, Willie Wong [EMAIL PROTECTED]: On Thu, Jan 12, 2006 at 03:09:40PM -0700, Penguin Lover Tom Smith squawked: Are these flags mutually exclusive? I know, for example, that if I have a Pentium II that the MMX flag should apply while the sse and sse2 flags would not. But what if I have a Pentium III or IV? Would I only use the most recent optimization or do I need to add all three to take advantage of each one? I checked the USE flag descriptions and there wasn't anything indicating indicating whether the can or should be used together. Not quite sure how it works officially. But I run a Pentium IV, and I have mmx mmxext sse sse2 enabled, so they are at least NOT mutually exclusive. W -- All science is either physics or stamp collecting. ~Ernest Rutherford Sortir en Pantoufles: up 61 days, 15:40 -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] USE flags: mmx sse sse2
On Thursday 12 January 2006 18:45, Tom Smith wrote: Well, if they're /not/ mutually exclusive, another question that comes up is... If a program is compiled with sse or sse2 support on a Pentium II, will the program run slower than it otherwise would? (Some of the programs I have are compiled and then distributed to servers with different CPUs--P-IIs and P-IVs, mainly.) If a program uses an instruction that the processor doesn't support, the program will be sent SIGILL, the default action of which is to terminate immediately. -- # # electronerd, the electronerdian from electronerdia # pgpbNYmSW7dGu.pgp Description: PGP signature