Re: cpu_has_fxsr or cpu_has_xmm?

H. Peter Anvin (hpa@transmeta.com)
Fri, 23 Feb 2001 13:44:14 -0800


Quim K Holland wrote:
>
> DL> As to the correctness, the mxcsr register really only exists
> DL> if you have xmm, so the xmm is the correct test. However,...
>
> DL> ... User space programmers should be checking for xmm
> DL> capability themselves before ever paying attention to mxcsr
> DL> anyway, so it's not an end of the world error.
>
> If that is the case, wouldn't it be simpler to always return
> tsk->thread.i387.fxsave.mxcsr from this function, and initialize
> that field to 0x1f80 (whatever that magic number means) when
> the structure is built?
>

No, because the CPU *may* overwrite it when you do an FXSAVE.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/