Page 1 of 1

When do you consider an opcode safe to use ?

Posted: Thu Mar 01, 2012 1:56 pm
by wilbert
I was just wondering ...
How long after the introduction of an opcode (MMX / SSE / SSE2 etc.) would you consider it 'safe' to use ?
With that I mean that you can expect most computers will support it.

Re: When do you consider an opcode safe to use ?

Posted: Thu Mar 01, 2012 2:59 pm
by Thorium
Actualy you shoudnt. You should allways test if the instruction set extension is available on the CPU. After all they are optional and not all CPU's have them all. Its possible for example that a CPU supports SSE2 but not MMX because MMX is basicly outdated and replaced by SSE2. There are VIA x86 CPUs that do support some but not all.

Re: When do you consider an opcode safe to use ?

Posted: Thu Mar 01, 2012 7:19 pm
by xorc1zt
valve is doing a monthly survey with his software steam. You must keep in mind that steam users are gamers who upgrade their hardware.

http://store.steampowered.com/hwsurvey
FCMOV 100.00% 0.00%
SSE2 99.76% 0.00%
SSE3 99.05% +0.11%
NTFS 93.81% -0.03%
SSE4.1 51.26% +0.73%
SSE4.2 25.64% +1.10%
HyperThreading 22.00% +1.00%
SSE4a 16.06% +0.19%
99% for sse3 (2004) but only 51% for sse4 (2006)

Id Software made a virtual SIMD processor to handle dynamically those extensions, a nice c++ code. the source is released under GPL :

https://github.com/id-Software/DOOM-3/t ... idlib/math

Re: When do you consider an opcode safe to use ?

Posted: Thu Mar 01, 2012 10:02 pm
by wilbert
xorc1zt wrote:99% for sse3 (2004) but only 51% for sse4 (2006)
Thanks. Nice to know this kind of information :)