SIMD intrinsics

BlitzMax Forums/BlitzMax NG/SIMD intrinsics

Azathoth(Posted 2017) [#1]
The source shows they will only be compiled for x64. Can they be used in 32-bit x86?

Derron(Posted 2017) [#2]
Couldn't you adjust the make.bmk and check what happens?

Sorry am not knowing much about all these things so just suggesting it + googling.


zzz(Posted 2017) [#3]
Note that some older versions of windows dont support simd. Hardware functionality might be there, but if the operating system dont preserve registers on context switching you will be in for some fun.

EDIT: Disregard the last part, there is a os-agnostic mechanic preventing this, so your applications should bomb out immediately for illegal instructions if the os its running on have not declared support for whatever extension you end up using.

Derron(Posted 2017) [#4]
which versions of windows should that be?


zzz(Posted 2017) [#5]
avx was patched in for windows 7 (sp1 maybe?), sse should be in a varying state of support for the earlier versions depending on how updated the os install is, and which iteration of sse you are using.

x86-64 guarantees at least sse2, which is probably why Brucey set it up like that.

Azathoth(Posted 2017) [#6]
SSE2 first appeared in the Intel Pentium 4 in 2001 and AMD a couple years later. From what I can tell AVX isn't supported by the compiler.

Brucey(Posted 2017) [#7]
Can they be used in 32-bit x86?

Are they all available for 32-bit? If so, I can change it to work for both x86 and x64.

Azathoth(Posted 2017) [#8]
From what I can tell right up to SSE3 are available on some 32-bit processors.

32-bit mode on a x64 processor still has access to the all SIMD instructions but not the extra registers.

zzz(Posted 2017) [#9]
If the hardware has support for it shouldnt matter if the software was compiled for x86 or x64. SSE1/2 should be *very* commonplace today, so might be worth considering.

FireballStarfish(Posted 2017) [#10]
Maybe it would make sense to split the module into separate ones for the individual SSE versions to deal with compatibility?