Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOXuP__C16yQJgiPYwnOFr=1OcEdwjskbjTqwY_s2jmNzhTeAg@mail.gmail.com>
Date: Tue, 20 Jan 2026 17:11:57 -0800
From: Charles Banas <greyfade@...il.com>
To: musl@...ts.openwall.com
Cc: Rich Felker <dalias@...c.org>, Xan Phung <xan.phung@...il.com>
Subject: Re: [PATCH v1] wctype: reduce text size of iswalpha & iswpunct
 by 53%

On Tue, Jan 20, 2026 at 5:03 PM Demi Marie Obenour
<demiobenour@...il.com> wrote:
>
> On 1/20/26 10:09, Rich Felker wrote:
> > On Tue, Jan 20, 2026 at 01:35:26AM +1100, Xan Phung wrote:
>
> (snip)
>
> >> +
> >> +int iswalpha(wint_t wc) {
> >> +    unsigned *huffm = (unsigned *)(table + PAGEH), target;
> >
> > The aliasing violation here isn't acceptable. Is there any good way to
> > avoid it? I've only skimmed this submission so far; I assume the
> > motivation is doing the popcount across 4 bytes, but I don't yet
> > understand why popcount was chosen as the way of storing an index.
>
> Do compilers optimize using memcpy() for type-punning?

Yes, they do. All of the ones I've tested elide the memcpy() call
entirely in type-punning cases.

> --
> Sincerely,
> Demi Marie Obenour (she/her/hers)



-- 
Charles Banas

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.