From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109315 invoked by alias); 20 Jul 2017 14:19:47 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 109294 invoked by uid 89); 20 Jul 2017 14:19:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Jul 2017 14:19:44 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1A2EC045746 for ; Thu, 20 Jul 2017 14:19:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F1A2EC045746 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vinschen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F1A2EC045746 Received: from calimero.vinschen.de (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A4D717C10 for ; Thu, 20 Jul 2017 14:19:42 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 0D615A806EF; Thu, 20 Jul 2017 16:19:42 +0200 (CEST) Date: Thu, 20 Jul 2017 14:19:00 -0000 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH] arm: Update strcpy.c to use UAL syntax. Message-ID: <20170720141942.GC19395@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20170719210243.8975-1-itessier@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qlTNgmc+xy1dBmNv" Content-Disposition: inline In-Reply-To: <20170719210243.8975-1-itessier@google.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-SW-Source: 2017/txt/msg00610.txt.bz2 --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2320 On Jul 19 14:02, Ian Tessier via newlib wrote: > With this change the arm platform can now be fully compiled with Clang. >=20 > Tested by comparing the output with GCC 4.8.2, and Clang 4.0, using a > variety of arches, big/little endianness, and arm/thumb mode to verify > the generated assembly output matches between GCC vs Clang with UAL, and > also GCC with UAL vs GCC with non-UAL, for all preprocessor code blocks. >=20 > The only difference found is an extra nop at the end of the function > when compiled with GCC using armv7-a/thumb/little-endian/-O2 compared to > Clang. The nop is not emitted when compiled in big-endian mode. > --- > newlib/libc/machine/arm/strcpy.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/newlib/libc/machine/arm/strcpy.c b/newlib/libc/machine/arm/s= trcpy.c > index f1205b9c1..154451110 100644 > --- a/newlib/libc/machine/arm/strcpy.c > +++ b/newlib/libc/machine/arm/strcpy.c > @@ -42,6 +42,7 @@ char* __attribute__((naked)) > strcpy (char* dst, const char* src) > { > asm ( > + ".syntax unified\n\t" > #if !(defined(__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \ > (defined (__thumb__) && !defined (__thumb2__))) > #ifdef _ISA_ARM_7 > @@ -127,15 +128,15 @@ strcpy (char* dst, const char* src) > #ifdef __ARMEB__ > "tst r2, #0xff00\n\t" > "iteet ne\n\t" > - "strneh r2, [ip], #2\n\t" > + "strhne r2, [ip], #2\n\t" > "lsreq r2, r2, #8\n\t" > - "streqb r2, [ip]\n\t" > + "strbeq r2, [ip]\n\t" > "tstne r2, #0xff\n\t" > #else > "tst r2, #0xff\n\t" > "itet ne\n\t" > - "strneh r2, [ip], #2\n\t" > - "streqb r2, [ip]\n\t" > + "strhne r2, [ip], #2\n\t" > + "strbeq r2, [ip]\n\t" > "tstne r2, #0xff00\n\t" > #endif > "bne 5b\n\t" > @@ -162,9 +163,9 @@ strcpy (char* dst, const char* src) > "mov r3, r0\n\t" > "1:\n\t" > "ldrb r2, [r1]\n\t" > - "add r1, r1, #1\n\t" > + "adds r1, #1\n\t" > "strb r2, [r3]\n\t" > - "add r3, r3, #1\n\t" > + "adds r3, #1\n\t" > "cmp r2, #0\n\t" > "bne 1b\n\t" > "bx lr\n\t" > --=20 > 2.14.0.rc0.284.gd933b75aa4-goog Pushed. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --qlTNgmc+xy1dBmNv Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZcLv9AAoJEPU2Bp2uRE+g/GIP/RMELuEwa+cd6p1cFFQkAWJN ZHvJ7QDlrbF1yeqHFCoMEOML02gCpSgopZWqDqsH5k13Uw4fnA1dBnbwDJ+Mgjon BmRg3TUo70DR1cIesjNV1ANnpFshIcFv/n1Bo+obIlPfstga30N8+eOYFv9/aKPa yCpHL6twyoefLhJLBl4rgLuPKxA71XSMZTHqIbkKYvRIEFemLJlrrODr8H09wPJk OCuKEF1Ix4DkDwlKCpFUKetnEY/7E6BRBLbryGvH/B6VlSPbvxpBd/5pkckSsFtk mnD4/fi3TfRsIqWm0LpP9NwXz+5rlaGMWXQyDK4RxpZt6OniHL6Z086QX/HYGAw4 l5D8CUcLwcu8NsYg6gmHMGJqWPeyC06iCKknJ5JjxiQjMnK46rL8mc3Mclch3l6P BM46oQq3DOFF5IAVgvroiJqoLSAyHxXiZHwJhEQTU6VVfvmidOjdJSs28V33l6Tc ugEoEAFZdqkvIBiu4xPxiMGfwMOI8N1EMqQclMfEodeLUlLqaabs5ztbdp/NT5UI yOs5A8ZfoCpYHkYeynpH6OHfuixUweke0A/M3lvz+0YjJ6FnKgpbJN713Be8TpDr jm5z2grOkmuixKaNw03q5/jsNEw3yqhFYYTUlSZkurowUhDCvwrive16NJgsSQV6 +0TfBMvk6P5ETyuJBVko =zGcF -----END PGP SIGNATURE----- --qlTNgmc+xy1dBmNv--