|
From: John R.
|
The changes to support fxrstor on x86 have misleading comments.
I prefer also to use symbols instead of bare constants.
Note that in two places FP_TAG_VALID should be specialized
to account for the possiblity of FP_TAG_ZERO and FP_TAG_SPEC.
+static enum { // codes in Intel x87 hardware FPU Tag Word
+ FP_TAG_VALID, // 0
+ FP_TAG_ZERO, // 1
+ FP_TAG_SPEC, // 2 infinity, NaN, denormal, unsupported
+ FP_TAG_EMPTY // 3
+};
- if (tag == 3) {
+ if (tag == FP_TAG_EMPTY) {
- tagw |= (3 << (2*preg));
+ tagw |= (FP_TAG_EMPTY << (2*preg));
- tagw |= (0 << (2*preg));
+ tagw |= (FP_TAG_VALID << (2*preg)); // FIXME: not precise
for (r = 0; r < 8; r++) {
if (addrC[4] & (1<<r)) // fxsave convention for NOT Empty
- fp_tags |= (0 << (2*r)); /* EMPTY */
+ fp_tags |= (FP_TAG_VALID << (2*r)); // FIXME: not precise
else
- fp_tags |= (3 << (2*r)); /* VALID -- not really precise enough. */
+ fp_tags |= (FP_TAG_EMPTY << (2*r));
}
--
John Reiser, jreiser@BitWagon.com
|