Date: Sat, 12 Aug 2017 17:14:14 -0700 From: Ryan Libby <rlibby@freebsd.org> To: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com> Cc: Ian Lepore <ian@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Bruce Evans <brde@optusnet.com.au> Subject: Re: svn commit: r322418 - head/lib/msun/src Message-ID: <CAHgpiFwtg8xXcoYBFr4sOnaVRnSrQ8V9hKi71=KrJO-zSM9o-w@mail.gmail.com> In-Reply-To: <A6C8FE24-3458-474D-B05D-FEABFFF7F6EB@gmail.com> References: <201708112241.v7BMfP5X028262@repo.freebsd.org> <1502555191.47886.30.camel@freebsd.org> <CAHgpiFx=pDQA-dHNQJwqDQ%2B2iXJDkvVNsdmyBZG2EL%2BVJQCU4g@mail.gmail.com> <CAHgpiFwAAs8=pcpuwVCx-hNdPp3OXFESVdZ6=9fJ8kPwZiqVCg@mail.gmail.com> <5672BE7A-0640-4C8B-9B41-44AD83D7B59E@gmail.com> <A6C8FE24-3458-474D-B05D-FEABFFF7F6EB@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 12, 2017 at 2:53 PM, Ngie Cooper (yaneurabeya)
<yaneurabeya@gmail.com> wrote:
[...]
> Here are the full gamut of definitions for LDBL_MAX_EXP. It seems that sparc64 isn’t the only architecture using this pattern:
>
> $ grep -r DBL_MAX_EXP sys/*/include
> sys/arm/include/float.h:#define DBL_MAX_EXP 1024
> sys/arm/include/float.h:#define LDBL_MAX_EXP DBL_MAX_EXP
> sys/arm64/include/float.h:#define DBL_MAX_EXP 1024
> sys/arm64/include/float.h:#define LDBL_MAX_EXP (+16384)
> sys/mips/include/float.h:#define DBL_MAX_EXP 1024
> sys/mips/include/float.h:#define LDBL_MAX_EXP DBL_MAX_EXP
> sys/powerpc/include/float.h:#define DBL_MAX_EXP 1024
> sys/powerpc/include/float.h:#define LDBL_MAX_EXP DBL_MAX_EXP
> sys/riscv/include/float.h:#define DBL_MAX_EXP 1024
> sys/riscv/include/float.h:#define LDBL_MAX_EXP (+16384)
> sys/sparc64/include/float.h:#define DBL_MAX_EXP 1024
> sys/sparc64/include/float.h:#define LDBL_MAX_EXP (+16384)
> sys/x86/include/float.h:#define DBL_MAX_EXP 1024
> sys/x86/include/float.h:#define LDBL_MAX_EXP 16384
>
> It might also be an inconsistency with how clang vs gcc [4.2.1] handles __CONCAT, and what -std= flags are passed to ${CC} in the Makefile, since the implementation is predicated by whether or not it’s C++ or __STDC__ is defined. There might be an update that we can grab from NetBSD (since the macro originated there).
> I don’t understand [right now] why the (+foo) form is used *shrugs*.
Yeah, unsure. Aesthetically it mirrors the declaration for the macros
with negative values such as LDBL_MIN_EXP (where the parentheses do have
a functional purpose), but in sys/*/include/{_limits.h,_stdint.h} by
comparison we don't have parens around the positive values.
Anyway maybe the macro pasting method is just too fragile of a hack.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHgpiFwtg8xXcoYBFr4sOnaVRnSrQ8V9hKi71=KrJO-zSM9o-w>
