linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Given <dg@tao-group.com>
To: linuxppc-dev@lists.linuxppc.org
Subject: Strange FPU/threads problem
Date: Tue, 20 Nov 2001 18:16:35 +0000	[thread overview]
Message-ID: <0111201816350A.15049@pearl> (raw)


Context: PowerMac 8200/120, 601 processor, stock kernel 2.4.12, libc 2.2.4,
gcc 2.95.4, Debian woodyish.

I'm finding something really weird is going on with my program. It works like
this:

I can compile the program either to use threads, or not to use threads. If I
compile it so it *doesn't* use threads, it works fine.

However, if I compile it so that it *does* use threads, it bails with a
SIGFPE the first time in encounters a floating point instruction. And I don't
know why.

What's happening is that my code is shuffling long longs around, and gcc is
using the FPU as a fast way of doing this. The exact code is:

    C81F0008 0FE24468 lfd f0, 8 (r31)
    D81F0028 0FE2446C stfd f0, 40 (r31)

I've determined that the code is being executed in the primary process; that
is, it hasn't spawned any threads yet. The memory that's being pointed to is
valid.

The FP bit in the MSR is unset, so the processor thinks I'm not using the
FPU. But this should be perfectly normal, as my understanding of the kernel
suggests that it uses lazy FP setting. The kernel should hook the trap and
silently enable the FPU for me. But it's not.

I suspect that this may be a kernel bug. Any ideas?

--
David Given
dg@tao-group.com

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

             reply	other threads:[~2001-11-20 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-20 18:16 David Given [this message]
2001-11-23 17:08 ` Strange FPU/threads problem David Given
2001-11-23 19:24   ` Gabriel Paubert

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=0111201816350A.15049@pearl \
    --to=dg@tao-group.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /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;
as well as URLs for NNTP newsgroup(s).