From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id BA84A3858D35 for ; Mon, 15 Apr 2024 13:52:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA84A3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BA84A3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713189170; cv=none; b=bpI5tb1Hh2kFg+QTBX0U+BZny6OQPfM5MSZ231uKzwjyZxECUhVO5eWTqCdQCwN7tRf9jHARkhe3S5ghLtFDlJ50TMVC+qA4OSlJFVsnZlKTphkbC/7D5/EHIuMJDqLJZY0pXW+wTGcgn61DVJGuRu5+tOFRhgKaTjgYGOZ2Dl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713189170; c=relaxed/simple; bh=5LEbcoAyRv15RoNGHRsEaqJlG+ifzp9o1MYt/fejY2k=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=NW0n1E1V0V+kGUNUs3y4oR/Ypve5Pze4QEkYTeovFlPVzrtaXVUbU+Zwfr/JqkCccYvOdenjRQqZTIYfLxg/EchG/k4RhE54EeenWXzIBL/OUExtZrrHYdhkO/RksouGR2UK/IvCFP0ElJSro9DW97YLudlwPFDnOHBQlQq7jvM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1e5b6e8f662so21994555ad.0 for ; Mon, 15 Apr 2024 06:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713189166; x=1713793966; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=7KT+jzCw09py/ixkwHSFc2Pj6jBybtmGQCj6gHEeUYc=; b=ceFli5Tpc5mHkpWLMFsWPTUdiGayNQm3mqTBccKPOPe3gsYCpju/jlAYJUvozsSUW7 80M2F1LiKYM8xobQMzqrkJXmH7OjpdXvh23jygUSZ2jYzYrCS1NkiBZZyk/wvvpp6op6 VBZbCif+EOEGlhRccgGUEgc1DhDv8yNVnW2hmAtz5z2gUKKxZFt+LvKyd3wHAIeolRDr 8lRA3z0MY+GwYphTCSXV7JGGfNH6NYfNrJEXpbwsh97HAe/Tjbbx6wUIUaUdUwIlh4g3 Rigx9E8j8bFbL9zbo29xLnkeBI69ua5PNro3ETDgSdvWnYLKr+vX0qRFUzbrONBq5D/x JkOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713189166; x=1713793966; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7KT+jzCw09py/ixkwHSFc2Pj6jBybtmGQCj6gHEeUYc=; b=FIfmDkiFkXxRzWq8Do9fU4HZL/4GUvtrCxjHQczfxsKs2D7VmZH5SJWZG3XBD85kTu n+fA+qJjANh4xenx3XLGpSMgFXpugNtJJHShYl9FY4J/sDPP+0iu3fMVr8QpOyAKGhF7 b9id7J9YD+gZWPHmMF/ZG/jlx2lzyD97ZAKq9W5I4zRvzwgDAEp6sVit9xydLujGCDLj 2jjcO47420GNZoasjVPyUzaTNc5jnZxgVZQtIv3YMySRrtaL4HccrHo73tvpDjBlr7R+ s/XOoruIvedRKO6fgwDCbmKiO/owF2/H/r3iAfx2JhpkjQWHIkAnULXSiPoFnUHO9iTe ulEw== X-Forwarded-Encrypted: i=1; AJvYcCV66dce22Nxyt1mozO5voULKehrG1YcdOk8KNL1ZfNUsv52O8tgUHbCWcUH2kw0q/rC7nKvNDxm0J4uyHcGg1zi2Wo7DQbCfXsv X-Gm-Message-State: AOJu0YxmFCoragmYPbYwzuFo6JvI8YQwoFqFp72Xq6374vdPJtG175+k jC2ZNXv9OB+vNe1JOhbo3nINoki+zfeAec5kATM/MAsYJVpWMo/4DS4c4Ts+GAw= X-Google-Smtp-Source: AGHT+IHnEplmdVbsXsFNfmnsFe9YX+GsPJRPESsBuaYheSR+X5uSfTBKJ9aRB0qFFM5bDUgcolzGHg== X-Received: by 2002:a17:902:a511:b0:1e2:616e:2883 with SMTP id s17-20020a170902a51100b001e2616e2883mr7763654plq.24.1713189166412; Mon, 15 Apr 2024 06:52:46 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:d8e5:34bc:e1c9:2b45:c06a? ([2804:1b3:a7c0:d8e5:34bc:e1c9:2b45:c06a]) by smtp.gmail.com with ESMTPSA id g3-20020a170902868300b001e2c1e56f3bsm7913167plo.104.2024.04.15.06.52.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Apr 2024 06:52:45 -0700 (PDT) Message-ID: Date: Mon, 15 Apr 2024 10:52:43 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Implement C23 log2p1 To: Carlos O'Donell , Joseph Myers , libc-alpha@sourceware.org References: <41a4a6c9-4942-a9be-9459-1aaeb44ffee8@redhat.com> <7f721503-e65d-4901-9369-833c00b01004@redhat.com> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <7f721503-e65d-4901-9369-833c00b01004@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 15/04/24 10:41, Carlos O'Donell wrote: > On 4/8/24 17:19, Joseph Myers wrote: >> C23 adds various function families originally defined in TS >> 18661-4. Add the log2p1 functions (log2(1+x): like log1p, but for >> base-2 logarithms). >> >> This illustrates the intended structure of implementations of all >> these function families: define them initially with a type-generic >> template implementation. If someone wishes to add type-specific >> implementations, it is likely such implementations can be both faster >> and more accurate than the type-generic one and can then override it >> for types for which they are implemented (adding benchmarks would be >> desirable in such cases to demonstrate that a new implementation is >> indeed faster). >> >> The test inputs are copied from those for log1p. Note that these >> changes make gen-auto-libm-tests depend on MPFR 4.2 (or later). >> >> The bulk of the changes are fairly generic for any such new function. >> (sysdeps/powerpc/nofpu/Makefile only needs changing for those >> type-generic templates that use fabs.) >> >> Tested for x86_64 and x86, and with build-many-glibcs.py. > > This fails CI for glibc: > https://patchwork.sourceware.org/project/glibc/patch/41a4a6c9-4942-a9be-9459-1aaeb44ffee8@redhat.com/ > > Please review the results and work with Linaro to ensure this passes. > These are the required ULPs update for arm and powerpc: diff --git a/sysdeps/aarch64/libm-test-ulps b/sysdeps/aarch64/libm-test-ulps index 116a5404f5..43aa07ba10 100644 --- a/sysdeps/aarch64/libm-test-ulps +++ b/sysdeps/aarch64/libm-test-ulps @@ -1355,6 +1355,26 @@ double: 3 float: 3 ldouble: 1 +Function: "log2p1": +double: 1 +float: 1 +ldouble: 3 + +Function: "log2p1_downward": +double: 2 +float: 2 +ldouble: 3 + +Function: "log2p1_towardzero": +double: 2 +float: 2 +ldouble: 2 + +Function: "log2p1_upward": +double: 1 +float: 2 +ldouble: 2 + Function: "log_advsimd": double: 1 float: 3 diff --git a/sysdeps/arm/libm-test-ulps b/sysdeps/arm/libm-test-ulps index 5720e73288..fc7ba1439a 100644 --- a/sysdeps/arm/libm-test-ulps +++ b/sysdeps/arm/libm-test-ulps @@ -965,6 +965,22 @@ Function: "log2_upward": double: 3 float: 3 +Function: "log2p1": +double: 1 +float: 1 + +Function: "log2p1_downward": +double: 2 +float: 2 + +Function: "log2p1_towardzero": +double: 2 +float: 2 + +Function: "log2p1_upward": +double: 1 +float: 2 + Function: "log_downward": float: 2 diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps index dbf71d8194..78e9a9ad6e 100644 --- a/sysdeps/powerpc/fpu/libm-test-ulps +++ b/sysdeps/powerpc/fpu/libm-test-ulps @@ -1506,6 +1506,30 @@ float: 3 float128: 1 ldouble: 4 +Function: "log2p1": +double: 1 +float: 1 +float128: 2 +ldouble: 2 + +Function: "log2p1_downward": +double: 2 +float: 2 +float128: 3 +ldouble: 4 + +Function: "log2p1_towardzero": +double: 2 +float: 2 +float128: 2 +ldouble: 4 + +Function: "log2p1_upward": +double: 1 +float: 2 +float128: 2 +ldouble: 4 + Function: "log_downward": float: 2 float128: 1