User exception handler in C (Developers)
> It would be also cool to test in this way the SSE instruction.
> The SSE must be supported by hardware (can be obtained with CPUID) but also
> switched on by software by privileged instruction (MOV CR4,???)
Let the OS (or DOS extender, in this case) enable it for you. That means DOS/32A, Causeway 4.x, HDPMI32, or CWSDPMI (r5 2008 or r7). Or whatever Win9x or WinNT versions.
Honestly, it may not be any faster than plain MMX, so it may not be worth your time. (Depends on cpu.)
> So the elegant way how to obtain the SSE is to check the CPUID status and
> then set the exception handler and just to try to call some.
sse_supported:
fxsave [xmm_save]
mov dword ptr [xmm_save+160],"C0DE"
fxrstor [xmm_save]
mov dword ptr [xmm_save+160],"D00D"
fxsave [xmm_save]
cmp dword ptr [xmm_save+160],"C0DE"
mov eax,0
jnz sse_supported_bye
inc al ; if OSFXSR not turned on,
sse_supported_bye: ; XMM* are not saved
ret
So you can indeed know if running under old CWSDPMI (r5 2000) without SSE support and then fallback to MMX only. (Unless your BIOS enables it for you. One guy said his did, but none of mine did.)
Complete thread:
- User exception handler in C - RayeR, 24.07.2020, 13:15 (Developers)
- User exception handler in C - Japheth, 24.07.2020, 18:07
- User exception handler in C - Rugxulo, 24.07.2020, 18:39
- User exception handler in C - tkchia, 24.07.2020, 20:47
- User exception handler in C - RayeR, 30.07.2020, 13:18
- User exception handler in C - tom, 30.07.2020, 23:54
- User exception handler in C - RayeR, 01.08.2020, 02:13
- User exception handler in C - Laaca, 16.08.2020, 21:27
- User exception handler in C - Laaca, 16.08.2020, 22:38
- User exception handler in C - Rugxulo, 17.08.2020, 22:35
- User exception handler in C - marcov, 18.08.2020, 12:23
- User exception handler in C - Laaca, 18.08.2020, 20:15
- User exception handler in C - Rugxulo, 19.08.2020, 19:44
- User exception handler in C - Laaca, 19.08.2020, 21:50
- User exception handler in C - Rugxulo, 23.08.2020, 17:32
- User exception handler in C - Japheth, 23.08.2020, 20:36
- User exception handler in C - Rugxulo, 23.08.2020, 17:32
- User exception handler in C - Laaca, 19.08.2020, 21:50
- User exception handler in C - Rugxulo, 19.08.2020, 19:44
- User exception handler in C - Laaca, 18.08.2020, 20:15
- User exception handler in C - marcov, 18.08.2020, 12:23
- User exception handler in C - Rugxulo, 17.08.2020, 22:35
- User exception handler in C - Rugxulo, 17.08.2020, 22:26
- User exception handler in C - tkchia, 19.08.2020, 18:52
- User exception handler in C - marcov, 20.08.2020, 00:00
- User exception handler in C - Laaca, 20.08.2020, 15:31
- User exception handler in C - marcov, 20.08.2020, 00:00
- User exception handler in C - Laaca, 16.08.2020, 22:38
- User exception handler in C - Laaca, 16.08.2020, 21:27
- User exception handler in C - RayeR, 01.08.2020, 02:13
- User exception handler in C - tkchia, 31.07.2020, 19:36
- User exception handler in C - RayeR, 01.08.2020, 02:16
- User exception handler in C - tom, 30.07.2020, 23:54
- User exception handler in C - RayeR, 30.07.2020, 13:18
- User exception handler in C - Guti, 27.07.2020, 08:22