Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200222201704.GL1663@brightrain.aerifal.cx>
Date: Sat, 22 Feb 2020 15:17:04 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Considering x86-64 fenv.s to C

On Mon, Feb 03, 2020 at 01:12:35PM +1100, Damian McGuckin wrote:
> On Sun, 2 Feb 2020, Rich Felker wrote:
> 
> >Hi. Just checking in to let you know I'm not ignoring you, but
> >might need a bit to task-switch back to following up on this. I'll
> >try to do it in parallel with finishing up the release cycle.
> 
> No rush. I have to fight other fires for most of this week anyway.

OK, I'm going to start review and follow-up now. Sorry it's taken so
long. Back-and-forth over time64 concerns in applications & testing,
documenting time64 transition for users, etc. took a lot longer than I
had hoped but it's done now. :-)

First comment: I couldn't find (maybe I missed?) what you intend fore
the contents of fenv-generic.c and fenv-trivial.c to be, but I don't
see what you want them for. fenv.c should just use the macros/inlines
the fenv_arch.h defines, naturally collapsing to empty functions when
they do nothing (for softfloat archs).

In general, the idiom of #include "../foo.c" for $(ARCH)/foo.c only
works when the names are the same, so that the arch file is replacing
the one in the parent dir, and there are special cases (subarch
variants) where you want the arch dir to just do the same thing as the
generic file in the parent dir does, or where it's doing approximately
the same thing but with some macros defined to change what it does.
The way you seem to be trying to do it, src/fenv/fenv-generic.c,
src/fenv/fenv-trivial.c, and src/fenv/$(ARCH)/fenv.c would all be
getting built.

A couple minor style things I also spotted right away: If you want an
unsigned 0 constant, 0U is very much preferred to ((unsigned)0), and
not putting the type there at all is preferable unless there's a good
reason you need it (like to make other things in expressions get
coerced to unsigned). Also verbose type names like "unsigned int" in
place of just "unsigned" are not preferred. If they appear in some
existing places in the source, it's by mistake/oversight.

I'll follow up with more interesting technical review soon.

Rich

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.