From owner-freebsd-arm@FreeBSD.ORG Mon Apr 6 22:35:42 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0659CD70 for ; Mon, 6 Apr 2015 22:35:42 +0000 (UTC) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD4288 for ; Mon, 6 Apr 2015 22:35:41 +0000 (UTC) Received: by iedfl3 with SMTP id fl3so37191428ied.1 for ; Mon, 06 Apr 2015 15:35:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=FnukCbJOtTnsXZLyJBpM/hyBmaQmU0+je4wZiGFHXq4=; b=KbagvW2gpfS/e8aw8kZKd3wovWHH/rP+T7Txpra95BzWJ8Y8l/OH7t/jw63Lpr8M3u Vb/A2xgEBlr9NPrUUqzNo3IhOnCZaRMC7Ll0PDjx+b5x2dl7c5Z1lmGaVopoGK7Dm1YQ M1gbP4aZl1oIHE1VkQbY4z7xKZx4P64W0t/Gvxms57oI7Ci0fFvTjo++I4ZFuTTqZcXO mVsvX6Raf+tqn8Zk4Bda0ghwjZDW11shWU5V/z2nDFmhEJqdYaZBEGi4eIUtxvR6nQxC IMqQeXZq9gpjDCsCwrk1sYL3InYPF4fYiPwlU4LlOZjTD/eiTY4NMHeuPN7Bejq0xHSi sGrg== X-Gm-Message-State: ALoCoQlwChSz5NCTd9Va7oIbFynGOfV6KF5aSK7Yfq2ktJZ90F165udl7Q6o2i2/MV0mNBlBzQQL X-Received: by 10.50.43.136 with SMTP id w8mr864977igl.26.1428359403394; Mon, 06 Apr 2015 15:30:03 -0700 (PDT) Received: from netflix-mac.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id p76sm3548018iop.14.2015.04.06.15.30.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Apr 2015 15:30:02 -0700 (PDT) Sender: Warner Losh Subject: Re: remove broken lib/libc/arm/string/memcpy_xscale.S Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_91BBA9EB-A0B9-4A15-90D0-0D76930AE3A3"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <20150406222407.GB51048@funkthat.com> Date: Mon, 6 Apr 2015 16:30:01 -0600 Message-Id: <20DF0E2C-3552-4E55-8656-301EA8CD41C6@bsdimp.com> References: <20150405015245.GO51048@funkthat.com> <1428341561.82583.154.camel@freebsd.org> <20150406222407.GB51048@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-arm@FreeBSD.org, Ian Lepore X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2015 22:35:42 -0000 --Apple-Mail=_91BBA9EB-A0B9-4A15-90D0-0D76930AE3A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 6, 2015, at 4:24 PM, John-Mark Gurney wrote: >=20 > Warner Losh wrote this message on Mon, Apr 06, 2015 at 16:15 -0600: >>=20 >>> On Apr 6, 2015, at 11:32 AM, Ian Lepore wrote: >>>=20 >>> On Mon, 2015-04-06 at 09:58 -0600, Warner Losh wrote: >>>>> On Apr 4, 2015, at 7:52 PM, John-Mark Gurney = wrote: >>>>>=20 >>>>> I would like to remove this file as it does not implement our = defined >>>>> memcpy. Per POSIX, overlapping regions passed to memcpy is = undefined >>>>> behavior. We have defined it to have the same symatics as = memmove. >>>>>=20 >>>>> Sample test program: >>>>> #include >>>>> #include >>>>>=20 >>>>> char bufa[512] =3D "this is a test buffer that should be copied = fine."; >>>>> int >>>>> main() >>>>> { >>>>>=20 >>>>> memcpy(&bufa[10], &bufa[0], strlen(&bufa[10])); >>>>> printf("%s\n", bufa); >>>>>=20 >>>>> return 0; >>>>> } >>>>>=20 >>>>> Output on amd64 HEAD: >>>>> this is a this is a test buffer that should be co >>>>>=20 >>>>> Output on old armv4 from 9.x: >>>>> this is a this is a thst buffethst bufhould beufh >>>>>=20 >>>>> If you just look at the file, it is clear that the implementation = does >>>>> not adjust the copy direction based upon pointers. We imported = the >>>>> code from NetBSD, and NetBSD does apparently require memcpy's = arguments >>>>> to be non-overlapping. >>>>>=20 >>>>> I'll remove the file shortly unless someone can prove to me that = all >>>>> uses of memcpy in our tree do not depend upon our defined behavior >>>>> per memcpy(3)'s man page. >>>>=20 >>>> Any chance you can fix this implementation instead? >>>>=20 >>>> Warner >>>=20 >>> I don't think we should be wasting our scarce developer resources = trying >>> to redevelop high-performance string functions for long-obsolete arm >>> hardware. Just revert to the generic implementations, and perhaps >>> someone who actually uses that old hardware will contribute high >>> performance implementations that follow the rules. >>>=20 >>> Hmmm, does netbsd have xscale performance implementations of = memmove()? >>> Maybe we can just drop that in as memcpy(). Any more work than that = is >>> probably wasted effort at this late date. >>=20 >> I just looked at what NetBSD has. I???ve looked at the assembly here. >> I think that we should just use the generic implementation now. These = routines >> are optimized for xscale, and don???t seem to be that much better = than the >> generic routines. >=20 > I've looked and I don't see a version of memmove.S in NetBSD... There = is > lib/libc/arch/arm/string/bcopy.S which includes memmove.S, but I can't > find memmove.S in their tree... It could be a generated file as I = don't > know their build infrastructure... bcopy is memmove with a different arg order, so they do assembler tricks = to provide both interfaces. Warner --Apple-Mail=_91BBA9EB-A0B9-4A15-90D0-0D76930AE3A3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVIwjpAAoJEGwc0Sh9sBEA/B0QANNlzI3/B7vV8A+9G5xIB8/u wk9Wtq11VItmwHit+wNUYRQpP36EtZEd/3jK3vy7o0DfCekH4+TIh1499GyEZaVD NoQn/7GEoGsKhNDVdi5uxQxwrKXDHFdFxRHwumJvUnk5DHMQRo+VL45lX+bEwfak EkGWIs9Q5GZC5v9KDkvfQMt02xIq7IMHdIxjcDs6zfALenGg3I1yH9/FCGctu26O xICQ9SUnAewLWT1GhvJcF+nAPhmGXlSILjPXJJp+W7WZTmz/G6s+A5zv4fHZElwt TLYWftQj7WWpnlcWWiILT+hg948rgDCgpzJuRfPw0ZjcXSJNBnJKZNGmozHmih5y d2DXkHgh28iONt+GmSx+Xh70HCVc0tWgq/KQsyi9AhP8NjKNfcs63JqUSTfvSJVT XHG9+l8++fk3paAO+ZXE1+OOJPekylcxQRZ54fhHdxutywz5ssZo/zJ9EC4O7RMr C05hAI7m6xeltv+M76NLTEFdwPJ79te+xISzTcFM/ScZUJWfqYmk/OS5BAfR0boS XEgryW5ujDAcYtmjvX7Aizj8Kyxo7gCrL3wr+i5GeyTiOz12ko6U6fcv+K6jp7gA 215xzmuBWC1fBJyvz7ehK6YeqkWKHFZnAvXNaFrv2UUjJ00ZWPgm3jgMXOYGrVfJ VDzpzXnKBKluXFJsWBqe =FSWq -----END PGP SIGNATURE----- --Apple-Mail=_91BBA9EB-A0B9-4A15-90D0-0D76930AE3A3--