From patchwork Thu Mar 12 01:41:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengqinggang X-Patchwork-Id: 131558 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DC9034B920D6 for ; Thu, 12 Mar 2026 01:47:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC9034B920D6 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 5F73C4B920D2 for ; Thu, 12 Mar 2026 01:46:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F73C4B920D2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5F73C4B920D2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773279992; cv=none; b=rO8KW2x0kSTdY7eDfmwCb3dpE+SroC6NCT+bFH6LYBKY+r/KejCpKbn4NkIQd4OVwwsuSk39QIc+nUHGBGbFXF03uAEh939THphdtijgMmrawC/O2KG/2Fro+hzSz4BqBn5WOqcHOGIAwgZ3YyAg5aI6y9pFY5fQI73F+iQUPhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773279992; c=relaxed/simple; bh=EOs+83FkWoOVGyAcbpNVxoRW+B74ykKerhyhoMuRu78=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=wcB799B25YQXcVWOGTP/WTk/NMZeU4NxypFgFsK5QQIprqp2A7uIMUnYtNz1gS5OE1aLFNodVPIFwzTisLJEghlCehNkwUVfbT7tANZBwGPwv96awRao1jv5Ab+EGmgPB+9JxUMDl+U3ZrrAlbXHN3J5JC/UiSRDvUv1uG/cvCU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F73C4B920D2 Received: from loongson.cn (unknown [10.2.6.7]) by gateway (Coremail) with SMTP id _____8CxYcD1GrJpCy4aAA--.17555S3; Thu, 12 Mar 2026 09:46:29 +0800 (CST) Received: from amd9754.. (unknown [10.2.6.7]) by front1 (Coremail) with SMTP id qMiowJCx2+DwGrJptYBTAA--.28244S2; Thu, 12 Mar 2026 09:46:24 +0800 (CST) From: mengqinggang To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, fweimer@redhat.com, xuchenghua@loongson.cn, caiyinyu@loongson.cn, chenglulu@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn, hejinyang@loongson.cn, mengqinggang@loongson.cn Subject: [PATCH v6 2/6] LoongArch: Add support for LA32 in sysdeps/loongarch/fpu Date: Thu, 12 Mar 2026 09:41:59 +0800 Message-Id: <20260312014203.1916933-3-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260312014203.1916933-1-mengqinggang@loongson.cn> References: <20260312014203.1916933-1-mengqinggang@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowJCx2+DwGrJptYBTAA--.28244S2 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 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~patchwork=sourceware.org@sourceware.org Move the loongarch64 implementation to sysdeps/loongarch/lp64/fpu. --- sysdeps/loongarch/fpu/math-use-builtins-llrint.h | 2 +- sysdeps/loongarch/fpu/math-use-builtins-logb.h | 2 +- sysdeps/loongarch/fpu/math-use-builtins-lrint.h | 2 +- sysdeps/loongarch/fpu/math-use-builtins-rint.h | 2 +- sysdeps/loongarch/fpu/math-use-builtins-sqrt.h | 10 ++++++++-- sysdeps/loongarch/lp64/fpu/Implies | 1 + sysdeps/loongarch/{ => lp64}/fpu/e_scalb.c | 0 sysdeps/loongarch/{ => lp64}/fpu/e_scalbf.c | 0 sysdeps/loongarch/{ => lp64}/fpu/s_scalbn.c | 0 sysdeps/loongarch/{ => lp64}/fpu/s_scalbnf.c | 0 sysdeps/loongarch/{ => lp64}/fpu/w_ilogb-impl.h | 0 sysdeps/loongarch/{ => lp64}/fpu/w_ilogbf-impl.h | 0 12 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 sysdeps/loongarch/lp64/fpu/Implies rename sysdeps/loongarch/{ => lp64}/fpu/e_scalb.c (100%) rename sysdeps/loongarch/{ => lp64}/fpu/e_scalbf.c (100%) rename sysdeps/loongarch/{ => lp64}/fpu/s_scalbn.c (100%) rename sysdeps/loongarch/{ => lp64}/fpu/s_scalbnf.c (100%) rename sysdeps/loongarch/{ => lp64}/fpu/w_ilogb-impl.h (100%) rename sysdeps/loongarch/{ => lp64}/fpu/w_ilogbf-impl.h (100%) diff --git a/sysdeps/loongarch/fpu/math-use-builtins-llrint.h b/sysdeps/loongarch/fpu/math-use-builtins-llrint.h index bee5910b09..82f89d41f9 100644 --- a/sysdeps/loongarch/fpu/math-use-builtins-llrint.h +++ b/sysdeps/loongarch/fpu/math-use-builtins-llrint.h @@ -1,4 +1,4 @@ -#if __GNUC_PREREQ (13, 0) +#if __GNUC_PREREQ (13, 0) && __loongarch_grlen == 64 # define USE_LLRINT_BUILTIN 1 # define USE_LLRINTF_BUILTIN 1 #else diff --git a/sysdeps/loongarch/fpu/math-use-builtins-logb.h b/sysdeps/loongarch/fpu/math-use-builtins-logb.h index b1c3f30dc4..d8ca3d1aa2 100644 --- a/sysdeps/loongarch/fpu/math-use-builtins-logb.h +++ b/sysdeps/loongarch/fpu/math-use-builtins-logb.h @@ -1,4 +1,4 @@ -#if __GNUC_PREREQ (13, 0) +#if __GNUC_PREREQ (13, 0) && __loongarch_grlen == 64 # define USE_LOGB_BUILTIN 1 # define USE_LOGBF_BUILTIN 1 #else diff --git a/sysdeps/loongarch/fpu/math-use-builtins-lrint.h b/sysdeps/loongarch/fpu/math-use-builtins-lrint.h index 7df8aac81f..80345fdf3f 100644 --- a/sysdeps/loongarch/fpu/math-use-builtins-lrint.h +++ b/sysdeps/loongarch/fpu/math-use-builtins-lrint.h @@ -1,4 +1,4 @@ -#if __GNUC_PREREQ (13, 0) +#if __GNUC_PREREQ (13, 0) && __loongarch_grlen == 64 # define USE_LRINT_BUILTIN 1 # define USE_LRINTF_BUILTIN 1 #else diff --git a/sysdeps/loongarch/fpu/math-use-builtins-rint.h b/sysdeps/loongarch/fpu/math-use-builtins-rint.h index cd91482f5f..73ce3e45bc 100644 --- a/sysdeps/loongarch/fpu/math-use-builtins-rint.h +++ b/sysdeps/loongarch/fpu/math-use-builtins-rint.h @@ -1,4 +1,4 @@ -#if __GNUC_PREREQ (13, 0) +#if __GNUC_PREREQ (13, 0) && __loongarch_grlen == 64 # define USE_RINT_BUILTIN 1 # define USE_RINTF_BUILTIN 1 #else diff --git a/sysdeps/loongarch/fpu/math-use-builtins-sqrt.h b/sysdeps/loongarch/fpu/math-use-builtins-sqrt.h index e94c915ba6..f031bd7536 100644 --- a/sysdeps/loongarch/fpu/math-use-builtins-sqrt.h +++ b/sysdeps/loongarch/fpu/math-use-builtins-sqrt.h @@ -1,4 +1,10 @@ -#define USE_SQRT_BUILTIN 1 -#define USE_SQRTF_BUILTIN 1 +#if __loongarch_grlen == 64 + #define USE_SQRT_BUILTIN 1 + #define USE_SQRTF_BUILTIN 1 +#else + #define USE_SQRT_BUILTIN 0 + #define USE_SQRTF_BUILTIN 0 +#endif + #define USE_SQRTL_BUILTIN 0 #define USE_SQRTF128_BUILTIN 0 diff --git a/sysdeps/loongarch/lp64/fpu/Implies b/sysdeps/loongarch/lp64/fpu/Implies new file mode 100644 index 0000000000..fccda41bd0 --- /dev/null +++ b/sysdeps/loongarch/lp64/fpu/Implies @@ -0,0 +1 @@ +loongarch/lp64/fpu diff --git a/sysdeps/loongarch/fpu/e_scalb.c b/sysdeps/loongarch/lp64/fpu/e_scalb.c similarity index 100% rename from sysdeps/loongarch/fpu/e_scalb.c rename to sysdeps/loongarch/lp64/fpu/e_scalb.c diff --git a/sysdeps/loongarch/fpu/e_scalbf.c b/sysdeps/loongarch/lp64/fpu/e_scalbf.c similarity index 100% rename from sysdeps/loongarch/fpu/e_scalbf.c rename to sysdeps/loongarch/lp64/fpu/e_scalbf.c diff --git a/sysdeps/loongarch/fpu/s_scalbn.c b/sysdeps/loongarch/lp64/fpu/s_scalbn.c similarity index 100% rename from sysdeps/loongarch/fpu/s_scalbn.c rename to sysdeps/loongarch/lp64/fpu/s_scalbn.c diff --git a/sysdeps/loongarch/fpu/s_scalbnf.c b/sysdeps/loongarch/lp64/fpu/s_scalbnf.c similarity index 100% rename from sysdeps/loongarch/fpu/s_scalbnf.c rename to sysdeps/loongarch/lp64/fpu/s_scalbnf.c diff --git a/sysdeps/loongarch/fpu/w_ilogb-impl.h b/sysdeps/loongarch/lp64/fpu/w_ilogb-impl.h similarity index 100% rename from sysdeps/loongarch/fpu/w_ilogb-impl.h rename to sysdeps/loongarch/lp64/fpu/w_ilogb-impl.h diff --git a/sysdeps/loongarch/fpu/w_ilogbf-impl.h b/sysdeps/loongarch/lp64/fpu/w_ilogbf-impl.h similarity index 100% rename from sysdeps/loongarch/fpu/w_ilogbf-impl.h rename to sysdeps/loongarch/lp64/fpu/w_ilogbf-impl.h