public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* cpu_has_fxsr or cpu_has_xmm?
@ 2001-02-23  5:38 Quim K Holland
  2001-02-23  6:11 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Quim K Holland @ 2001-02-23  5:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, alan

I've been looking at various -ac patches for the last couple of 
weeks and have been wondering why only this piece of difference
still remains between Linus' 2.4.2 and Alan's -ac2.  All the other
diffs in i387.c from 2.4.1-ac2 seem to have been merged into Linus
tree at around 2.4.2-pre1.  Could anybody explain it for me please?

--- linux.vanilla/arch/i386/kernel/i387.c       Thu Feb 22 09:05:35 2001
+++ linux.ac/arch/i386/kernel/i387.c    Sun Feb  4 10:58:36 2001
@@ -179,7 +179,7 @@
 
 unsigned short get_fpu_mxcsr( struct task_struct *tsk )
 {
-       if ( cpu_has_fxsr ) {
+       if ( cpu_has_xmm ) {
                return tsk->thread.i387.fxsave.mxcsr;
        } else {
                return 0x1f80;


------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: cpu_has_fxsr or cpu_has_xmm?
@ 2001-02-23 20:51 Quim K Holland
  2001-02-23 21:44 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Quim K Holland @ 2001-02-23 20:51 UTC (permalink / raw)
  To: dledford; +Cc: hpa, linux-kernel

>>>>> "DL" == Doug Ledford <dledford@redhat.com> writes:
>> > --- linux.vanilla/arch/i386/kernel/i387.c       Thu Feb 22 09:05:35 2001
>> > +++ linux.ac/arch/i386/kernel/i387.c    Sun Feb  4 10:58:36 2001
>> > @@ -179,7 +179,7 @@
>> >
>> >  unsigned short get_fpu_mxcsr( struct task_struct *tsk )
>> >  {
>> > -       if ( cpu_has_fxsr ) {
>> > +       if ( cpu_has_xmm ) {
>> >                 return tsk->thread.i387.fxsave.mxcsr;
>> >         } else {
>> >                 return 0x1f80;
>> >

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?


------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-02-23 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-23  5:38 cpu_has_fxsr or cpu_has_xmm? Quim K Holland
2001-02-23  6:11 ` H. Peter Anvin
2001-02-23 11:23   ` Doug Ledford
  -- strict thread matches above, loose matches on Subject: below --
2001-02-23 20:51 Quim K Holland
2001-02-23 21:44 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox