From patchwork Wed Dec 7 08:52:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1713062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=OHzekygP; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NRrf8297Wz23ns for ; Wed, 7 Dec 2022 19:53:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B4C0392B15E for ; Wed, 7 Dec 2022 08:53:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B4C0392B15E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670403182; bh=JNFHt/dkJETVQg8gVYla9pq+LgkpVOTL66W5IwSvbdo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=OHzekygPUS68kKTfDZG6/EUHshfQ2iAOd0sThRg8f25woil5uUn20jPYnWIz589pH twKySdUPEMNftFaZ2MTiouC59ugbrenlwI4SVqqXMKBmvr/jDvrH6pjHSBVIPQ4REk ph2j05+Tp2qf5dmNJKjD249Tc1t+mpFlMWsioWTs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 4061E385B534 for ; Wed, 7 Dec 2022 08:52:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4061E385B534 Received: by mail-ej1-x62a.google.com with SMTP id vv4so12378075ejc.2 for ; Wed, 07 Dec 2022 00:52:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JNFHt/dkJETVQg8gVYla9pq+LgkpVOTL66W5IwSvbdo=; b=Db13sELfQeMpDK0wHpg6z7DER2a/BdOrt7ba0Sd0C8FzXnrwKqMS953PIkWbmNpzLO +0VxZKtjLZU2ZYJQjATHFJ11Qsccuv1Lk8JuvjFcj5+CAtjJOd0zi+e8VS/AOfrRACF5 JsqhCc6MXX0tknCGmKalye7dC8FHs4oSK2Yz7rBv3RIt870OJachzEtYbrUyXxTJgn54 7b7e7ob7TxJmw3y4Ioj3ocfCr0OCba4g9uq5WaSyzUTft/VlacAONuW9OVbqebULDSla GCN6BfTws6x6Ugj9Md/J9JsUaUpEV6e3Hq9IZBx6/IL6QpktqVLYbuq/FmdQ6R/+VOEW vN6g== X-Gm-Message-State: ANoB5pn9YefR3lMoTIerc7YosUNKdB4zGKFAAbqeUeCxea/k9RLHSYeh jDRKElFN7NX/xoYy0icWxZvUK2TMOcM= X-Google-Smtp-Source: AA0mqf721kX8qV2I2485oFz6Vdfq1REDsTZ7lCd41DbVKo/D/RGzphqKvbR5mmBs9lpIa65IcYUSSg== X-Received: by 2002:a17:906:840e:b0:7c0:d94c:7384 with SMTP id n14-20020a170906840e00b007c0d94c7384mr15015656ejx.109.1670403163688; Wed, 07 Dec 2022 00:52:43 -0800 (PST) Received: from noahgold-desk.lan (2603-8080-1301-76c6-feb7-1b9b-f2dd-08f7.res6.spectrum.com. [2603:8080:1301:76c6:feb7:1b9b:f2dd:8f7]) by smtp.gmail.com with ESMTPSA id k17-20020aa7c051000000b0046bd3b366f9sm1931767edo.32.2022.12.07.00.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:52:43 -0800 (PST) To: libc-alpha@sourceware.org Cc: goldstein.w.n@gmail.com, hjl.tools@gmail.com, andrey.kolesov@intel.com, carlos@systemhalted.org Subject: [PATCH v1 02/27] x86/fpu: Add file for common data used across svml_s_*_avx2.S files Date: Wed, 7 Dec 2022 00:52:11 -0800 Message-Id: <20221207085236.1424424-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221207085236.1424424-1-goldstein.w.n@gmail.com> References: <20221207085236.1424424-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Noah Goldstein via Libc-alpha From: Noah Goldstein Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" All rodata that is used by more than one implementation can be defined here to save .rodata size. At the moment definitions are only for the following implementations: atanf atanhf log log10f log2 tanf have been added. --- .../x86_64/fpu/svml_s_common_avx2_rodata.S | 28 +++++++++++++++++++ .../fpu/svml_s_common_avx2_rodata_offsets.h | 26 +++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S create mode 100644 sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h diff --git a/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S new file mode 100644 index 0000000000..986e8ca685 --- /dev/null +++ b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata.S @@ -0,0 +1,28 @@ +#include "svml_s_common_avx2_rodata_offsets.h" + + .section .rodata.avx2, "a" + .align 32 + .globl COMMON_DATA_NAME + +COMMON_DATA_NAME: + /* Used By: atanf, atanhf, log, log10f, log2, tanf. */ + DATA_VEC(COMMON_DATA_NAME, _OneF, 0x3f800000) + /* Used By: atanhf, log, log10f, log2. */ + DATA_VEC(COMMON_DATA_NAME, _NotiOffExpoMask, 0xff800000) + /* Used By: atanhf, log, log10f, log2. */ + DATA_VEC(COMMON_DATA_NAME, _IBrkValue, 0x3f2aaaab) + /* Used By: atanf, atanhf, tanf, tanhf. */ + DATA_VEC(COMMON_DATA_NAME, _AbsMask, 0x7fffffff) + /* Used By: log, log10f, log2. */ + DATA_VEC(COMMON_DATA_NAME, _ILoRange, 0x01000000) + /* Used By: atanhf, log. */ + DATA_VEC(COMMON_DATA_NAME, _Neg5F, 0xbf000000) + /* Used By: atanhf, log. */ + DATA_VEC(COMMON_DATA_NAME, _Ln2, 0x3f317218) + /* Used By: atanhf, tanf. */ + DATA_VEC(COMMON_DATA_NAME, _Neg4096, 0xfffff000) + /* Used By: atanf, tanf. */ + DATA_VEC(COMMON_DATA_NAME, _TanSPI1_FMA, 0x3fc90fdb) + + .type COMMON_DATA_NAME, @object + .size COMMON_DATA_NAME, .-COMMON_DATA_NAME diff --git a/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h new file mode 100644 index 0000000000..6b18b721b1 --- /dev/null +++ b/sysdeps/x86_64/fpu/svml_s_common_avx2_rodata_offsets.h @@ -0,0 +1,26 @@ +#ifndef _SVML_S_COMMON_AVX2_RODATA_OFFSETS_H +#define _SVML_S_COMMON_AVX2_RODATA_OFFSETS_H 1 + +#include "svml_common_data_macros.h.S" + +#define COMMON_DATA_NAME __svml_s_common_avx2_data + +#define _OneF 0 +#define _NotiOffExpoMask 32 +#define _IBrkValue 64 +#define _AbsMask 96 +#define _ILoRange 128 +#define _Neg5F 160 +#define _Ln2 192 +#define _Neg4096 224 +#define _TanSPI1_FMA 256 + +#define COMMON_DATA(offset) ((offset) + (COMMON_DATA_NAME)) +#define DATA_VEC(data_name, offset, value) \ + float_vector32(data_name, offset, value) + +#ifdef LOCAL_DATA_NAME +# define LOCAL_DATA(offset) ((offset) + (LOCAL_DATA_NAME)) +#endif + +#endif