FXSAVE / FXRSTOR

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

FXSAVE / FXRSTOR

Post by Candy »

These instructions have a lot of reserved and "ignored" space in their storage area. Does anybody know if I can use them for own purposes (thread state) or whether they do overwrite (or at least, invalidate) it?

TIA
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:FXSAVE / FXRSTOR

Post by Solar »

Rule #1 when working with interfaces: Always mask out reserved space. That space is reserved. By no means use it for your own purpose. You will be sorry later (for example, when later generations of Intel CPUs introduce yet new FPU registers, using previously reserved space and breaking your code).

If Intel reserved space, only Intel must ever use that space.

In the early days of the MC680x0 CPU, when only 24 bits of the 32 bit address registers actually had address lines connected to them, people used the remaining 8 bits for "tricky stuff". Which, of course, broke violently on later, "true" 32 bit CPU generations.
Every good solution is obvious once you've found it.
Post Reply