From patchwork Mon Dec 27 19:05:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Engel X-Patchwork-Id: 49299 X-Patchwork-Delegate: rearnsha@gcc.gnu.org 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 ADB213858437 for ; Mon, 27 Dec 2021 19:15:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by sourceware.org (Postfix) with ESMTPS id CFFB13858002 for ; Mon, 27 Dec 2021 19:09:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFFB13858002 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=danielengel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=danielengel.com Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9569F3200A2F; Mon, 27 Dec 2021 14:09:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 27 Dec 2021 14:09:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=danielengel.com; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=+jg/M2rD61KvL gRAkbI80kCQ3hn84b063qPBrj4sQmo=; b=hg0fMakmGypdo6OebmzWao4U+QW7u mvAdKk2dRETEJWe6XVGZ5EwWJ4vMx9LKjK5MMPR11yUnkOM9fbPOhpfbcyMbbio3 RafZLiASvB1MXKkOvrJWgdTEY9bzvcFyp9y6FGP/GaqMk8Bix4Qs/4RDgFOslx/Y vwUONTe6FEtR6hgv0vD60Ee1Laug4VGdRSZy4V3aUHDEtN6G6Tqk7m3wCJnd6R+l wa/vsMAVuOZKOIG57IjJKXnHOa2xhkQmWPwmAbBk6uXEb9Q+XrXuOR3XpzZfdqz+ JRtzAw9sJs6NgseJOx1HqT0JORu7bAWRIdwZdfHDAD1W6niOjy0bze+uQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+jg/M2rD61KvLgRAkbI80kCQ3hn84b063qPBrj4sQmo=; b=KP1VzTW/ g4OStJmnf1duN9ZhWoCz1ivakaedgQ2KyPvwPfg7llspCDUpxSJoGyRWo5Io361Z 4JtYZCGvwKzCuPC6tv+GiXciSCaXV3MBdSBMwU2H1wjlou+16REoFwKjG9xYupo3 6VqtuKxJ8TH3E5YjjmLPLCq2s8f7/ze1F+myaWItUZkJXtvYOB376I+cBvDvdl2o O2DPC4PbMOp38s6VPfE+x42CQAJaMAB+2OmentBfcB4R3a/M4scDkhRasODedbXp JGBxn+7buOVof/ciz/dwT9//qxz4IYA1eENOYn20gK+FYFBCyMoI3P9FsB5W8YIU AUiFsZAo+3SL+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddujedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhi vghlucfgnhhgvghluceoghhnuhesuggrnhhivghlvghnghgvlhdrtghomheqnecuggftrf grthhtvghrnhepteetueejhfeuteegjeeiheefgeeuteelvedttdfhgeevuefhveeiveev feehiefgnecuffhomhgrihhnpegsphgrsghiqdhviehmrdhssgdplhgtmhhprdhssgdpgh hnuhdrohhrghdplhhisgdufhhunhgtshdrshgsnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepghhnuhesuggrnhhivghlvghnghgvlhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Dec 2021 14:09:06 -0500 (EST) Received: from ubuntu.lorien.danielengel.com (ubuntu.lorien.danielengel.com [10.0.0.96]) by sendmail.lorien.danielengel.com (8.15.2/8.15.2) with ESMTP id 1BRJ95mw060960; Mon, 27 Dec 2021 11:09:05 -0800 (PST) (envelope-from gnu@danielengel.com) From: Daniel Engel To: Richard Earnshaw , gcc-patches@gcc.gnu.org Subject: [PATCH v6 16/34] Refactor Thumb-1 64-bit comparison into a new file Date: Mon, 27 Dec 2021 11:05:12 -0800 Message-Id: <20211227190530.3136549-17-gnu@danielengel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211227190530.3136549-1-gnu@danielengel.com> References: <20211227190530.3136549-1-gnu@danielengel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Engel , Christophe Lyon Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This will make it easier to isolate changes in subsequent patches. gcc/libgcc/ChangeLog: 2021-01-13 Daniel Engel * config/arm/bpabi-v6m.S (__aeabi_lcmp, __aeabi_ulcmp): Moved to ... * config/arm/eabi/lcmp.S: New file. * config/arm/lib1funcs.S: #include eabi/lcmp.S. --- libgcc/config/arm/bpabi-v6m.S | 46 ---------------------- libgcc/config/arm/eabi/lcmp.S | 73 +++++++++++++++++++++++++++++++++++ libgcc/config/arm/lib1funcs.S | 1 + 3 files changed, 74 insertions(+), 46 deletions(-) create mode 100644 libgcc/config/arm/eabi/lcmp.S diff --git a/libgcc/config/arm/bpabi-v6m.S b/libgcc/config/arm/bpabi-v6m.S index 069fcbbf48c..a051c1530a4 100644 --- a/libgcc/config/arm/bpabi-v6m.S +++ b/libgcc/config/arm/bpabi-v6m.S @@ -33,52 +33,6 @@ .eabi_attribute 25, 1 #endif /* __ARM_EABI__ */ -#ifdef L_aeabi_lcmp - -FUNC_START aeabi_lcmp - cmp xxh, yyh - beq 1f - bgt 2f - movs r0, #1 - negs r0, r0 - RET -2: - movs r0, #1 - RET -1: - subs r0, xxl, yyl - beq 1f - bhi 2f - movs r0, #1 - negs r0, r0 - RET -2: - movs r0, #1 -1: - RET - FUNC_END aeabi_lcmp - -#endif /* L_aeabi_lcmp */ - -#ifdef L_aeabi_ulcmp - -FUNC_START aeabi_ulcmp - cmp xxh, yyh - bne 1f - subs r0, xxl, yyl - beq 2f -1: - bcs 1f - movs r0, #1 - negs r0, r0 - RET -1: - movs r0, #1 -2: - RET - FUNC_END aeabi_ulcmp - -#endif /* L_aeabi_ulcmp */ .macro test_div_by_zero signed cmp yyh, #0 diff --git a/libgcc/config/arm/eabi/lcmp.S b/libgcc/config/arm/eabi/lcmp.S new file mode 100644 index 00000000000..336db1d398c --- /dev/null +++ b/libgcc/config/arm/eabi/lcmp.S @@ -0,0 +1,73 @@ +/* Miscellaneous BPABI functions. Thumb-1 implementation, suitable for ARMv4T, + ARMv6-M and ARMv8-M Baseline like ISA variants. + + Copyright (C) 2006-2020 Free Software Foundation, Inc. + Contributed by CodeSourcery. + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + + +#ifdef L_aeabi_lcmp + +FUNC_START aeabi_lcmp + cmp xxh, yyh + beq 1f + bgt 2f + movs r0, #1 + negs r0, r0 + RET +2: + movs r0, #1 + RET +1: + subs r0, xxl, yyl + beq 1f + bhi 2f + movs r0, #1 + negs r0, r0 + RET +2: + movs r0, #1 +1: + RET + FUNC_END aeabi_lcmp + +#endif /* L_aeabi_lcmp */ + +#ifdef L_aeabi_ulcmp + +FUNC_START aeabi_ulcmp + cmp xxh, yyh + bne 1f + subs r0, xxl, yyl + beq 2f +1: + bcs 1f + movs r0, #1 + negs r0, r0 + RET +1: + movs r0, #1 +2: + RET + FUNC_END aeabi_ulcmp + +#endif /* L_aeabi_ulcmp */ + diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S index bd84a3e4281..5e24d0a6749 100644 --- a/libgcc/config/arm/lib1funcs.S +++ b/libgcc/config/arm/lib1funcs.S @@ -1991,5 +1991,6 @@ LSYM(Lchange_\register): #include "bpabi.S" #else /* NOT_ISA_TARGET_32BIT */ #include "bpabi-v6m.S" +#include "eabi/lcmp.S" #endif /* NOT_ISA_TARGET_32BIT */ #endif /* !__symbian__ */