Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp986525pxj; Sat, 8 May 2021 04:44:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM1X5KOxkVboo/vTtdkg/yOj4ySskDPSmZGUuFOoXEVfIze8yTye6dPg7PaDQ+exWvKDTr X-Received: by 2002:a17:906:c44d:: with SMTP id ck13mr15444616ejb.371.1620474246762; Sat, 08 May 2021 04:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620474246; cv=none; d=google.com; s=arc-20160816; b=kmO0TG8X5J63oblcsi1HRut6UGjjobBDoM1U+GXJP1rkA2ljD5a+UGGJyWFG6Y4C6q MhWzxiwZxuCXTbLkbscZK6OTrGZ6M1Nwtt5zCg5SCu51GGPgi7HJs0moghKpGmZ8V7J7 r8AIybXlpknEOoGNN7LTi+ui/EGuGZfREwzwCYzO33vmeIBLcUTeysXR/7piw2jzGQBR wSSF13d/4gYheIKBb1rnDzhzK5XPX+ArlmYDEkiMfX8RcGVR9aXnJ0KWCmlK3oSiuRIH J/bUU3fNFVhPhN2+wuFEjrwp8X4Ax+0F3XspcQetkJrAc9wmBNoO9xSpMavQCEc4RdUQ ZMCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=ZSnXxAuVrU0LwnQQ69i9ViGgM20zwaCbUeicxYu4/GI=; b=wnar1ISsW9daHn5nliJB58znXHISVZhifZuzL9vXCiAUACOMTapwe/UVzPgLA+fC1I nd0FQgytPXfMTvKe3sCejjbA1OiVa8ZMAR1LPNutG9jYuA5sPA6Tic9hpfIhWPhnyHWs v1sCJJp1Y3qL5vYd404ny+U94Zsy1n37afrPhnfpCSctIggq0VmpUgr7loSGsvljgbOT 13fO1QeknXH8cZv3pGFPkPGKuoX1z+vSZgcQ04rIAgQ1d6rqcfqa5H8CTlMPbkC+Wcal TzHOV800AKIMi79+m9lyLS830WqEaz8Bd4QxlHGes7RJAo2JAKHQiH5IhcDeYa0f/YXh jrHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s2si7796687edr.28.2021.05.08.04.43.42; Sat, 08 May 2021 04:44:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230234AbhEHLnU convert rfc822-to-8bit (ORCPT + 99 others); Sat, 8 May 2021 07:43:20 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:26373 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbhEHLnT (ORCPT ); Sat, 8 May 2021 07:43:19 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-30-pslduLlcNaOjNqxPJEEhyg-1; Sat, 08 May 2021 12:42:15 +0100 X-MC-Unique: pslduLlcNaOjNqxPJEEhyg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 8 May 2021 12:42:13 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Sat, 8 May 2021 12:42:13 +0100 From: David Laight To: 'Arnd Bergmann' , "linux-arch@vger.kernel.org" CC: Linus Torvalds , Vineet Gupta , Arnd Bergmann , Jonas Bonn , Stefan Kristiansson , Stafford Horne , "openrisc@lists.librecores.org" , "linux-kernel@vger.kernel.org" Subject: RE: [RFC 02/12] openrisc: always use unaligned-struct header Thread-Topic: [RFC 02/12] openrisc: always use unaligned-struct header Thread-Index: AQHXQ42+sCloTJU1UUOieiWkxU7/TarZco2w Date: Sat, 8 May 2021 11:42:13 +0000 Message-ID: <7f2ca7e366a444108932c4c3bb95c2f9@AcuMS.aculab.com> References: <20210507220813.365382-1-arnd@kernel.org> <20210507220813.365382-3-arnd@kernel.org> In-Reply-To: <20210507220813.365382-3-arnd@kernel.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann > Sent: 07 May 2021 23:08 ... > I don't know how the loads/store perform compared to the shift version > on a particular microarchitecture, but my guess is that the shifts > are better. What does the nios use? Shifts generate reasonable code for put_unaligned() but they get horrid for get_unaligned(). On the nios writing the 4 bytes to memory and reading back a 32bit value should generate shorter faster code. You do need to generate 4 byte loads, 4 bytes stores, 32bit load. (The load will cause a stall if the data is needed for one of the next two instructions, and there is a (undocumented) stall between a write and read to the same memory area. The shift version requires 3 shifts and 3 ors - but I think gcc makes a bigger pig's breakfast of it.) OTOH I'm not sure anyone in their right mind would run Linux on nios. It is a soft cpu for the altera (now intel) fpgas. We use them with 4k code and sub 64k data for real time processing. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)