Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

SSE instructions in DOS programs? (Developers)

posted by RayeR(R) Homepage, CZ, 03.01.2019, 14:39

Aha, here is better description:
CR4.OSFXSR (bit 9)

Enables 128-bit SSE support. When clear, most SSE instructions will cause an invalid opcode, and FXSAVE and FXRSTOR will only include the legacy FPU state. When set, SSE is allowed and the XMM and MXCSR registers are accessible, which also means that your OS should maintain those additional registers. Trying to set this bit on a CPU without SSE will cause an exception, so you should check for SSE (or long mode) support first.


Enables the #XF exception. When clear, SSE will work until an exception is generated, after which all SSE instructions will fail with an invalid opcode. When set, the exception handler is called instead and the problem may be diagnosed and reported. Again, you can't set this bit without ensuring SSE support is present

So you MUST enable bit 9 but MAY not enable bit 10. Of course check CPUID first before touching this (and check for CPUID itself on 386 :).

DOS gives me freedom to unlimited HW access.


Complete thread:

Back to the forum
Board view  Mix view
15891 Postings in 1469 Threads, 269 registered users, 91 users online (0 registered, 91 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum