Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: Joel Soete <soete.joel@tiscali.be>
Cc: parisc-linux@lists.parisc-linux.org
Subject: [parisc-linux] Re: pa_memcpy: 2 small question
Date: Sun, 9 Jan 2005 16:13:56 -0800	[thread overview]
Message-ID: <20050110001356.GO18497@tausq.org> (raw)
In-Reply-To: <41E180EF.8040808@tiscali.be>

> in the shift computing:
>         /* Calculate how to shift a word read at the memory operation
>            aligned srcp to make it aligned for copy.  */
>         sh_1 = 8 * (src % sizeof(unsigned int));
>         sh_2 = 8 * sizeof(unsigned int) - sh_1;
> 
> what means '8' (== 2 * word size; i.e. 2 * 32 bit because MERGE use shrpw 
> and so 2 (a pair of word)? )

no. 8 is # bits/byte. sh_1 is the number of bits to shift a 32-bit
integer.

what we are trying to achieve is that given two adjacent 32-bit numbers,
we want to extract a 32-bit number "in the middle" of the two (aligned)
32-bit values.

if you look carefully, actually the implementation of MERGE does not use
both sh_1 and sh_2. In the original implementation, MERGE was
implemented using two SHIFT operations plus an OR operation. This was
optimized to use shrpw because this PA insn can do all three operations
in a single step, so it saves a lot of cycles.

> next in
>          switch (len % 4)
>         {
> 
> is '4' because as mentioned in copy_dstalign() description this 'Handles 
> _4_ words per loop'

yes.

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  reply	other threads:[~2005-01-10  0:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050105055412.68E06495698@palinux.hppa>
2005-01-05  6:16 ` [parisc-linux] more cpup.c results Grant Grundler
2005-01-05  8:20   ` Joel Soete
2005-01-05  8:40   ` Ryan Bradetich
2005-01-05 16:02     ` Grant Grundler
     [not found] ` <20050107095143.GN18497@tausq.org>
2005-01-09 19:07   ` [parisc-linux] pa_memcpy: 2 small question Joel Soete
2005-01-10  0:13     ` Randolph Chung [this message]
2005-01-10  8:44       ` [parisc-linux] " Joel Soete
2005-01-10  8:54         ` Randolph Chung
2005-01-10 17:12           ` Joel Soete
2005-01-10 17:17             ` Grant Grundler
2005-01-10 20:02             ` Stuart Brady
2005-01-11 18:14           ` Joel Soete
2005-01-12  1:49             ` Randolph Chung
2005-02-20 23:44   ` [parisc-linux] revisit copy_user_page_asm microbenchmarks Grant Grundler

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=20050110001356.GO18497@tausq.org \
    --to=randolph@tausq.org \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=soete.joel@tiscali.be \
    /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