From patchwork Mon Oct 24 14:48:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59356 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 56F8B3858439 for ; Mon, 24 Oct 2022 14:49:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56F8B3858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666622953; bh=24R3TRRfksky7c9TMTayIZQ1Dxs8VOksAY3Qs5M/qSs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=GpP3wwdtMkvVYrrjdycLumcVJbFJufwT42jepVKtb5neVBllhGBhluzD4ZgjhI/gw RKbJ4rf0jVCXkoGjeIizHMrU5kKYOt4zuGINj+ldFLpqXe4iAvrx9/UaRpkGaBTB8K YbFN8XZbBnNXcEIb9JthINgdSXpVWKezGwja4770= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id 66D86385840A for ; Mon, 24 Oct 2022 14:48:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 66D86385840A Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-13b103a3e5dso12130673fac.2 for ; Mon, 24 Oct 2022 07:48:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=24R3TRRfksky7c9TMTayIZQ1Dxs8VOksAY3Qs5M/qSs=; b=WX02VAF1+VHZ+yj6pw+llRlfjT5hV9QAMoCK4ilLGcsR9HuK/By2gQhXbmRPhUrt11 iyaQvNV3fcJ97KfbfwDfvzJPkgIje6fi4QsLUqsMGsVpG5FKtawLXd0XJIDTRLpv0MfQ 2hQoqp6r1fam1ZIahDwv66sjCsJjzORWUBVpFiUtYvUpYv/2Y8yLSRZ1o+OUYf7zpCu2 Nz4o3seazcWhg1BuwXwtM5Ot0vWSwU+I7RtzEzL27kYH9K/QhWURfhXQTyoikdxOEnyV htL0u7U/V+bnw+H2DDXQn2t/bsrgnXcl0Drx/Q7Fp/+MLuEPQbD1KBOOU5hUEtexHc2y JSPg== X-Gm-Message-State: ACrzQf2jpq5xs5xtLBSt4+A56dzCp+g06Z9OH2+RgAm1YJk/ZB4ZUBFk S7DPlj5IrHXTByJcIj3gybzDtOcK592GJK3W X-Google-Smtp-Source: AMsMyM4AAMuLjxhmpknKYVhkM2Mj7EKSHqIf0npNyB90DFd91jRTrgORvs0ystHdy6J7A8ZJriSiyQ== X-Received: by 2002:a05:6870:9706:b0:13b:636a:a20a with SMTP id n6-20020a056870970600b0013b636aa20amr6684967oaq.153.1666622924789; Mon, 24 Oct 2022 07:48:44 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:17c8:f598:607a:3fd4:e32a]) by smtp.gmail.com with ESMTPSA id bj2-20020a056808198200b0035468f2d410sm4085029oib.55.2022.10.24.07.48.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 07:48:44 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [COMMITTED] Remove all assembly optimizations for htonl and htons Date: Mon, 24 Oct 2022 11:48:38 -0300 Message-Id: <20221024144838.676492-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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 server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The builtin bswap is already used if optimziation is enabled for GCC 4.8+, so glibc symbols will be used in a very limited scenarios. Also, gcc generated code is quite similar to all but ia64 and i386 htons. Checked on alpha, i686, and ia64. --- sysdeps/alpha/htonl.S | 43 ------------------------------------------- sysdeps/alpha/htons.S | 39 --------------------------------------- sysdeps/i386/htons.S | 35 ----------------------------------- sysdeps/ia64/htonl.S | 29 ----------------------------- sysdeps/ia64/htons.S | 29 ----------------------------- 5 files changed, 175 deletions(-) delete mode 100644 sysdeps/alpha/htonl.S delete mode 100644 sysdeps/alpha/htons.S delete mode 100644 sysdeps/i386/htons.S delete mode 100644 sysdeps/ia64/htonl.S delete mode 100644 sysdeps/ia64/htons.S diff --git a/sysdeps/alpha/htonl.S b/sysdeps/alpha/htonl.S deleted file mode 100644 index e205295933..0000000000 --- a/sysdeps/alpha/htonl.S +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1996-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include - -ENTRY(htonl) -#ifdef PROF - ldgp gp, 0(pv) - .set noat - lda AT, _mcount - jsr AT, (AT), _mcount - .set at - .prologue 1 -#else - .prologue 0 -#endif - - inslh a0, 7, t0 # t0 = 0000000000AABBCC - inswl a0, 3, t1 # t1 = 000000CCDD000000 - or t1, t0, t1 # t1 = 000000CCDDAABBCC - srl t1, 16, t2 # t2 = 0000000000CCDDAA - zapnot t1, 0x0A, t0 # t0 = 00000000DD00BB00 - zapnot t2, 0x05, t3 # t3 = 0000000000CC00AA - addl t0, t3, v0 # v0 = ssssssssDDCCBBAA - ret - - END(htonl) - -weak_alias (htonl, ntohl) diff --git a/sysdeps/alpha/htons.S b/sysdeps/alpha/htons.S deleted file mode 100644 index e44824ef9c..0000000000 --- a/sysdeps/alpha/htons.S +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1996-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include - -ENTRY(htons) -#ifdef PROF - ldgp gp, 0(pv) - .set noat - lda AT, _mcount - jsr AT, (AT), _mcount - .set at - .prologue 1 -#else - .prologue 0 -#endif - - extwh a0, 7, t1 # t1 = bb00 - extbl a0, 1, v0 # v0 = 00aa - bis v0, t1, v0 # v0 = bbaa - ret - - END(htons) - -weak_alias (htons, ntohs) diff --git a/sysdeps/i386/htons.S b/sysdeps/i386/htons.S deleted file mode 100644 index c53de9df1c..0000000000 --- a/sysdeps/i386/htons.S +++ /dev/null @@ -1,35 +0,0 @@ -/* Change byte order in word. For Intel 80x86, x >= 3. - Copyright (C) 1997-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include "asm-syntax.h" - -/* - INPUT PARAMETERS: - word (sp + 4) -*/ - - .text -ENTRY (htons) - movl 4(%esp), %eax - andl $0xffff, %eax - rorw $8, %ax - ret -END (htons) - -weak_alias (htons, ntohs) diff --git a/sysdeps/ia64/htonl.S b/sysdeps/ia64/htonl.S deleted file mode 100644 index 109802967d..0000000000 --- a/sysdeps/ia64/htonl.S +++ /dev/null @@ -1,29 +0,0 @@ -/* Change byte order in 32-bit value. ia64 version. - Copyright (C) 2000-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - - -#include - -ENTRY(htonl) - shl ret0 = r32, 32 - ;; - mux1 ret0 = ret0, @rev - ret -END(htonl) - -weak_alias (htonl, ntohl) diff --git a/sysdeps/ia64/htons.S b/sysdeps/ia64/htons.S deleted file mode 100644 index 5d53b33a06..0000000000 --- a/sysdeps/ia64/htons.S +++ /dev/null @@ -1,29 +0,0 @@ -/* Change byte order in 16-bit value. ia64 version. - Copyright (C) 2000-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - - -#include - -ENTRY(htons) - shl ret0 = r32, 48 - ;; - mux1 ret0 = ret0, @rev - ret -END(htons) - -weak_alias (htons, ntohs)