public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org
To: ecos-patches@ecos.sourceware.org
Subject: [Bug 1001607] Cortex-M4F architectural Floating Point Support
Date: Wed, 06 Feb 2013 23:02:00 -0000	[thread overview]
Message-ID: <bug-1001607-104-fiQ1SB1wNu@http.bugs.ecos.sourceware.org/> (raw)
In-Reply-To: <bug-1001607-104@http.bugs.ecos.sourceware.org/>

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001607

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1999|0                           |1
        is obsolete|                            |

--- Comment #47 from Ilija Kocho <ilijak@siva.com.mk> ---
Created attachment 2075
  --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2075&action=edit
Alternative Cortex-M4F FPU support with Lazy Stacking 130206

Jifl

I did a backport of the code described in comment 42. The attached code should
patch onto current CVS, but it is for illustration only so many improvements in
CDL and GDB stub refined during our discussion are not implemented.

To start with, there are two aspects of Lazy state saving:
  - Context saving during exceptions. As you have noted Cortex-M features a
lazy FPU state saving. I shall call it Lazy Stacking - LS
  - Thread Context Switching that is implemented in context.S. I shall call it
Lazy Thread Switching - LTS

The attached code does both LS and LTS, unlike my "official proposal"
(currently attachment 1991) that does LTS exclusively.

First some comparative measurements of thread switching delay:

1. The (proposed) FPU disabling scheme - LTS only (LS-less)

Testing parameters:
   Thread switches:              128
   Time unit:         nanoseconds [ns]
                                 Confidence
     Ave     Min     Max Max-Min  Ave  Min  Samp  Function
  ======  ======  ======  ====== ==== ===== ===== ========
    2016    2016    2016       0  100% 100%   127 Thread switch: int-int
    2392    2392    2392       0  100% 100%   127 Thread switch: int-fpu
    2312    2312    2312       0  100% 100%   127 Thread switch: fpu-int
    2688    2688    2688       0  100% 100%   127 Thread switch: fpu-fpu
PASS:<Thread switching OK>
EXIT:<done>

2. Scheme with LS in addition to LTS

Testing parameters:
   Thread switches:              128
   Time unit:         nanoseconds [ns]
                                 Confidence
     Ave     Min     Max Max-Min  Ave  Min  Samp  Function
  ======  ======  ======  ====== ==== ===== ===== ======== 
    2088    2088    2088       0  100% 100%   127 Thread switch: int-int
    2432    2432    2432       0  100% 100%   127 Thread switch: int-fpu   
    2408    2408    2408       0  100% 100%   127 Thread switch: fpu-int
    2752    2752    2752       0  100% 100%   127 Thread switch: fpu-fpu
PASS:<Thread switching OK>
EXIT:<done>                                                            

As I mentioned in comment 42, itshows that LS-less code provides faster thread
switching. These measurements don't show interrupt processing times, but if you
compare the respective vectors.S files you can deduce that processing of
pendable SVC takes more time for LS code.

We can of course consider trading of processor time for having LS feature, but
I really find FPU usage in ISR academic. I understand and respect that ARM
fellows spent a great effort to provide us with LS but other than that I see no
practical reason to burn CPU cycles for something that very few, if any, would
want to use.

The attached code, also has a flaw that is described in comment 42 point 3. I
have developed a test that I will attach later. In order to fix this issue we
have to put more tests, at least 1 that will add more delay to context
switching.

Considering this, back then I did decide to omit FPU context saving for
exceptions. If there is a demand for FPU arithmetic we can consider it in
future _as option_ but for the time being I would say that we go with my
original proposal (LS-less).

Ilija

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2013-02-06 23:02 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-03 12:57 [Bug 1001607] New: " bugzilla-daemon
2012-06-03 12:58 ` [Bug 1001607] " bugzilla-daemon
2012-06-03 12:59 ` bugzilla-daemon
2012-06-03 13:04 ` bugzilla-daemon
2012-06-03 13:05 ` bugzilla-daemon
2012-06-03 13:06 ` bugzilla-daemon
2012-06-03 14:22 ` bugzilla-daemon
2012-06-03 16:22 ` bugzilla-daemon
2012-06-06  6:33 ` bugzilla-daemon
2012-06-10 20:56 ` bugzilla-daemon
2012-06-22  4:56 ` bugzilla-daemon
2012-06-24 15:01 ` bugzilla-daemon
2012-06-28  7:41 ` bugzilla-daemon
2012-07-01  4:23 ` bugzilla-daemon
2012-07-08 16:51 ` bugzilla-daemon
2012-07-08 16:52 ` bugzilla-daemon
2012-07-08 16:53 ` bugzilla-daemon
2012-08-07  5:56 ` bugzilla-daemon
2012-08-07  5:57 ` bugzilla-daemon
2012-08-08 16:49 ` bugzilla-daemon
2012-08-08 17:14 ` bugzilla-daemon
2012-08-08 18:01 ` bugzilla-daemon
2012-08-08 19:28 ` bugzilla-daemon
2012-08-09  4:03 ` bugzilla-daemon
2012-08-09 10:12 ` bugzilla-daemon
2012-08-10 18:09 ` bugzilla-daemon
2012-08-10 18:14 ` bugzilla-daemon
2012-08-12 11:05 ` bugzilla-daemon
2012-08-29 19:34 ` bugzilla-daemon
2012-08-29 19:36 ` bugzilla-daemon
2012-08-29 19:37 ` bugzilla-daemon
2012-08-31 18:40 ` bugzilla-daemon
2012-08-31 18:42 ` bugzilla-daemon
2012-10-09 19:33 ` bugzilla-daemon
2012-11-06 20:54 ` bugzilla-daemon
2012-11-06 20:56 ` bugzilla-daemon
2012-11-06 20:57 ` bugzilla-daemon
2012-12-02 20:15 ` bugzilla-daemon
2012-12-02 20:18 ` bugzilla-daemon
2012-12-02 20:20 ` bugzilla-daemon
2012-12-02 20:21 ` bugzilla-daemon
2012-12-13  5:37 ` bugzilla-daemon
2012-12-16 15:51 ` bugzilla-daemon
2012-12-17  4:02 ` bugzilla-daemon
2012-12-17 14:05 ` bugzilla-daemon
2012-12-17 15:30 ` bugzilla-daemon
2012-12-21 13:42 ` bugzilla-daemon
2012-12-21 13:53 ` bugzilla-daemon
2013-02-06 21:29 ` bugzilla-daemon
2013-02-06 23:02 ` bugzilla-daemon [this message]
2013-02-06 23:08 ` bugzilla-daemon
2013-02-07  9:47 ` bugzilla-daemon
2013-02-07 21:52 ` bugzilla-daemon
2013-02-07 21:57 ` bugzilla-daemon
2013-02-07 21:59 ` bugzilla-daemon
2013-02-07 22:00 ` bugzilla-daemon
2013-02-09  2:08 ` bugzilla-daemon
2013-02-10 12:33 ` bugzilla-daemon
2013-02-10 17:30 ` bugzilla-daemon
2013-02-10 17:34 ` bugzilla-daemon
2013-02-16 14:34 ` bugzilla-daemon
2013-02-20  3:21 ` bugzilla-daemon
2013-03-07  0:16 ` bugzilla-daemon
2013-03-07  0:17 ` bugzilla-daemon
2013-03-07  0:18 ` bugzilla-daemon
2013-03-07  0:19 ` bugzilla-daemon
2013-03-07  1:46 ` bugzilla-daemon
2013-03-08 15:09 ` bugzilla-daemon
2013-03-09 22:49 ` bugzilla-daemon
2013-03-12 22:42 ` bugzilla-daemon

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=bug-1001607-104-fiQ1SB1wNu@http.bugs.ecos.sourceware.org/ \
    --to=bugzilla-daemon@bugs.ecos.sourceware.org \
    --cc=ecos-patches@ecos.sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).