From patchwork Tue Aug 20 12:10:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 96150 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D9F03870864 for ; Tue, 20 Aug 2024 12:13:07 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by sourceware.org (Postfix) with ESMTPS id 5A1353845158 for ; Tue, 20 Aug 2024 12:11:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A1353845158 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 5A1353845158 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155914; cv=none; b=KNjes9Hdx8bpn/KQ3XarGTDF3sq4ZCuYdoYqK3NvzMRe9x6KLTLpiPQAdU2AYLZPuhwcqoKVZuiErZWLNXv1DiROm+VOKWKnvq8vdfh9hhbuVUeAzMR0IlDJ8eL1JbCLuIGF6xZmoWTeS2/OTBP1eLOIOU2zfYysPc8GtmeEbv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724155914; c=relaxed/simple; bh=3H+Og91xTu4CqX57aU2HZ6dXNRFnIULl/fNPZhDQ62c=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=rloJb54wKtJp3uuTgGfsyEtGb2clb9cnNsArKz5KjGCu2wPwiTqHbBErFibnaISo9uawiJB7cv1DNXMuHEtnz3B7ymfrqluFB3zLZcPbLQPk41lIOMIeNa1XL3nd6UKXXZSndXOp8BhEPqZpa+/luECaSCQ8riJ294zlgjbdzdE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47KBaLq4031022; Tue, 20 Aug 2024 05:11:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pfptdkimsnps; bh=4pB4Q+zE dAKhaevC7NZS51yqq29Aovd/XQ61IeiyL7s=; b=LNEn7zL5AhZ9qYm1xpQ7N9o/ 9XqdPkcuTd3d3/Z0UJtLKUM+/CvoibHcocug4heMmYCQ3MWu+n/K3vRTbimb7A+y aVHXSlG1dsceZctfn81h+7kbuAQmzzySvHQuQDKbMXZ0Yjw1gIw0T5F18a4qcKzn W1iHDTyZT8fDqf7cGJYKjMZ3bQdQ96b0VHRkFQjXG7myzP6PwMHm4VyCkjzITQqB aytEI6KOXAbG1t6v6BFTdmsl3at89R/cLHfonGxJTTbogle/I7+YsEFLU/GBHqwf gDixJFaMRSEL9FWV+N+9iiFpZhc2NICPKigNYBMLV7eehB0+9KCJpTx4eh38Qw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 414g8kjmxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Aug 2024 05:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1724155891; bh=3H+Og91xTu4CqX57aU2HZ6dXNRFnIULl/fNPZhDQ62c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SzXpHcktge2t5qL+kyQjDKljuAGBSNV2mHowRB88+TGzLNU+6DaRd4vBr/U/QIMVz hHxPhQRQkAatxF0Uhac6Te5TF5H6fb6T6LjwD/aA8HkTPcBihXkFnfsp032VqGOdCI DL/1DtHwIDHftaEM9EyPHn+vdbdczN8zwxIykUxGV27rU7bgm0kh0qZkGuCj+gcrgT 6f/0wxg+wXxU+JZ7fGS6zQfJ7wxKJoIyCNAvDCLPVQkrhu5REmfsH+G52qvt6SuNEi fTkYzP1VvAVWTet0Hyb+MUQbudXIYO4toyEoSFy0eIVtXd0ZtNDMcPKLhcqdSOeeou LP6zQ453K0EDQ== Received: from mailhost.synopsys.com (eudc-mailhost2.synopsys.com [10.213.161.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 4082B40340; Tue, 20 Aug 2024 12:11:31 +0000 (UTC) Received: from SNPS-HRlPxd6IgG.internal.synopsys.com (snps-hrlpxd6igg.internal.synopsys.com [10.120.15.83]) (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 ESMTPSA id A8A87C0CFA; Tue, 20 Aug 2024 12:11:29 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Yuriy.Kolerov@synopsys.com To: newlib@sourceware.org Cc: Claudiu Zissulescu Subject: [PATCH 4/8] arc: Use __ARC_UNALIGNED__ compiler macro Date: Tue, 20 Aug 2024 15:10:39 +0300 Message-Id: <20240820121043.1605628-5-ykolerov@synopsys.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820121043.1605628-1-ykolerov@synopsys.com> References: <20240820121043.1605628-1-ykolerov@synopsys.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=VcqlP0p9 c=1 sm=1 tr=0 ts=66c48807 cx=c_pps a=t4gDRyhI9k+KZ5gXRQysFQ==:117 a=t4gDRyhI9k+KZ5gXRQysFQ==:17 a=yoJbH4e0A30A:10 a=pGLkceISAAAA:8 a=lUg8dyFN0qjm751KY2IA:9 X-Proofpoint-GUID: Md5tRu_c9ZjWuvaBqqPMS7cDD47WNkTQ X-Proofpoint-ORIG-GUID: Md5tRu_c9ZjWuvaBqqPMS7cDD47WNkTQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-20_09,2024-08-19_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 mlxscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=898 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408200090 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: 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 From: Claudiu Zissulescu Replace __ARC_ALIGNED_ACCESS__ macro with the compiler defined macro __ARC_UNALIGNED__ and improve file comments. Signed-off-by: Claudiu Zissulescu --- newlib/libc/machine/arc/memcpy-archs.S | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/newlib/libc/machine/arc/memcpy-archs.S b/newlib/libc/machine/arc/memcpy-archs.S index f30dafd4f..3c477a745 100644 --- a/newlib/libc/machine/arc/memcpy-archs.S +++ b/newlib/libc/machine/arc/memcpy-archs.S @@ -70,7 +70,21 @@ # define ZOLAND 0xF #endif -#ifdef __ARC_ALIGNED_ACCESS__ + +;;; MEMCPY copy memory regions +;;; Input arguments: +;;; r0 - output memory region +;;; r1 - input memory region +;;; r2 - size in bytes +;;; Returns: +;;; r0 - pointer to the first byte of the output region +;;; Clobber: +;;; r1, r2, r3, r4, r5, r6, r8r9, r10r11, lp_count + +#if !defined (__ARC_UNALIGNED__) + +;;; MEMCPY routine for the case when the CPU only accepts ALIGNED +;;; accesses to memory. ENTRY (memcpy) prefetch [r1] ; Prefetch the read location prefetchw [r0] ; Prefetch the write location @@ -268,6 +282,8 @@ ENDFUNC (memcpy) #else +;;; MEMCPY routine which is used by systems with unaligned memory +;;; accesses. This is the case for most of ARCHS CPU family. ENTRY(memcpy) prefetch [r1] ; Prefetch the read location prefetchw [r0] ; Prefetch the write location