From: gilles.chanteperdrix@xenomai.org (Gilles Chanteperdrix)
To: linux-arm-kernel@lists.infradead.org
Subject: Questions about FPU and NEON on Cortex-A9 with armv7 instructions!
Date: Wed, 28 Jul 2010 11:31:43 +0200 [thread overview]
Message-ID: <4C4FF8FF.304@xenomai.org> (raw)
In-Reply-To: <AANLkTikHns6tdbVK-CDoiv10V-pHaYFf0AvB5s=ti9k5@mail.gmail.com>
David Yang wrote:
> Hi,Martin
>
> I see.
>
> But I will try to use FPU in kernel for testing. I hope kernel won't crash.
You will not get FPU working in kernel-space without any effort. The
kernel handles lazy switching of FPU context for user-space tasks, but
not for the kernel itself. If you start using the FPU at any place in
the kernel, the changes you made would clobber the FPU context of the
user-space task currently running, which is probably not what you want.
What you will have to do is what the x86 kernel does in the RAID code
for instance (file drivers/md/raid6mmx.c), disable preemption, save the
fpu context, do your computations, then restore the fpu context and
re-enable preemption. For the operation to be worth it, the gain you
obtain by using the FPU has to be greater than the time for an fpu
context save and restore, and saving/restoring the fpu context is a
pretty heavy operation. This means that if you want the FPU for a
multiplication or a division, forget it, you will actually be loosing
time, and soft-float will be more efficient.
--
Gilles.
next prev parent reply other threads:[~2010-07-28 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 6:19 Questions about FPU and NEON on Cortex-A9 with armv7 instructions! David Yang
2010-07-28 8:57 ` Martin Guy
2010-07-28 9:16 ` David Yang
2010-07-28 9:31 ` Gilles Chanteperdrix [this message]
2010-07-28 10:06 ` David Yang
2010-07-28 10:45 ` Gilles Chanteperdrix
2010-07-28 10:46 ` Arnd Bergmann
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=4C4FF8FF.304@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=linux-arm-kernel@lists.infradead.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).