public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Andreas Schwab <schwab@suse.de>,
	"libstdc++" <libstdc++@gcc.gnu.org>,
	 gcc-patches <gcc-patches@gcc.gnu.org>,
	Hans-Peter Nilsson <hp@axis.com>
Subject: Re: [PATCH 1/2] libstdc++: Replace padding bits with a bit-field in __format::_Spec
Date: Thu, 1 Feb 2024 17:28:37 +0000	[thread overview]
Message-ID: <CAH6eHdSBzG9RFJ0RAv3MQv_av5oE_T91gm7dnm5oTd859WRQJg@mail.gmail.com> (raw)
In-Reply-To: <CACb0b4nSMJdk9z_G8115-Gq6TBsR56-kyK96kPfhY4ORhq_QHQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1430 bytes --]

On Thu, 1 Feb 2024, 17:23 Jonathan Wakely, <jwakely@redhat.com> wrote:

> On Thu, 1 Feb 2024 at 16:34, Andreas Schwab <schwab@suse.de> wrote:
> >
> > On Feb 01 2024, Jonathan Wakely wrote:
> >
> > > This will result in an ABI change for targets that use 1-byte alignment
> > > for all integral types, e.g. cris-elf.
> >
> > Or 2-byte alignment as on m68k.
>
> Ah yes.
>
> In fact it's a change for everybody, because previously it was 15 bits
> of bit-fields, 1 bit padding, 2 x 16-bit short, 16 bits padding,


(Except for targets with 1- or 2-byte alignment, which didn't have the
second padding)


then
> a char32_t, but now it's 15+17 bits of bit-fields, 2x 16-bit short,
> char32_t. So the shorts moved internally even if the size didn't
> change.
>
> I could make it 15+1 bit-fields, 2x16-bit short, 16 bit-field to avoid
> moving the shorts.
>
>   template<typename _CharT>
>     struct _Spec
>     {
>       _Align     _M_align : 2;
>       _Sign      _M_sign : 2;
>       unsigned   _M_alt : 1;
>       unsigned   _M_localized : 1;
>       unsigned   _M_zero_fill : 1;
>       _WidthPrec _M_width_kind : 2;
>       _WidthPrec _M_prec_kind : 2;
>       _Pres_type _M_type : 4;
>       unsigned _M_reserved : 1;
>       unsigned short _M_width;
>       unsigned short _M_prec;
>       unsigned _M_reserved2 : 16;
>       char32_t _M_fill = ' ';
>
> That would also address the PCC_BITFIELD_TYPE_MATTERS point H-P made.
>
>

  reply	other threads:[~2024-02-01 17:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 15:36 Jonathan Wakely
2024-02-01 15:36 ` [PATCH 2/2] libstdc++: Handle encodings in localized chrono formatting [PR109162] Jonathan Wakely
2024-02-01 16:43   ` Arsen Arsenović
2024-02-01 16:16 ` [PATCH 1/2] libstdc++: Replace padding bits with a bit-field in __format::_Spec Hans-Peter Nilsson
2024-02-01 17:08   ` Hans-Peter Nilsson
2024-02-01 17:21     ` Jonathan Wakely
2024-02-01 16:33 ` Andreas Schwab
2024-02-01 17:22   ` Jonathan Wakely
2024-02-01 17:28     ` Jonathan Wakely [this message]
2024-02-01 19:24     ` Jonathan Wakely
2024-02-01 19:50       ` Hans-Peter Nilsson

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=CAH6eHdSBzG9RFJ0RAv3MQv_av5oE_T91gm7dnm5oTd859WRQJg@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hp@axis.com \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=schwab@suse.de \
    /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).