From patchwork Fri Jun 14 23:26:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 1948139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kAqpjJv9; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W1Fmc1bflz20Wb for ; Sat, 15 Jun 2024 09:27:11 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0888F388217C for ; Fri, 14 Jun 2024 23:27:09 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 AF6FB38708D1 for ; Fri, 14 Jun 2024 23:26:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF6FB38708D1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF6FB38708D1 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=1718407615; cv=none; b=PORgmwOUrkK2Byn1L86dPtMySMd18JSU27vOM8UwrZob/ulVDXl1mQoV9+h5RZ0zoW8KQvubFDJwpcqmoT7j9pjPlln0/ohimDb52nAbtcqew4k1fz52vr6l0T8N5Sbz1H09tpN+j1MCRMXm/nrIiQuybiUl+ojG0CkXoXbYGms= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718407615; c=relaxed/simple; bh=AHyUe2A69aFpK1MHB/Z7Hm/LgLf0vAOkCD4ZjOUdueE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=fNg4wPiKM3bWLzGdVOq2vCefdI3VWZZO83ar5inxB0+BH+ikn4T5BeB4pun1yl9JGKiOcHcigrR22Y0I38lhSUm2yw7sWcshrYGRCPTTusrkZEsdguy4QoQnbizVqh5zU7mHfyrXurrgKcxdBadiuL0U4IvISFEkuH43aidD7Mw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1f8395a530dso24596515ad.0 for ; Fri, 14 Jun 2024 16:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718407611; x=1719012411; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=OVfuzGZIWHXsnXJOAdlOMTJAM2Agu+co5o58ZqMR280=; b=kAqpjJv9/5gogzy14IB1pFX+FZVEGns5aqCeGBD5rx896ic9j0tdwDYe9bIgdqEw7u p3GHnA4NPlACr1m8zGJ5Z6dqETuXB3Iq3eIEu374Z3YenStGLHxZrQGw2Dux2N939JEo ByLHajDtZS9y/UVPjratWTbwNmYMjlL36l0AeXV4rsJ/lq/NTpQkSJqczuRiqfzyWh0g wkuiyghaV/Aq6lDfAwEP6XvY5dDHU7onVV8FjyfXE/VApfK7jKnkbRAU2+sea70ZQjHi adPWuzgR/pkBWWzy9QiBANAg9xj09eCMytugjZ90uOQHstuTMk0nCrC8X8unUP1RxHlQ Sf3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718407611; x=1719012411; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OVfuzGZIWHXsnXJOAdlOMTJAM2Agu+co5o58ZqMR280=; b=NWUdiy6Mdz6YSOzeSebUPpK2sBc/QZCIbRqWfWrJbdEBxo6/WR9+qgshyd01sc8CZa j9QfoGnGSFHA5UUw+bDXVm34CkjVCiCQy607BPPI2sufbYWXU3BkTmXFNnroULKRuHHD 36KEG1WpD8aiLUyzWdfDDmxTyLghsjTvbG+dROaekdQpQih/eTdsizTrOrgZW41uXTqk 8waYzXCBm7URs0xUFrChf+jGX0s6zVxdytEXtLF48ooVc22O/bQj49xWUiLCHB+GMqrj sd3yJ6MoB7xlOwkAwW4r1J/EKgJ0p6smMRsK+O5PjAmESkq3GeR3OVf/pd1CpU4FWxAP t/Uw== X-Gm-Message-State: AOJu0YzPRvUWX5Mmo8N+YFJigcseZ86/4NSLvWSJo0dOaFHijWw/UnAg Rt8eNTzLE6eIUgH4Ven77RqEYuwzCbcCCuRAkgk75wfZn+vZI1CHKckS9A== X-Google-Smtp-Source: AGHT+IE8H1tEtWzdelQHRPk1NEvXcmUQ/FOQ+55iUY2N1Iirzzsi7UDr2tb8SLauFP37Oi05n/eXZA== X-Received: by 2002:a17:902:6906:b0:1f7:21fd:ab83 with SMTP id d9443c01a7336-1f8629feaeemr32131205ad.54.1718407611362; Fri, 14 Jun 2024 16:26:51 -0700 (PDT) Received: from localhost.localdomain ([194.169.55.179]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f02600sm38647135ad.186.2024.06.14.16.26.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 14 Jun 2024 16:26:51 -0700 (PDT) Sender: YunQiang Su From: YunQiang Su To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, macro@orcam.me.uk, YunQiang Su Subject: [PATCH v4] MIPSr6/math: Use builtin fma and fmaf Date: Sat, 15 Jun 2024 07:26:45 +0800 Message-Id: <20240614232645.64298-1-syq@debian.org> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org From: YunQiang Su MIPSr6 has MADDF.s/MADDF.d instructions, which are fused. In MIPS ISA, double support can be subsetted. Only FMAF is enabled for this case. * sysdeps/mips/fpu/math-use-builtins-fma.h Signed-off-by: YunQiang Su --- sysdeps/mips/fpu/math-use-builtins-fma.h | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sysdeps/mips/fpu/math-use-builtins-fma.h diff --git a/sysdeps/mips/fpu/math-use-builtins-fma.h b/sysdeps/mips/fpu/math-use-builtins-fma.h new file mode 100644 index 0000000000..507f42141c --- /dev/null +++ b/sysdeps/mips/fpu/math-use-builtins-fma.h @@ -0,0 +1,35 @@ +/* Test that malloc uses mmap when sbrk or brk fails. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* MIPSr6 has MADDF.s/MADDF.d instructions, which are fused. In MIPS +ISA, double support can be subsetted. Only FMAF is enabled for this +case. */ + +#if __mips_isa_rev >= 6 +# ifdef __mips_single_float +# define USE_FMA_BUILTIN 0 +# else +# define USE_FMA_BUILTIN 1 +# endif +# define USE_FMAF_BUILTIN 1 +#else +# define USE_FMA_BUILTIN 0 +# define USE_FMAF_BUILTIN 0 +#endif +#define USE_FMAL_BUILTIN 0 +#define USE_FMAF128_BUILTIN 0