From patchwork Thu Mar 12 22:53:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 131630 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 D6BD04B1A287 for ; Thu, 12 Mar 2026 22:54:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6BD04B1A287 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=VBm9Nowz; dkim=pass (2048-bit key, unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=YFhPDHuU X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id C89DF4BBC099 for ; Thu, 12 Mar 2026 22:53:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C89DF4BBC099 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C89DF4BBC099 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773356015; cv=none; b=B8gv9tEGlYaVfZ85qMGCc+fHA0H1bCJMmHiqumwLItxNR5dQEQagoAdaOITGdAl+99pL4J5VfrN5wZQV7eV0SshxckydLuMetGK6mCrSnSmsw2XwWfjP+jQuUOp2mmOwI+8m8cZG9QuoZ0uLDgmvINVqDfdfO/mAhYtqwNYH638= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773356015; c=relaxed/simple; bh=S4gjFA4KrAqsYefNsjluojS2lrI0TMH1csx/szNTDfQ=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=CqDUdCwNV8ZApEcOa7yOQyhKd+8UugIBjMfRYUu+FppGHLOcjddYq0uVgh02gUm+OjvBbEJQPqpP5b840LT/8YnV8DXI2g8PS86AmPbq6q9dbWwy2S0KAwqwiQnaaiNAs5IA5wRKsZc6Z8ExFqxLLZL5Kr6D51AbnQDSCiE5Z8g= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C89DF4BBC099 Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62CJBLLH805698 for ; Thu, 12 Mar 2026 15:53:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=gJcQszbR neolK+Jyqydsi7chFew2HrRizQhDp8xzJ5k=; b=VBm9NowzW/ohqcPsZhA44Esd AjIpJDV1AmGss8RQ/SYatBZHbGlAYXPfy4ej2IbHfp8xyLKTznfPeWVY64A1HzfS dl23u26RgEB7MMCjcWMUiAHKl/G4ZDhBya8zd1H6cCxk8HiiscK3K3WdZizXYibh khDfJdFHiqfQtkzb9lACeV1EF6LjcvRFhKrNpeKgJqJrn/BnZ53U+KybH1CFJ2S8 r8l1Pufv8ALNydEO9CsgVqGwIFSEKxut+Szl3hYBL9AoPa47s7oLAHeM6M49b2Nd UmR1kQCnVunHkVDeFsAY9PyR/LGI4Yh8wGZjGpx3LWw3d1ZXPn7ysyXTZLjgDg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 4cv13tad1m-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 12 Mar 2026 15:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1773356013; bh=S4gjFA4KrAqsYefNsjluojS2lrI0TMH1csx/szNTDfQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YFhPDHuUHE8+F5EbB3tL3g2Hmp1hVimI2ndx0FRzzT0iRMRhO3QhhQ3tJKCVUtyal VxU65d8KxwHZAhbxfzrNKeNeOHOU9dDA3+PP6F2jFbctAcOtg4FFh6QpJO3PoW4Wca J/sTlQoOxMJzxOCvHrbHx4CjsMMrlOiYGSfbQHlsmN5GAEPEBoPifkrKFkwD7EaASr UuDEi05lqXQKn429qApaC/ZYlbXQvtNGUMoP/515OMLV1uWFH4wY5Z+lDbW7d2F3cr lUuzeB3UrYqQ3YUXqK3eoUmBxTVEnG0wKBrw1jSVkSkaw5ueguc9nPvatGHVcSDdzb zTYPDTa9oQz1A== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 66454401FA for ; Thu, 12 Mar 2026 22:53:33 +0000 (UTC) Received: from us01arcgnu3.synopsys.com (us01arcgnu3.internal.synopsys.com [10.194.34.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPS id 24589A0087 for ; Thu, 12 Mar 2026 22:53:33 +0000 (UTC) Received: by us01arcgnu3.synopsys.com (Postfix, from userid 24130) id 1FABE2441D3F9; Thu, 12 Mar 2026 15:53:33 -0700 (PDT) X-SNPS-Relay: synopsys.com From: Yuriy Kolerov To: newlib@sourceware.org Subject: [PATCH 1/3] libc: arc: Exclude strchr.S from targets with 16-entry regfile Date: Thu, 12 Mar 2026 15:53:28 -0700 Message-ID: <20260312225330.2903392-2-ykolerov@synopsys.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20260312225330.2903392-1-ykolerov@synopsys.com> References: <20260312225330.2903392-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDE4NCBTYWx0ZWRfX/8OxUjcawf3e KCpRik3Gbhntt7uMUnG07MqrW+fGYxVx1OCDftPBu/nWBfPgyRTil5SeWdvyTYtgVLdjRqgLtRN JHwxXTlFzsvEfcJ3gaZhtOe/BsqhJqwPSoPPbU0n7yrKYYjD3NAGjkUpayLHiNXhSy9XRYi7DCk dU6eg0EQanuCn8ymu3WoYa+0lgkcQxXLEKm75gKYieSq8JSciafgw49RRsC3GQG9BQ0Sguq9WIe qjEPd/uP31LJ+gvvY63F9X8Z69Ix5pw9skIBGrhhMBpvhvhe6V9WPrXCA5CyPhxrK7bOhIga0GH 8Nai27L/46kXcZmvEWEyZDPI8Hykc/JCxXZW+52u9s0tqhdSZgyn/+TVmqgDwzl8s4YFRVm8QGN rWx5AHHkH+sPYpTeitbZgF+7ANWMNTUDTPval2JLWYt2T3i2K56K5TsFXl+mhNExYcs0Tb7FUdL c//4CwiSmEL2mSPcZhg== X-Proofpoint-ORIG-GUID: g_gVLvsLVSpk8RNrQNfUzdhDFH-YFMGE X-Authority-Analysis: v=2.4 cv=co6WUl4i c=1 sm=1 tr=0 ts=69b343ee cx=c_pps a=t4gDRyhI9k+KZ5gXRQysFQ==:117 a=t4gDRyhI9k+KZ5gXRQysFQ==:17 a=Yq5XynenixoA:10 a=qPHU084jO2kA:10 a=VkNPw1HP01LnGYTKEx00:22 a=tU_645BZ7FZt8VqRJtHG:22 a=jSPayVjLy6xbsuKauFBc:22 a=jIQo8A4GAAAA:8 a=4ziLcXVsHwboZlES2jEA:9 X-Proofpoint-GUID: g_gVLvsLVSpk8RNrQNfUzdhDFH-YFMGE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-12_03,2026-03-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1011 phishscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120184 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_NONE, 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: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org An optimized version of strchr for ARC Classic is incompatible with targets with 16-entry register file. Signed-off-by: Yuriy Kolerov --- newlib/libc/machine/arc/strchr.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newlib/libc/machine/arc/strchr.S b/newlib/libc/machine/arc/strchr.S index 1bf6db97d..eed6278f7 100644 --- a/newlib/libc/machine/arc/strchr.S +++ b/newlib/libc/machine/arc/strchr.S @@ -31,7 +31,8 @@ /* This implementation is optimized for performance. For code size a generic implementation of this function from newlib/libc/string/strchr.c will be used. */ -#if !defined (__OPTIMIZE_SIZE__) && !defined (PREFER_SIZE_OVER_SPEED) +#if !defined (__OPTIMIZE_SIZE__) && !defined (PREFER_SIZE_OVER_SPEED) \ + && !defined (__ARC_RF16__) #include "asm.h" From patchwork Thu Mar 12 22:53:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 131631 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 F3D6E4BBC0DA for ; Thu, 12 Mar 2026 22:54:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3D6E4BBC0DA Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=U7HZyiL3; dkim=pass (2048-bit key, unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=KbLKf2// X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id BC2514BC7EC4 for ; Thu, 12 Mar 2026 22:53:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC2514BC7EC4 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BC2514BC7EC4 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773356017; cv=none; b=j2mtsHKSPY+8DYS8Pj2LNrejyChK2iK3Iz2IG2Lt9baElbfNS14WIDXBefgmHxGvpzUytlY2iHkhICrHxroKzkYxdtqkSMREMM+pmTQsnawpSyLtPPcE7e2dv9d5FztbV75tOE0waIpqOv3mM7zYzy52gBm+kYWFLxbK+8cNhLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773356017; c=relaxed/simple; bh=kz3LlJ1W4x5MYgjA3e6apafH73XkHr13r05DxNigqRQ=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=ZGLFTw9EjXP2QAhhBGJyMOAaEe/+usHyXyhvIwKRmZVjG50AqgCdhXHADNG0HcNZ/FhFUlfN7G928l2Vr7YDPlWv03c+VqZzkqUfzowhLFn0/XflzjKnkfGVmJUNZS0BQ87iZFtz2am+STnHyCvW0sdloHsMqaNIvkClxbXqKm0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC2514BC7EC4 Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62CImIeQ4072384 for ; Thu, 12 Mar 2026 15:53:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=g4Zwv+9a QQvem7kYGvAoaq5JLwzVQ50i233eayWh48M=; b=U7HZyiL3sxSX47pnODH9ncCq IW2imAHsDw2+j28I7gOqv/quU8cXpJ2FWAynUBpEUNinXkIagHb+GnTwUrl41lQd DzpZqH/wClreoGF/5ID9KhV09767+QHxA5hCbH8sReHNcRzOf0I3szc8i5sez1IL zj3ZF6YCahpJB7mB+TZaidwCs4AwiS9EzOECdhIz2QC1YaWB2fWM5KUDSETlw1bb DiKY886hfvpVok65faGYaqdQVtlu++mYiscOAtQD2Qhtm4LWenku+oL4KQwxoJ5S rJ/r7AUHOdyqxstfIVHW2ndkCETEr6WsSsyDIL0ljmA18dAF0k15pI5uWvawHA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 4cv0ux2k34-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 12 Mar 2026 15:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1773356015; bh=kz3LlJ1W4x5MYgjA3e6apafH73XkHr13r05DxNigqRQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KbLKf2//QCMp69yEjlNwSDlbwL+ilf3IfD0QyxpCqM/TgHuioPexAXwzXWwOLWguX o9klXB4A9h0W2nisFx3l1zwG2bd5xDwmAXD3f1ofTAspTfo+f8OJeRzUwqDvX6eS/w HRM1ylT0dDXJ348089bH0vCjo+bNB8cOf3Cc/gFNNaIluJZxyrB+xJqiJcOe7zvF+c wDW3IequqA955rVusmEnjVwxZ/fQjsns4/Fi6Wn2rfpz1DFgYz9d/m1Dv5F3DVfkEO ioBQppHaVZlJGWFeKYzXUMCNPGJq0uVSp9LbDZmw98ML3gh7vzSHc80quGeC/aqAzy A0AbQG+FokJ4g== Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 3D43840087 for ; Thu, 12 Mar 2026 22:53:34 +0000 (UTC) Received: from us01arcgnu3.synopsys.com (unknown [10.194.34.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPS id 07EB8A00D2 for ; Thu, 12 Mar 2026 22:53:33 +0000 (UTC) Received: by us01arcgnu3.synopsys.com (Postfix, from userid 24130) id DFA372441D3F9; Thu, 12 Mar 2026 15:53:33 -0700 (PDT) X-SNPS-Relay: synopsys.com From: Yuriy Kolerov To: newlib@sourceware.org Subject: [PATCH 2/3] libgloss: arc: Add _link stub for nSIM Date: Thu, 12 Mar 2026 15:53:29 -0700 Message-ID: <20260312225330.2903392-3-ykolerov@synopsys.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20260312225330.2903392-1-ykolerov@synopsys.com> References: <20260312225330.2903392-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDE4NCBTYWx0ZWRfX28RUstQFkSJJ szT+qBd84PV/vgZm6wAEgMjFmXEroN+Gz5RetbWy5XS+EVuBoElRrW3ggzWQhKVxAmaagEjFfaf UCTIo2pzBqTbm43ahi15FzjOwY5oeiirUoWdVXWXxqUAmkiL6yiLiXamk2T4HIXH5FS7auI/xHi tIUXa7fHBGH+Ba23b6Lf9CyRaKcqhljZKHFLFb/8cdzJ/tE3QkjmqTE8+LuPJs0ZSvVCii7Qrlm 2pkZMpzGkWXvF0BYr1agp7ZOPTDwdaaii6lOpIQEHn7SmHGf8l+uk42m1ybanGMvnCe7O5gvyG6 8YjXdrru8ET+2vTWsgMLzNCGuoxQPUiy326v6SMylqJNfvMLu/85I3DoANw/iAzeqvTpAzGtdV1 Z8Bgj5bqd6IroBCOMT2CBBV9cxohnqeZ7TK3OHhKrgh/507D2z4G1U/jnEX1x5fIH770PB3qIvz hSu23a/7u3dU7apQSyQ== X-Proofpoint-ORIG-GUID: PqnVEnnl3CtMPnWfWYk1tWwNPlVX2Bdz X-Authority-Analysis: v=2.4 cv=I81ohdgg c=1 sm=1 tr=0 ts=69b343ef cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=Yq5XynenixoA:10 a=qPHU084jO2kA:10 a=VkNPw1HP01LnGYTKEx00:22 a=tU_645BZ7FZt8VqRJtHG:22 a=-4-sGo8i1FcW4KD7_GeR:22 a=jIQo8A4GAAAA:8 a=l8wpBMmLWgtXwi-2CHwA:9 X-Proofpoint-GUID: PqnVEnnl3CtMPnWfWYk1tWwNPlVX2Bdz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-12_03,2026-03-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 clxscore=1015 priorityscore=1501 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120184 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_NONE, 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: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org Building of C++ applications may fail without this stub if libraries are not built with -ffunction-sections. Signed-off-by: Yuriy Kolerov --- libgloss/arc/nsim-syscalls.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libgloss/arc/nsim-syscalls.c b/libgloss/arc/nsim-syscalls.c index 65ad3e009..5e754799c 100644 --- a/libgloss/arc/nsim-syscalls.c +++ b/libgloss/arc/nsim-syscalls.c @@ -233,6 +233,13 @@ _clock (void) return -1; } +int +_link (const char *old_name, const char *new_name) +{ + errno = ENOSYS; + return -1; +} + /* Some system calls are implemented in nSIM hostlink, but are available only on Linux hosts. To minimize potential compatibility issues they are by default disabled in libgloss build. */ From patchwork Thu Mar 12 22:53:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 131632 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 463C04BC8990 for ; Thu, 12 Mar 2026 22:56:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 463C04BC8990 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=ks9OWOrK; dkim=pass (2048-bit key, unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=BFiQO4XI X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by sourceware.org (Postfix) with ESMTPS id DD8EB4BC8990 for ; Thu, 12 Mar 2026 22:53:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD8EB4BC8990 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=synopsys.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DD8EB4BC8990 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773356017; cv=none; b=hzd/KyWDSHyy98ELcumIaF0nJol0cw01bsAICHjUUH2OxrJtEWoacFXrBB17qfNzW4gIr5TKZ0asls4wG6oMw6SooX3wgl1MpjEs9EyWVdBeqBkJTtqyk9+Qb+lJdAwHfR0g8/Bo0Z5ElEfv46UaUyf/kuWYKspKyTeVIuAC7S8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773356017; c=relaxed/simple; bh=LAWe5sP0F94zbrcB5KsJxkPwQd/tm1KF2LtmqA5oI5A=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=F3pYPk+ePPEHcvkD4d4pDLDXLW4d/nCpX9PhgQIatdlmqard97sxodXNYqri5NL2jnjnwH5ShE569O87kwucpVFeRhVEW/zn4v0dpmRBe5b3n7RZ4IUQzFxR9uKRIiL9UiEcxnGOTb4T8cjrDEv3iV9gGS62kFzuUo9F9tSKfv8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD8EB4BC8990 Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62CJBoaM805664 for ; Thu, 12 Mar 2026 15:53:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=G/V0936o FjLfFtyl/WBtDJ+JiQp3BXGpTy6q35qSS3E=; b=ks9OWOrKciVJO24AstF7TGAg 2mWVLAJ86XYsMLj4v8tkhixuGc2yNhhL+G3GJtIvW2v8M/Epwbpjn8+kgFqXBnDV Si1ACKWG5oL0vNQ3jiKfGYjNDrXKlxZlg28qLN0LpmeaN5K75zo1wNHTymBfBqNb Sie74qF8wM3nJ85fphn0Ua5Wmqvnwzjifl/ehDAwuvd4tl5DjkhA1z8R4cwu4U9z sjBEyNudH0zN7HnUlZdBqXuvxhvjC3929LEFAklrvAHp9TzO2FxZEVG1pdCN6hmO uhEMXbVKeDB8ShEOMnN07yrF1fozwd+gcCV4TlITM0R9D0m7pTfeh76N9ZZkLg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 4cv13tad1w-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 12 Mar 2026 15:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1773356015; bh=LAWe5sP0F94zbrcB5KsJxkPwQd/tm1KF2LtmqA5oI5A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BFiQO4XImeBDhHxKJYWmBuEYx8yx3mT51mmT3z7JVlYcbQwUYXp+SfBTaQQSId2qB MiLQDseI2YBH0JfaGhQRH9GF/BoTC3OG3NNN49SqqjEgU4N/W4NbFnzgy8oUWkSnf7 QJgJ4O2fO6X0IB0qNrmZrz+eFuFDyw0XCIf8GsnQTiwBs0AeYx515TYmRZB8RlCTkG 3BGB+RRpZZElqy8Q0VEf+tr3gEIWfNt2cL5veMjOXvwvmcnpUd3ZCbKme9oKECYaY5 h8WLi5Ol1wPtW55uAslsbP7ASE7RMuWU7JNP73Qay+rwGcXBAg0qLQYUraR76FTDQ5 ZnSIHk3Tx0xWw== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 6CFCD4013B for ; Thu, 12 Mar 2026 22:53:35 +0000 (UTC) Received: from us01arcgnu3.synopsys.com (us01arcgnu3.internal.synopsys.com [10.194.34.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPS id 59B78A005E for ; Thu, 12 Mar 2026 22:53:35 +0000 (UTC) Received: by us01arcgnu3.synopsys.com (Postfix, from userid 24130) id 509872441D3F9; Thu, 12 Mar 2026 15:53:35 -0700 (PDT) X-SNPS-Relay: synopsys.com From: Yuriy Kolerov To: newlib@sourceware.org Subject: [PATCH 3/3] libc: arc: Remove an optimized strlen implementation Date: Thu, 12 Mar 2026 15:53:30 -0700 Message-ID: <20260312225330.2903392-4-ykolerov@synopsys.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20260312225330.2903392-1-ykolerov@synopsys.com> References: <20260312225330.2903392-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDE4NCBTYWx0ZWRfX7G2unm3P59On SlfgtvEKkd5/AV7d+NXdzyhoFd+XnYG+d28VWxcrMgXE3HbjVpOrljEtO6Rt8GVBHsRdTq7ZNqv 7+vn9SIuXX0BU2UtKFABCt6A4aXxo1MRchYKnY5r/qXLjiD2gTWQ/8I8GPONQFPeAYINL2xtlF2 l6xZctfy+OhkowHomL0Hjf78M2ZegsoHDm/RFo9mN5VT8n+637dCAluEflgKpBDqMYQ4sfvgUQT T7ldESe2ayYhZyFUm0hIGgioO2442SausnjkgxCEk5WXsoyFYiCaOxmae/9dVqbiyd55KuBO2Z/ ObHZYrk+vP0bof92ZamLWMHVBIfHUU4tP/t09bVkXZhEDpRUVH4elhPwhT6a+7yom7SuqPrcIjI ih9yN9cdjbREabknqh5FBBmqy6uwv5lDX59Za3fzE2uGmayc23/oOgzZAbarzmaKQZWsU1M4FQA 8fFQgk+m/58biCvKtrg== X-Proofpoint-ORIG-GUID: 3OYnUxzo-SD_A02oH_7kri4U9qE9q4Wg X-Authority-Analysis: v=2.4 cv=co6WUl4i c=1 sm=1 tr=0 ts=69b343f0 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==:17 a=Yq5XynenixoA:10 a=qPHU084jO2kA:10 a=VkNPw1HP01LnGYTKEx00:22 a=tU_645BZ7FZt8VqRJtHG:22 a=jSPayVjLy6xbsuKauFBc:22 a=MhnL__LWAAAA:8 a=jIQo8A4GAAAA:8 a=nTAKwdMzI1VRly0YP5QA:9 a=E8uz-YmV3DSgjbAX:21 a=DArMNfZabhNmbrQIurc0:22 X-Proofpoint-GUID: 3OYnUxzo-SD_A02oH_7kri4U9qE9q4Wg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-12_03,2026-03-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120184 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SCC_10_SHORT_WORD_LINES, SCC_5_SHORT_WORD_LINES, SPF_HELO_NONE, SPF_NONE, 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: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org This is a port of e3a4f13 commit from Picolibc. Here is an original explanation for this patch: This code accesses memory up to 7 bytes before the argument which causes access faults on targets with stack bounds checking enabled. Instead of attempting to fix it, just use the C version on all targets which is nearly as fast for this operation. Indeed, this implementation is not safe. Co-authored-by: Keith Packard Signed-off-by: Yuriy Kolerov --- newlib/Makefile.in | 80 ----------- newlib/libc/machine/arc/Makefile.inc | 4 - newlib/libc/machine/arc/strlen-bs-norm.S | 117 ---------------- newlib/libc/machine/arc/strlen-bs.S | 123 ----------------- newlib/libc/machine/arc/strlen-stub.c | 37 ----- newlib/libc/machine/arc/strlen.S | 166 ----------------------- 6 files changed, 527 deletions(-) delete mode 100644 newlib/libc/machine/arc/strlen-bs-norm.S delete mode 100644 newlib/libc/machine/arc/strlen-bs.S delete mode 100644 newlib/libc/machine/arc/strlen-stub.c delete mode 100644 newlib/libc/machine/arc/strlen.S diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 4186ae553..ad57a5458 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -693,10 +693,6 @@ check_PROGRAMS = @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strcpy-bs.S \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strcpy-bs-arc600.S \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strcpy-stub.c \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strlen.S \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strlen-bs.S \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strlen-bs-norm.S \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strlen-stub.c \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strncpy.S \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strncpy-stub.c \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/strncpy-bs.S @@ -1967,10 +1963,6 @@ am__objects_51 = libc/ssp/libc_a-chk_fail.$(OBJEXT) \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strcpy-bs.$(OBJEXT) \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strcpy-bs-arc600.$(OBJEXT) \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strcpy-stub.$(OBJEXT) \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strlen.$(OBJEXT) \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strlen-bs.$(OBJEXT) \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strlen-bs-norm.$(OBJEXT) \ -@HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strlen-stub.$(OBJEXT) \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strncpy.$(OBJEXT) \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strncpy-stub.$(OBJEXT) \ @HAVE_LIBC_MACHINE_ARC_TRUE@ libc/machine/arc/libc_a-strncpy-bs.$(OBJEXT) @@ -8294,18 +8286,6 @@ libc/machine/arc/libc_a-strcpy-bs-arc600.$(OBJEXT): \ libc/machine/arc/libc_a-strcpy-stub.$(OBJEXT): \ libc/machine/arc/$(am__dirstamp) \ libc/machine/arc/$(DEPDIR)/$(am__dirstamp) -libc/machine/arc/libc_a-strlen.$(OBJEXT): \ - libc/machine/arc/$(am__dirstamp) \ - libc/machine/arc/$(DEPDIR)/$(am__dirstamp) -libc/machine/arc/libc_a-strlen-bs.$(OBJEXT): \ - libc/machine/arc/$(am__dirstamp) \ - libc/machine/arc/$(DEPDIR)/$(am__dirstamp) -libc/machine/arc/libc_a-strlen-bs-norm.$(OBJEXT): \ - libc/machine/arc/$(am__dirstamp) \ - libc/machine/arc/$(DEPDIR)/$(am__dirstamp) -libc/machine/arc/libc_a-strlen-stub.$(OBJEXT): \ - libc/machine/arc/$(am__dirstamp) \ - libc/machine/arc/$(DEPDIR)/$(am__dirstamp) libc/machine/arc/libc_a-strncpy.$(OBJEXT): \ libc/machine/arc/$(am__dirstamp) \ libc/machine/arc/$(DEPDIR)/$(am__dirstamp) @@ -12951,10 +12931,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strcpy-bs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strcpy-stub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strcpy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strlen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strncpy-bs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strncpy-stub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-strncpy.Po@am__quote@ @@ -17315,48 +17291,6 @@ libc/machine/arc/libc_a-strcpy-bs-arc600.obj: libc/machine/arc/strcpy-bs-arc600. @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strcpy-bs-arc600.obj `if test -f 'libc/machine/arc/strcpy-bs-arc600.S'; then $(CYGPATH_W) 'libc/machine/arc/strcpy-bs-arc600.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strcpy-bs-arc600.S'; fi` -libc/machine/arc/libc_a-strlen.o: libc/machine/arc/strlen.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strlen.o -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen.Tpo -c -o libc/machine/arc/libc_a-strlen.o `test -f 'libc/machine/arc/strlen.S' || echo '$(srcdir)/'`libc/machine/arc/strlen.S -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/arc/strlen.S' object='libc/machine/arc/libc_a-strlen.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strlen.o `test -f 'libc/machine/arc/strlen.S' || echo '$(srcdir)/'`libc/machine/arc/strlen.S - -libc/machine/arc/libc_a-strlen.obj: libc/machine/arc/strlen.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strlen.obj -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen.Tpo -c -o libc/machine/arc/libc_a-strlen.obj `if test -f 'libc/machine/arc/strlen.S'; then $(CYGPATH_W) 'libc/machine/arc/strlen.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen.S'; fi` -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/arc/strlen.S' object='libc/machine/arc/libc_a-strlen.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strlen.obj `if test -f 'libc/machine/arc/strlen.S'; then $(CYGPATH_W) 'libc/machine/arc/strlen.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen.S'; fi` - -libc/machine/arc/libc_a-strlen-bs.o: libc/machine/arc/strlen-bs.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strlen-bs.o -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Tpo -c -o libc/machine/arc/libc_a-strlen-bs.o `test -f 'libc/machine/arc/strlen-bs.S' || echo '$(srcdir)/'`libc/machine/arc/strlen-bs.S -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/arc/strlen-bs.S' object='libc/machine/arc/libc_a-strlen-bs.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strlen-bs.o `test -f 'libc/machine/arc/strlen-bs.S' || echo '$(srcdir)/'`libc/machine/arc/strlen-bs.S - -libc/machine/arc/libc_a-strlen-bs.obj: libc/machine/arc/strlen-bs.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strlen-bs.obj -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Tpo -c -o libc/machine/arc/libc_a-strlen-bs.obj `if test -f 'libc/machine/arc/strlen-bs.S'; then $(CYGPATH_W) 'libc/machine/arc/strlen-bs.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen-bs.S'; fi` -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/arc/strlen-bs.S' object='libc/machine/arc/libc_a-strlen-bs.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strlen-bs.obj `if test -f 'libc/machine/arc/strlen-bs.S'; then $(CYGPATH_W) 'libc/machine/arc/strlen-bs.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen-bs.S'; fi` - -libc/machine/arc/libc_a-strlen-bs-norm.o: libc/machine/arc/strlen-bs-norm.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strlen-bs-norm.o -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Tpo -c -o libc/machine/arc/libc_a-strlen-bs-norm.o `test -f 'libc/machine/arc/strlen-bs-norm.S' || echo '$(srcdir)/'`libc/machine/arc/strlen-bs-norm.S -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/arc/strlen-bs-norm.S' object='libc/machine/arc/libc_a-strlen-bs-norm.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strlen-bs-norm.o `test -f 'libc/machine/arc/strlen-bs-norm.S' || echo '$(srcdir)/'`libc/machine/arc/strlen-bs-norm.S - -libc/machine/arc/libc_a-strlen-bs-norm.obj: libc/machine/arc/strlen-bs-norm.S -@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strlen-bs-norm.obj -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Tpo -c -o libc/machine/arc/libc_a-strlen-bs-norm.obj `if test -f 'libc/machine/arc/strlen-bs-norm.S'; then $(CYGPATH_W) 'libc/machine/arc/strlen-bs-norm.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen-bs-norm.S'; fi` -@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen-bs-norm.Po -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/arc/strlen-bs-norm.S' object='libc/machine/arc/libc_a-strlen-bs-norm.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/arc/libc_a-strlen-bs-norm.obj `if test -f 'libc/machine/arc/strlen-bs-norm.S'; then $(CYGPATH_W) 'libc/machine/arc/strlen-bs-norm.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen-bs-norm.S'; fi` - libc/machine/arc/libc_a-strncpy.o: libc/machine/arc/strncpy.S @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/arc/libc_a-strncpy.o -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strncpy.Tpo -c -o libc/machine/arc/libc_a-strncpy.o `test -f 'libc/machine/arc/strncpy.S' || echo '$(srcdir)/'`libc/machine/arc/strncpy.S @am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strncpy.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strncpy.Po @@ -33739,20 +33673,6 @@ libc/machine/arc/libc_a-strcpy-stub.obj: libc/machine/arc/strcpy-stub.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/arc/libc_a-strcpy-stub.obj `if test -f 'libc/machine/arc/strcpy-stub.c'; then $(CYGPATH_W) 'libc/machine/arc/strcpy-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strcpy-stub.c'; fi` -libc/machine/arc/libc_a-strlen-stub.o: libc/machine/arc/strlen-stub.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/arc/libc_a-strlen-stub.o -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Tpo -c -o libc/machine/arc/libc_a-strlen-stub.o `test -f 'libc/machine/arc/strlen-stub.c' || echo '$(srcdir)/'`libc/machine/arc/strlen-stub.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/arc/strlen-stub.c' object='libc/machine/arc/libc_a-strlen-stub.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/arc/libc_a-strlen-stub.o `test -f 'libc/machine/arc/strlen-stub.c' || echo '$(srcdir)/'`libc/machine/arc/strlen-stub.c - -libc/machine/arc/libc_a-strlen-stub.obj: libc/machine/arc/strlen-stub.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/arc/libc_a-strlen-stub.obj -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Tpo -c -o libc/machine/arc/libc_a-strlen-stub.obj `if test -f 'libc/machine/arc/strlen-stub.c'; then $(CYGPATH_W) 'libc/machine/arc/strlen-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen-stub.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strlen-stub.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/arc/strlen-stub.c' object='libc/machine/arc/libc_a-strlen-stub.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/arc/libc_a-strlen-stub.obj `if test -f 'libc/machine/arc/strlen-stub.c'; then $(CYGPATH_W) 'libc/machine/arc/strlen-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/arc/strlen-stub.c'; fi` - libc/machine/arc/libc_a-strncpy-stub.o: libc/machine/arc/strncpy-stub.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/arc/libc_a-strncpy-stub.o -MD -MP -MF libc/machine/arc/$(DEPDIR)/libc_a-strncpy-stub.Tpo -c -o libc/machine/arc/libc_a-strncpy-stub.o `test -f 'libc/machine/arc/strncpy-stub.c' || echo '$(srcdir)/'`libc/machine/arc/strncpy-stub.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/arc/$(DEPDIR)/libc_a-strncpy-stub.Tpo libc/machine/arc/$(DEPDIR)/libc_a-strncpy-stub.Po diff --git a/newlib/libc/machine/arc/Makefile.inc b/newlib/libc/machine/arc/Makefile.inc index c0d6d7b39..f5fcb5ba7 100644 --- a/newlib/libc/machine/arc/Makefile.inc +++ b/newlib/libc/machine/arc/Makefile.inc @@ -22,10 +22,6 @@ libc_a_SOURCES += \ %D%/strcpy-bs.S \ %D%/strcpy-bs-arc600.S \ %D%/strcpy-stub.c \ - %D%/strlen.S \ - %D%/strlen-bs.S \ - %D%/strlen-bs-norm.S \ - %D%/strlen-stub.c \ %D%/strncpy.S \ %D%/strncpy-stub.c \ %D%/strncpy-bs.S diff --git a/newlib/libc/machine/arc/strlen-bs-norm.S b/newlib/libc/machine/arc/strlen-bs-norm.S deleted file mode 100644 index 89c6fcd68..000000000 --- a/newlib/libc/machine/arc/strlen-bs-norm.S +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (c) 2015-2024, Synopsys, Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1) Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2) Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - 3) Neither the name of the Synopsys, Inc., nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -/* This implementation is optimized for performance. For code size a generic - implementation of this function from newlib/libc/string/strlen.c will be - used. */ -#if !defined (__OPTIMIZE_SIZE__) && !defined (PREFER_SIZE_OVER_SPEED) \ - && !defined (__ARC_RF16__) - -#include "asm.h" -#if (defined (__ARC700__) || defined (__ARCEM__) || defined (__ARCHS__)) \ - && defined (__ARC_NORM__) && defined (__ARC_BARREL_SHIFTER__) - -ENTRY (strlen) - or r3,r0,7 - ld r2,[r3,-7] - ld.a r6,[r3,-3] - mov r4,0x01010101 - ; uses long immediate -#ifdef __LITTLE_ENDIAN__ - asl_s r1,r0,3 - btst_s r0,2 - asl r7,r4,r1 - ror r5,r4 - sub r1,r2,r7 - bic_s r1,r1,r2 - mov.eq r7,r4 - sub r12,r6,r7 - bic r12,r12,r6 - or.eq r12,r12,r1 - and r12,r12,r5 - brne r12,0,.Learly_end -#else /* BIG ENDIAN */ - ror r5,r4 - btst_s r0,2 - mov_s r1,31 - sub3 r7,r1,r0 - sub r1,r2,r4 - bic_s r1,r1,r2 - bmsk r1,r1,r7 - sub r12,r6,r4 - bic r12,r12,r6 - bmsk.ne r12,r12,r7 - or.eq r12,r12,r1 - and r12,r12,r5 - brne r12,0,.Learly_end -#endif /* ENDIAN */ - -.Loop: - ld_s r2,[r3,4] - ld.a r6,[r3,8] - ; stall for load result - sub r1,r2,r4 - bic_s r1,r1,r2 - sub r12,r6,r4 - bic r12,r12,r6 - or_l r12,r12,r1 - and r12,r12,r5 - breq_l r12,0,.Loop -.Lend: - and.f r1,r1,r5 - sub.ne r3,r3,4 - mov.eq r1,r12 -#ifdef __LITTLE_ENDIAN__ - sub_s r2,r1,1 - bic_s r2,r2,r1 - norm r1,r2 - sub_s r0,r0,3 - lsr_s r1,r1,3 - sub r0,r3,r0 - j_s.d [blink] - sub_l r0,r0,r1 -#else /* BIG ENDIAN */ - lsr_s r1,r1,7 - mov.eq r2,r6 - bic_s r1,r1,r2 - norm r1,r1 - sub r0,r3,r0 - lsr_s r1,r1,3 - j_s.d [blink] - add_l r0,r0,r1 -#endif /* ENDIAN */ -.Learly_end: - b.d .Lend - sub_s.ne r1,r1,r1 -ENDFUNC (strlen) -#endif /* (__ARC700__ || __ARCEM__ || __ARCHS__) && __ARC_NORM__ - && __ARC_BARREL_SHIFTER__ */ - -#endif /* !__OPTIMIZE_SIZE__ && !PREFER_SIZE_OVER_SPEED */ diff --git a/newlib/libc/machine/arc/strlen-bs.S b/newlib/libc/machine/arc/strlen-bs.S deleted file mode 100644 index 15caa830c..000000000 --- a/newlib/libc/machine/arc/strlen-bs.S +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (c) 2015-2024, Synopsys, Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1) Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2) Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - 3) Neither the name of the Synopsys, Inc., nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -/* This implementation is optimized for performance. For code size a generic - implementation of this function from newlib/libc/string/strlen.c will be - used. */ -#if !defined (__OPTIMIZE_SIZE__) && !defined (PREFER_SIZE_OVER_SPEED) \ - && !defined (__ARC_RF16__) - -#include "asm.h" - -#if (defined (__ARC600__) || !defined (__ARC_NORM__)) && !defined (__ARC601__) \ - && defined (__ARC_BARREL_SHIFTER__) -/* This code is optimized for the ARC600 pipeline. */ - -ENTRY (strlen) - or r3,r0,7 - ld r2,[r3,-7] - ld.a r6,[r3,-3] - mov r4,0x01010101 - ; uses long immediate -#ifdef __LITTLE_ENDIAN__ - asl_s r1,r0,3 - btst_s r0,2 - asl r7,r4,r1 - ror r5,r4 - sub r1,r2,r7 - bic_l r1,r1,r2 - mov.eq r7,r4 - sub r12,r6,r7 - bic r12,r12,r6 - or.eq r12,r12,r1 - and r12,r12,r5 - brne r12,0,.Learly_end -#else /* BIG ENDIAN */ - ror r5,r4 - btst_s r0,2 - mov_s r1,31 - sub3 r7,r1,r0 - sub r1,r2,r4 - bic_l r1,r1,r2 - bmsk r1,r1,r7 - sub r12,r6,r4 - bic r12,r12,r6 - bmsk.ne r12,r12,r7 - or.eq r12,r12,r1 - and r12,r12,r5 - brne r12,0,.Learly_end -#endif /* ENDIAN */ - -.Loop: - ld_s r2,[r3,4] - ld.a r6,[r3,8] - ; stall for load result - sub r1,r2,r4 - bic_s r1,r1,r2 - sub r12,r6,r4 - bic r12,r12,r6 - or_s r12,r12,r1 - and r12,r12,r5 - breq_s r12,0,.Loop -.Lend: - and.f r1,r1,r5 - sub.ne r3,r3,4 -#ifdef __LITTLE_ENDIAN__ - mov.eq r1,r12 - asr.f 0,r1,8 - bmsk.f 0,r1,15 - sub r0,r3,r0 - add.cc r0,r0,1 - jne.d [blink] - asl.f 0,r1,9 - j_s.d [blink] - sbc r0,r0,-2 -#else /* BIG ENDIAN */ - mov.eq r2,r6 - asl_s r2,r2,7 - mov.eq r1,r12 - bic_s r1,r1,r2 - asr.f 0,r1,16 - sub r0,r3,r0 - add.pl r0,r0,1 - jne.d [blink] - add.eq r0,r0,1 - j_s.d [blink] - add.cc r0,r0,1 -#endif /* ENDIAN */ - - .balign 4 -.Learly_end: - b.d .Lend - sub_s.ne r1,r1,r1 -ENDFUNC (strlen) -#endif /* (__ARC600__ || !__ARC_NORM__) && !__ARC601__ && __ARC_BARREL_SHIFTER__ */ - -#endif /* !__OPTIMIZE_SIZE__ && !PREFER_SIZE_OVER_SPEED */ diff --git a/newlib/libc/machine/arc/strlen-stub.c b/newlib/libc/machine/arc/strlen-stub.c deleted file mode 100644 index c52eecaa6..000000000 --- a/newlib/libc/machine/arc/strlen-stub.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (c) 2015-2024, Synopsys, Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1) Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2) Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - 3) Neither the name of the Synopsys, Inc., nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - - -#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) \ - || defined (__ARC_RF16__) -# include "../../string/strlen.c" -#else -/* See strlen-*.S. */ -#endif diff --git a/newlib/libc/machine/arc/strlen.S b/newlib/libc/machine/arc/strlen.S deleted file mode 100644 index 2072f3d15..000000000 --- a/newlib/libc/machine/arc/strlen.S +++ /dev/null @@ -1,166 +0,0 @@ -/* - Copyright (c) 2015-2024, Synopsys, Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1) Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2) Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - 3) Neither the name of the Synopsys, Inc., nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -/* This implementation is optimized for performance. For code size a generic - implementation of this function from newlib/libc/string/strlen.c will be - used. */ -#if !defined (__OPTIMIZE_SIZE__) && !defined (PREFER_SIZE_OVER_SPEED) \ - && !defined (__ARC_RF16__) - -#include "asm.h" - -#if defined(__ARC601__) || !defined (__ARC_BARREL_SHIFTER__) -/* This code is optimized for the ARC601 pipeline without barrel shifter. */ - -ENTRY (strlen) - or r3,r0,7 - ld r2,[r3,-7] - ld.a r6,[r3,-3] - mov r4,0x01010101 - ; uses long immediate -#ifdef __LITTLE_ENDIAN__ - bmsk.f 0,r0,1 - mov_s r1,31 - add3_s r1,r1,r0 - bmsk r7,r4,r1 - xor.ne r7,r7,r4 - btst_s r0,2 - ror r5,r4 - sub r1,r2,r7 - bic_s r1,r1,r2 - mov.eq r7,r4 - sub r12,r6,r7 - bic r12,r12,r6 - or.eq r12,r12,r1 - and r12,r12,r5 - brne r12,0,.Learly_end -#else /* BIG ENDIAN */ - add.f r1,r4,30 ; r1 mod 31 := -1; clear carry - ror r5,r4 - sub3 r7,r1,r0 - btst_s r0,2 - sub r1,r2,r4 - bic_s r1,r1,r2 - bmsk r1,r1,r7 - sub r12,r6,r4 - bic r12,r12,r6 - bmsk.ne r12,r12,r7 - or.eq r12,r12,r1 - and r12,r12,r5 - brne r12,0,.Learly_end -#endif /* ENDIAN */ - -.Loop: - ld_s r2,[r3,4] - ld.a r6,[r3,8] - ; stall for load result - sub r1,r2,r4 - bic_s r1,r1,r2 - sub r12,r6,r4 - bic r12,r12,r6 - or_s r12,r12,r1 - and r12,r12,r5 - breq_s r12,0,.Loop -.Lend: - and.f r1,r1,r5 - sub.ne r3,r3,4 -#ifdef __LITTLE_ENDIAN__ - mov.eq r1,r12 - btst_s r1,7 - sub r0,r3,r0 - add.eq r0,r0,1 - bmsk.f 0,r1,15 - add.eq r0,r0,1 - bmsk.f 0,r1,23 - j_s.d [blink] - add.eq r0,r0,1 -#else /* BIG ENDIAN */ -#ifdef __OPTIMIZE_SIZE__ -1: ldb_s r1,[r3] - breq_s r1,0,0f - ldb.a r1,[r3,1] - breq_s r1,0,0f - ldb.a r1,[r3,1] - breq_s r1,0,0f - add_s r3,r3,1 -0: j_s.d [blink] - sub r0,r3,r0 - -#define SPECIAL_EARLY_END -.Learly_end: - mov_s r3,r0 - b_s 1b -#elif 0 /* Need more information about pipeline to assess if this is faster. */ - mov.eq r2,r6 - and r2,r2,r5 - sub1 r2,r4,r2 - mov.eq r1,r12 - bic.f r1,r1,r2 - sub r0,r3,r0 - add.pl r0,r0,1 - btst.pl r1,23 - add.eq r0,r0,1 - btst.eq r1,15 - j_s.d [blink] - add.eq r0,r0,1 -#else /* !__OPTIMIZE_SIZE__ */ - /* Need carry clear here. */ - mov.eq r2,r6 -1: bmsk r1,r2,23 - breq r1,r2,0f - bmsk r2,r1,15 - breq.d r1,r2,0f - add_s r3,r3,1 - cmp r2,0x100 - add_s r3,r3,2 -0: j_s.d [blink] - sbc r0,r3,r0 - -#define SPECIAL_EARLY_END -.Learly_end: - sub_s.ne r1,r1,r1 - mov_s r12,0 - bset r12,r12,r7 - sub1 r2,r2,r12 - b.d .Lend - sub1.ne r6,r6,r12 -#endif /* !__OPTIMIZE_SIZE__ */ -#endif /* ENDIAN */ - -#ifndef SPECIAL_EARLY_END - .balign 4 -.Learly_end: - b.d .Lend - sub_s.ne r1,r1,r1 -#endif /* !SPECIAL_EARLY_END */ -ENDFUNC (strlen) -#endif /* __ARC601__ || !__ARC_BARREL_SHIFTER__*/ - -#endif /* !__OPTIMIZE_SIZE__ && !PREFER_SIZE_OVER_SPEED */