From patchwork Sat Aug 20 08:43:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 1668406 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=vXQlF3ps; 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 4M8sc45rBHz1ygl for ; Sat, 20 Aug 2022 18:44:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD85D3858012 for ; Sat, 20 Aug 2022 08:44:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD85D3858012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1660985042; bh=AoqdKH8gL82+p19NXqR5MZrQpdakb6gMcy2ZB63Pt8M=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=vXQlF3psXM6RqYJad+WZNBbD4X5/ZL3c5QkXJM23DsKwRajOaszyX9XrI2fupH6x3 3FwNbjGlgWB7tDjOb5thW1zT0+M44w3wOGk0+qDG/7etDpFda9w31Ijq982HdRDbMH oWoLvRYJtH5uXgpv9Cb1A1swnV+JQpzkU9pVX/XI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 8E7613858294 for ; Sat, 20 Aug 2022 08:43:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8E7613858294 Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id CDFAC667AE; Sat, 20 Aug 2022 04:43:45 -0400 (EDT) Message-ID: <9146983bcb2dc77fea7ab361f96005b1ce6dc698.camel@xry111.site> Subject: [PATCH] LoongArch: Use __builtin_{fmax,fmaxf,fmin,fminf} with GCC >= 13 To: libc-alpha@sourceware.org Date: Sat, 20 Aug 2022 16:43:44 +0800 User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Xi Ruoyao via Libc-alpha From: Xi Ruoyao Reply-To: Xi Ruoyao Cc: Wang Xuerui , Joseph Myers , caiyinyu Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" GCC 13 compiles these built-ins to {fmax,fmin}.{s/d} instruction, use them instead of the generic implementation. Link: https://gcc.gnu.org/r13-2085 Signed-off-by: Xi Ruoyao Reviewed-by: Adhemerval Zanella --- sysdeps/loongarch/fpu/math-use-builtins-fmax.h | 10 ++++++++++ sysdeps/loongarch/fpu/math-use-builtins-fmin.h | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 sysdeps/loongarch/fpu/math-use-builtins-fmax.h create mode 100644 sysdeps/loongarch/fpu/math-use-builtins-fmin.h diff --git a/sysdeps/loongarch/fpu/math-use-builtins-fmax.h b/sysdeps/loongarch/fpu/math-use-builtins-fmax.h new file mode 100644 index 0000000000..5d22567bd3 --- /dev/null +++ b/sysdeps/loongarch/fpu/math-use-builtins-fmax.h @@ -0,0 +1,10 @@ +#if __GNUC_PREREQ (13, 0) +# define USE_FMAX_BUILTIN 1 +# define USE_FMAXF_BUILTIN 1 +#else +# define USE_FMAX_BUILTIN 0 +# define USE_FMAXF_BUILTIN 0 +#endif + +#define USE_FMAXL_BUILTIN 0 +#define USE_FMAXF128_BUILTIN 0 diff --git a/sysdeps/loongarch/fpu/math-use-builtins-fmin.h b/sysdeps/loongarch/fpu/math-use-builtins-fmin.h new file mode 100644 index 0000000000..4d28b41c0d --- /dev/null +++ b/sysdeps/loongarch/fpu/math-use-builtins-fmin.h @@ -0,0 +1,10 @@ +#if __GNUC_PREREQ (13, 0) +# define USE_FMIN_BUILTIN 1 +# define USE_FMINF_BUILTIN 1 +#else +# define USE_FMIN_BUILTIN 0 +# define USE_FMINF_BUILTIN 0 +#endif + +#define USE_FMINL_BUILTIN 0 +#define USE_FMINF128_BUILTIN 0