From patchwork Thu Nov 9 14:33:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 163407 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp474068vqs; Thu, 9 Nov 2023 06:34:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdBf0STRlS1UF5bAFYtXw7eX6BeBMVAyfc1O+JbJLglhpvQrO6WhFbgBLU7tjPS3yvIHcv X-Received: by 2002:a05:6214:c8b:b0:65d:1270:6846 with SMTP id r11-20020a0562140c8b00b0065d12706846mr5107091qvr.29.1699540460519; Thu, 09 Nov 2023 06:34:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699540460; cv=pass; d=google.com; s=arc-20160816; b=XQDQzl2KplTtofEcmUnTfo4tAVm24D+Vjwj9iseDJGjHztT8gdavl7CAPSMqCdivmD 5jsbWzN2kPaQ0+zgHFXEJpa07MAXe3Mpc8wmG+r//VfsX06VMJ5qujuUx7oiu6mIpGCQ 5n5esVJEVtyLmZ8jYNRxu4rfs97/+DfgIPnpWrbi5iTUlhKTQDD0F+c/kmtulsSDtvG2 Z0UM+UHKLJD40PKobuCh8N3nqiXUro0TfJOrw+l+RqTUplSDCBpMzrBWhcVCmlH2EF4N Ww03126t4qBR87YdZtqxB2J8gaN3Ef2hDygrj4Me/hY1mZr9+bcR01jCQH8pIAzRwczk yj7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=3aPC08SM2FhShi+Tf04s+6MxF8cW2/9ZkyP3MAZzjro=; fh=OdxOSwG9aFirUXhe+umIUgv3YGoVSP3hyOVXPRbNWEA=; b=WhWMR2tO44ITxJlK+wNPbNT2xNi/cq3ZiNNjVZpRrhg+CPvDaLrIePXBWHXq/QqKbd 7F1+Nd3cXp02t3bD9YhEXBUoLc90V4Qrkp8cKo8DY+8u1B9ljAdz4ftX9Ij82bEk2cFx 3pHSPKzW2D1gvaooXr8d/yDSE6BbIVGnSVvcLyKkYE37ppxsZnS8NsqsLKwY8JmEu8xr /M+qbEdX8P8x6aQjtgsm56gPe9DWQcFw2UzowRgYPLJkO6UEz7MpLhwdt+5+vCFg/YMz /6D4qkYPg82YLN4V4DFTWGZKknpjTVpPSy7+b8hpHWlHMqMTx1ZtQomNpe59IVMrBGpk 6BfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CFvsea7/"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id eu20-20020ad44f54000000b0066d01e0158asi2985489qvb.298.2023.11.09.06.34.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 06:34:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CFvsea7/"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F2EA3861877 for ; Thu, 9 Nov 2023 14:34:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by sourceware.org (Postfix) with ESMTPS id 40BFA3858D35 for ; Thu, 9 Nov 2023 14:33:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40BFA3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 40BFA3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=134.134.136.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699540429; cv=none; b=pDWunV2NXkTP5UMY45PutUJmemhwMrAtqlLytCcfNCJEoeQ+CYhqcBzEUqW1+1hmXkWST55dYiQesA3d1PuzgxHbea8rWayom7KkEXhIMyPCuof2Q3RQAuiXZARdWXUCshC3FS6WVwGuOPVnQHZfjaqEQgwKYQ20fj27C+RKDCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699540429; c=relaxed/simple; bh=AbqPvdS3OrGIRdcshMgzk4bxiacwA8BP5TdbIAppSJA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dku2Z8y4W9edMKYlNwfkisF94QTucjcWqY2gRpTS28RPJlCSJNEYG7bTMJFX9GDcYb4SP4vTGyvXO+ClGJh9kgYrjGyOZXzxvPWkLLgbw45KZibHYiFU479uqRXstAr18uloFbmFdnYlwCVHHClUxW7wC9cv5AT7db7KNIsuUjU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699540428; x=1731076428; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AbqPvdS3OrGIRdcshMgzk4bxiacwA8BP5TdbIAppSJA=; b=CFvsea7/968OnPeKzRAqjlMBOLF9x0RrmbTvZFQjOYU0G9r3ZCmW+20x ffiS8oI/AI/+tXeMf+ZTdzNpnLOMQLrIH4l1DqhJoagLthLZJsSd8Dfnq LdyuUTK81paNGyNizbqNZzE1ju5FV7Ez6hGtoQEKU5O7R46MQC8HkOyfE b7HDjTCLtsXQdop8ApBVUPefbGQXnHDq9R2I2Xh9uMLWSM47HUkYuqdOI aRKSGx8HAUM072vY8WN23+rZ3YfxhIw+5tOGiyqf941XU2gwlMuOFym1p MQOkcbOkMwC0B4DsPYniuj+0Ssx4x/N2sNt+gEPz7e3/EtDxpfixXU92u w==; X-IronPort-AV: E=McAfee;i="6600,9927,10888"; a="454295580" X-IronPort-AV: E=Sophos;i="6.03,289,1694761200"; d="scan'208";a="454295580" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 06:33:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10888"; a="756893653" X-IronPort-AV: E=Sophos;i="6.03,289,1694761200"; d="scan'208";a="756893653" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by orsmga007.jf.intel.com with ESMTP; 09 Nov 2023 06:33:40 -0800 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id CF18910054F1; Thu, 9 Nov 2023 22:33:39 +0800 (CST) From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@sifive.com, pan2.li@intel.com, yanzhang.wang@intel.com, rguenther@suse.de Subject: [PATCH v1] Internal-fn: Add FLOATN support for l/ll round and rint [PR/112432] Date: Thu, 9 Nov 2023 22:33:38 +0800 Message-Id: <20231109143338.307725-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782097337462404885 X-GMAIL-MSGID: 1782097337462404885 From: Pan Li The defined DEF_EXT_LIB_FLOATN_NX_BUILTINS functions should also have DEF_INTERNAL_FLT_FLOATN_FN instead of DEF_INTERNAL_FLT_FN for the FLOATN support. According to the glibc API and gcc builtin, we have below table for the FLOATN is supported or not. +---------+-------+-------------------------------------+ | | glibc | gcc: DEF_EXT_LIB_FLOATN_NX_BUILTINS | +---------+-------+-------------------------------------+ | iceil | N | N | | ifloor | N | N | | irint | N | N | | iround | N | N | | lceil | N | N | | lfloor | N | N | | lrint | Y | Y | | lround | Y | Y | | llceil | N | N | | llfllor | N | N | | llrint | Y | Y | | llround | Y | Y | +---------+-------+-------------------------------------+ This patch would like to support FLOATN for: 1. lrint 2. lround 3. llrint 4. llround The below tests are passed within this patch: 1. x86 bootstrap and regression test. 2. aarch64 regression test. 3. riscv regression tests. PR target/112432 gcc/ChangeLog: * internal-fn.def (LRINT): Add FLOATN support. (LROUND): Ditto. (LLRINT): Ditto. (LLROUND): Ditto. Signed-off-by: Pan Li --- gcc/internal-fn.def | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def index 7f0e3759615..10f88e37bc9 100644 --- a/gcc/internal-fn.def +++ b/gcc/internal-fn.def @@ -365,12 +365,12 @@ DEF_INTERNAL_FLT_FN (IRINT, ECF_CONST, lrint, unary_convert) DEF_INTERNAL_FLT_FN (IROUND, ECF_CONST, lround, unary_convert) DEF_INTERNAL_FLT_FN (LCEIL, ECF_CONST, lceil, unary_convert) DEF_INTERNAL_FLT_FN (LFLOOR, ECF_CONST, lfloor, unary_convert) -DEF_INTERNAL_FLT_FN (LRINT, ECF_CONST, lrint, unary_convert) -DEF_INTERNAL_FLT_FN (LROUND, ECF_CONST, lround, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LRINT, ECF_CONST, lrint, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LROUND, ECF_CONST, lround, unary_convert) DEF_INTERNAL_FLT_FN (LLCEIL, ECF_CONST, lceil, unary_convert) DEF_INTERNAL_FLT_FN (LLFLOOR, ECF_CONST, lfloor, unary_convert) -DEF_INTERNAL_FLT_FN (LLRINT, ECF_CONST, lrint, unary_convert) -DEF_INTERNAL_FLT_FN (LLROUND, ECF_CONST, lround, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LLRINT, ECF_CONST, lrint, unary_convert) +DEF_INTERNAL_FLT_FLOATN_FN (LLROUND, ECF_CONST, lround, unary_convert) /* FP rounding. */ DEF_INTERNAL_FLT_FLOATN_FN (CEIL, ECF_CONST, ceil, unary)