Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Justin Carlson <carlson@sibyte.com>
To: Pete Popov <ppopov@mvista.com>
Cc: linux-mips@oss.sgi.com <linux-mips@oss.sgi.com>
Subject: Re: floating point on Nevada cpu
Date: Wed, 24 Jan 2001 18:57:04 -0800	[thread overview]
Message-ID: <0101241913291R.00834@plugh.sibyte.com> (raw)
In-Reply-To: <3A6F94E0.4AB07CEB@mvista.com>

On Wed, 24 Jan 2001, you wrote:
> Justin Carlson wrote:
> > 
> > On Wed, 24 Jan 2001, Pete Popov wrote:
> > > This simple test fails on a Nevada (5231) cpu:
> > >
> > > int main()
> > > {
> > >     float x1,x2,x3;
> > >
> > >     x1 = 7.5;
> > >     x2 = 2.0;
> > >     x3 = x1/x2;
> > >     printf("x3 = %f\n", x3);
> > > }
> > >
> > 
> > Ummm...care to tell *how* it fails?
> 
> Here it is:
> 
> sh-2.03# ./fl
> x3 = 0.000000
> 
> 
> I'm running a test9 based kernel, but the same kernel compiled for my
> Indigo2 produces the right result.  

Hmmm...the only thing here that should involve kernel support is the lazy FPU
register saving.   I'm not terribly familiar with that portion of the kernel,
but it should take an unimplemented instruction trap on the first fpu op, set
up a flag for saving FP state on context switches, enable the FPU, then let the
program run.  From what I *have* seen of that code, it's shared between many
processors; doesn't seem like a likely candidate for such a simple problem.

If you compile that code snippet and optimize it with gcc, you actually won't
invoke any fpu ops, as gcc is smart enough to precalculate the result, and
just load that before jumping to printf().

How are you compiling the code?  And are you compiling it the same way on both
platforms?  Do you have fpu emulation enabled on a kernel that doesn't need it? 

These are the potential problems that jump to mind...

-Justin

WARNING: multiple messages have this Message-ID (diff)
From: Justin Carlson <carlson@sibyte.com>
To: Pete Popov <ppopov@mvista.com>
Cc: linux-mips@oss.sgi.comlinux-mips@oss.sgi.com
Subject: Re: floating point on Nevada cpu
Date: Wed, 24 Jan 2001 18:57:04 -0800	[thread overview]
Message-ID: <0101241913291R.00834@plugh.sibyte.com> (raw)
Message-ID: <20010125025704.zCLe1nQsklAghSTlDb3r3WdpUB2arTuMQoHOXLinQfM@z> (raw)
In-Reply-To: <3A6F94E0.4AB07CEB@mvista.com>

On Wed, 24 Jan 2001, you wrote:
> Justin Carlson wrote:
> > 
> > On Wed, 24 Jan 2001, Pete Popov wrote:
> > > This simple test fails on a Nevada (5231) cpu:
> > >
> > > int main()
> > > {
> > >     float x1,x2,x3;
> > >
> > >     x1 = 7.5;
> > >     x2 = 2.0;
> > >     x3 = x1/x2;
> > >     printf("x3 = %f\n", x3);
> > > }
> > >
> > 
> > Ummm...care to tell *how* it fails?
> 
> Here it is:
> 
> sh-2.03# ./fl
> x3 = 0.000000
> 
> 
> I'm running a test9 based kernel, but the same kernel compiled for my
> Indigo2 produces the right result.  

Hmmm...the only thing here that should involve kernel support is the lazy FPU
register saving.   I'm not terribly familiar with that portion of the kernel,
but it should take an unimplemented instruction trap on the first fpu op, set
up a flag for saving FP state on context switches, enable the FPU, then let the
program run.  From what I *have* seen of that code, it's shared between many
processors; doesn't seem like a likely candidate for such a simple problem.

If you compile that code snippet and optimize it with gcc, you actually won't
invoke any fpu ops, as gcc is smart enough to precalculate the result, and
just load that before jumping to printf().

How are you compiling the code?  And are you compiling it the same way on both
platforms?  Do you have fpu emulation enabled on a kernel that doesn't need it? 

These are the potential problems that jump to mind...

-Justin

  reply	other threads:[~2001-01-25  3:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-25  2:28 floating point on Nevada cpu Pete Popov
2001-01-25  2:33 ` Justin Carlson
2001-01-25  2:52   ` Pete Popov
2001-01-25  2:57     ` Justin Carlson [this message]
2001-01-25  2:57       ` Justin Carlson
2001-01-25  3:05   ` Pete Popov
2001-01-25  3:16     ` Justin Carlson
2001-01-25 14:54       ` Steve Johnson
2001-01-25 18:02         ` Pete Popov
2001-01-26 10:14           ` Kevin D. Kissell
2001-01-26 10:14             ` Kevin D. Kissell
2001-01-26 13:01             ` Steve Johnson
2001-01-26 13:57               ` Kevin D. Kissell
2001-01-26 13:57                 ` Kevin D. Kissell
2001-01-27 19:16             ` Ralf Baechle
2001-01-27 19:16               ` Ralf Baechle
2001-01-25 17:26       ` Ralf Baechle
2001-01-25 20:01         ` Justin Carlson
2001-01-25 22:12 ` Ralf Baechle
2001-01-26  7:53   ` Carsten Langgaard
  -- strict thread matches above, loose matches on Subject: below --
2001-01-25 17:37 Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0101241913291R.00834@plugh.sibyte.com \
    --to=carlson@sibyte.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=ppopov@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox