When do you consider an opcode safe to use ?

Bare metal programming in PureBasic, for experienced users
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

When do you consider an opcode safe to use ?

Post 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.
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

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

Post 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.
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

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

Post 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
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

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

Post by wilbert »

xorc1zt wrote:99% for sse3 (2004) but only 51% for sse4 (2006)
Thanks. Nice to know this kind of information :)
Post Reply