From owner-freebsd-numerics@freebsd.org Tue Feb 20 03:01:34 2018 Return-Path: Delivered-To: freebsd-numerics@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED94DF1DA66 for ; Tue, 20 Feb 2018 03:01:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x22e.google.com (mail-yb0-x22e.google.com [IPv6:2607:f8b0:4002:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92E837C39B for ; Tue, 20 Feb 2018 03:01:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x22e.google.com with SMTP id s79-v6so3502345ybs.0 for ; Mon, 19 Feb 2018 19:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:from:date:message-id:subject:to; bh=TjK7QF9WLTMpwBxvNFtrVV4p4tietLgcTeSqo6s+DCA=; b=mz8EKIFK1GIdzffjAbzIbpjyFsgt4eB/Eo1bE/lRYBcqzTzTwYRbBkQdrTlJmuRUfj RGEPkaVzUIMs5zXMYMGAuq+MYOh+U8liyjHLr+Ycu18BUhwfkCC9MuYwLwDZCsjJrOPx 5ySoXn5963laVKJCLmvYnHeTTwls1THf9sAfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TjK7QF9WLTMpwBxvNFtrVV4p4tietLgcTeSqo6s+DCA=; b=VzoeSpaM7n3wvEumSmaWMP40lsDlSJ/VWSpjt1O8j1+gVPZGjhYQNDOafUh5horyg7 7fBjvHDRhNfbr49FVfr8dXd4/lTkR0axFeiWdT/BPEUub9l697GcLU1hMZe2zIJCd+SE eHVLcxOb+T/EH60FPour3BBavw/18qqn3vu/0dfOhOP3ldQRwHaBsRkSKPL6hN1sjNby VFvdlkZI5ZhtCZRGgLdqi7WnW7cxXwDT0dP6F3rPzTU7Zsc+iwRWhkV35U2RZSVBZTdO VbX9vlq3RpPkkDQJLHSiZTFUCpk3xKg2BjzFcInl52wFuab2m3NiDPmMnhd0XdMKxhXF pPJQ== X-Gm-Message-State: APf1xPCz2alCZK/Pidof24gfhIQxTV5444RwEaPqNdto8q6HNf0+v1Da wjU2mbsMrrj5jk9QmiFqFt82shy0Zi9O3FsyBNUDC5y9 X-Google-Smtp-Source: AH8x226sxIeXXrbTAbi26rojtCuOPLk0EIn0Kf35hbFwqGspT9pYIfiL3mIWP02QyixHuLlog2d9RMiLdMDHXYmRmhM= X-Received: by 10.37.134.197 with SMTP id y5mr11621765ybm.194.1519095692603; Mon, 19 Feb 2018 19:01:32 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:dfcb:0:0:0:0:0 with HTTP; Mon, 19 Feb 2018 19:01:02 -0800 (PST) From: Eitan Adler Date: Mon, 19 Feb 2018 19:01:02 -0800 Message-ID: Subject: Marking more functions as pure / const To: freebsd-numerics@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2018 03:01:34 -0000 There are a few functions that are explicitly marked as "not pure2" (const) but can be marked as pure. The difference between them is "does the function /read/ from global memory?". Is there anything wrong with this diff? Not touched are all the other functions which all seem to at least be __pure if not __pure2. Index: lib/msun/src/math.h =================================================================== --- lib/msun/src/math.h (revision 329611) +++ lib/msun/src/math.h (working copy) @@ -242,11 +242,11 @@ double sinh(double); double tanh(double); double exp(double); -double frexp(double, int *); /* fundamentally !__pure2 */ +double frexp(double, int *) __pure; /* fundamentally !__pure2 */ double ldexp(double, int); double log(double); double log10(double); -double modf(double, double *); /* fundamentally !__pure2 */ +double modf(double, double *) __pure; /* fundamentally !__pure2 */ double pow(double, double); double sqrt(double); @@ -354,7 +354,7 @@ float tanhf(float); float exp2f(float); float expf(float); float expm1f(float); -float frexpf(float, int *); /* fundamentally !__pure2 */ +float frexpf(float, int *) __pure; /* fundamentally !__pure2 */ int ilogbf(float) __pure2; float ldexpf(float, int); float log10f(float); @@ -361,7 +361,7 @@ float log10f(float); float log1pf(float); float log2f(float); float logf(float); -float modff(float, float *); /* fundamentally !__pure2 */ +float modff(float, float *) __pure; /* fundamentally !__pure2 */ float powf(float, float); float sqrtf(float); @@ -461,7 +461,7 @@ long double fmal(long double, long double, long do long double fmaxl(long double, long double) __pure2; long double fminl(long double, long double) __pure2; long double fmodl(long double, long double); -long double frexpl(long double, int *); /* fundamentally !__pure2 */ +long double frexpl(long double, int *) __pure; /* fundamentally !__pure2 */ long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); @@ -475,7 +475,7 @@ long double logbl(long double); long double logl(long double); long lrintl(long double); long lroundl(long double); -long double modfl(long double, long double *); /* fundamentally !__pure2 */ +long double modfl(long double, long double *) __pure; /* fundamentally !__pure2 */ long double nanl(const char *) __pure2; long double nearbyintl(long double); long double nextafterl(long double, long double); -- Eitan Adler