public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Bernhard Krug <b.krug@elektronenpumpe.de>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>, newlib@sourceware.org
Subject: Re: [PATCH] libc: arm: setjmp jmp_buf exagerated size
Date: Wed, 15 Feb 2023 17:40:19 +0100	[thread overview]
Message-ID: <7074AE0F-4BFC-48B4-AE8B-DCCA22D0105E@elektronenpumpe.de> (raw)
In-Reply-To: <bf2a0e40-c6ec-ae6d-84b5-22a5e39b7f12@foss.arm.com>

On February 15, 2023 5:12:04 PM GMT+01:00, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote:
>
>
>On 15/02/2023 11:09, Bernhard Krug wrote:
>> Patch sets correct jmp_buf size for armv6-m conforming to implementation in setjmp.S
>> 
>> FYI a table of cortex architectures:
>> __ARM_ARCH_6M__ cortex-m0/m0+/m1 no fpu option
>> __ARM_ARCH_7M__ cortex-m3 no fpu option
>> __ARM_ARCH_7EM__ cortex-m4 optional fpu
>> check using __ARM_FP
>
>I don't think it's as simple as this.  The ABI supports three variants, two of which are call compatible.
>
>hard-float (where you must have hardware FP)
>soft (where you haven't got any hardware FP)
>softfp (where you have hardware FP but need to inter-operate with code that doesnt).
>
>soft and softfp are call compatible and so any jump-bufs created need to support saving and restoring the FP context.
>
>I guess a configure-time option to disable support for softfp might be an option, but the default needs to ensure things are compatible.
>
>R.

As far as I understand the source in setjmp.S in the case of armv6-m it is.
Looking in the source 
https://github.com/bminor/newlib/blob/master/newlib/libc/machine/arm/setjmp.S#L89
How I read this: It will never copy more than ten registers because of the exclusive #if #else ...

But okay let it be 20 registers.
Then does it have to be "long long" only for special chips that use wider registers in their FPU?

Then I'll hope for a decision-tree ARM_ARCH_xy ARM_FP ARM_NEON in the future :)

  reply	other threads:[~2023-02-15 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 22:47 Bernhard Krug
2023-02-15 11:09 ` [PATCH] " Bernhard Krug
2023-02-15 15:56   ` Bernhard Krug
2023-02-15 16:05   ` Bernhard Krug
2023-02-15 16:12   ` Richard Earnshaw
2023-02-15 16:40     ` Bernhard Krug [this message]
2023-02-15 17:01       ` Richard Earnshaw
2023-02-15 17:14         ` Bernhard Krug

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=7074AE0F-4BFC-48B4-AE8B-DCCA22D0105E@elektronenpumpe.de \
    --to=b.krug@elektronenpumpe.de \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=newlib@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).