From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 21 14:31:07 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A92E106566B for ; Tue, 21 Aug 2012 14:31:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 475FF8FC15 for ; Tue, 21 Aug 2012 14:31:06 +0000 (UTC) Received: by yenl7 with SMTP id l7so7107587yen.13 for ; Tue, 21 Aug 2012 07:31:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=Z8zhGvHY93h9EY1pX0YkjsVQ0qYTIAiQ0DLQIrqs7y8=; b=H0KUgH4QqfH6MymGHpi6wgn5bfA4NSqi1Et7jUxED1+L2qU77DI5UX2WI/9LT0xaQr +M65FzjY6qwO16SDIv5aQs/AgHYkWElJcPnhZyqruTrdb1yFFrNrwFwjALw0VT3b5n8o MoJPM+hAdMlt+LpGaHbMvirj8ZOa3QwqyW3llNszDZp1zVX4AErUBdg+htFcAvUMODyI L7U9UvrJYeN71SYdaBdF92iO2QdvNekxr2NAzQFpt1STomS8GY/4Zeodo9fi3GisbubC mQ9e90gqw5ruIBIHucv+r+2doB9uXs7pn0JSbwDuSdkxfAzoQTgCRTcvMCvDEE2UB8in toSA== Received: by 10.60.3.202 with SMTP id e10mr12977176oee.52.1345559465531; Tue, 21 Aug 2012 07:31:05 -0700 (PDT) Received: from [192.168.100.235] (70-90-212-28-saltlake.hfc.comcastbusiness.net. [70.90.212.28]) by mx.google.com with ESMTPS id th3sm1375715obb.6.2012.08.21.07.31.02 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 07:31:04 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20120821112655.GA90066@alchemy.franken.de> Date: Tue, 21 Aug 2012 08:31:00 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <92186FE4-F83A-43A2-B1C9-85A1C42513AC@bsdimp.com> References: <50324DB4.6080905@cabletv.dp.ua> <5452BF37-3658-4C1F-B965-CE3EA28B6EA5@bsdimp.com> <20120821112655.GA90066@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQnaq2qVyzrz43TPGvQTZDHK+N4yj+gZSuLbwjSRMR/YDm2WMUHDEuWdKxGvsMFU1a8ct3LP Cc: Wojciech Puchar , freebsd-net@freebsd.org, Mitya , freebsd-hackers@freebsd.org Subject: Re: Replace bcopy() to update ether_addr X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 14:31:07 -0000 On Aug 21, 2012, at 5:26 AM, Marius Strobl wrote: > On Mon, Aug 20, 2012 at 01:20:29PM -0600, Warner Losh wrote: >>=20 >> On Aug 20, 2012, at 1:17 PM, Wojciech Puchar wrote: >>=20 >>>>> or use ++. >>>>>=20 >>>>> i think it is always aligned to 2 bytes and this should produce = usable code on any CPU? should be 6 instructions on MIPS and PPC IMHO. >>>>=20 >>>> We should tag it as __aligned(2) then, no? If so, then the = compiler should generate the code you posted. >>> should is the most important word in Your post. what it actually do = - i don't know. >>=20 >> If we are requiring this to be __aligned(2), we should tag it as such = to enforce this. >>=20 >> Even without this tagging, the code to do a structure level copy of 6 = bytes is going to be tiny... >>=20 >=20 > While the __aligned(2) approach certainly works, I've actually rather > mixed experiences on x86 with it as the compiler doesn't necessarily > produce the small and efficient one would expect from code it. Such > a change certainly shouldn't be done just on the assumption that the > compiler has all hints required to produce good code from it but the > resulting asm should be verified across all affected architectures. Very true... I would have thought that went without saying... Warner=