Linux OpenRISC platform development
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [RFC 02/12] openrisc: always use unaligned-struct header
Date: Sat, 8 May 2021 11:42:13 +0000	[thread overview]
Message-ID: <7f2ca7e366a444108932c4c3bb95c2f9@AcuMS.aculab.com> (raw)
In-Reply-To: <20210507220813.365382-3-arnd@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)


  parent reply	other threads:[~2021-05-08 11:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 22:07 [OpenRISC] [RFC 0/12] Unify asm/unaligned.h around struct helper Arnd Bergmann
2021-05-07 22:07 ` [OpenRISC] [RFC 02/12] openrisc: always use unaligned-struct header Arnd Bergmann
2021-05-07 23:02   ` Stafford Horne
2021-05-08 11:42   ` David Laight [this message]
2021-05-07 22:07 ` [OpenRISC] [RFC 0/12] Unify asm/unaligned.h around struct helper Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f2ca7e366a444108932c4c3bb95c2f9@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=openrisc@lists.librecores.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox