All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tkhai Kirill <tkhai@yandex.ru>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic
Date: Tue, 10 May 2011 23:21:49 +0000	[thread overview]
Message-ID: <414351305069709@web42.yandex.ru> (raw)
In-Reply-To: <1304845558.9492.14.camel@big>

11.05.11, 00:28, "David Miller" <davem@davemloft.net>:

>I don't understand why you're testing "andcc %o3, %o0, %g0", as %o3 has
>the value computed in "srl %g1, 1, %o3" here.

>What is so interesting about "ptr & (length >> 1)"?

1)Label ccte (rather, cc_end_cruft) copies data sequentially by pieces of length 2^x bytes from biggest to smallest. For example, if %g1 is 15, then the label copies 8+4+2+1\x15, and %o0 must be aligned to 8.

Let alignment a = 2^x. Pointer ptr % a = 0 when:
ptr & (a >> 1) = 0
ptr & (a >> 2) = 0
..

Or, what is the same:
ptr & (length >> 1) = 0
ptr & (length >> 2) = 0
..

I.e. we are looking for right alignment, if another case don't call ccte.

2)We check %o0 only, because %o1 has the same last two bits, and cc_end_cruft writes 4 bytes or less.

  parent reply	other threads:[~2011-05-10 23:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-08  9:05 [PATCH]SPARC32: Fixed unaligned memory copying in function kirill
2011-05-08 23:44 ` David Miller
2011-05-09  8:49 ` [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic Tkhai Kirill
2011-05-09 18:33 ` [PATCH]SPARC32: Fixed unaligned memory copying in function David Miller
2011-05-09 19:55 ` [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic Tkhai Kirill
2011-05-10 12:31 ` Tkhai Kirill
2011-05-10 20:28 ` [PATCH]SPARC32: Fixed unaligned memory copying in function David Miller
2011-05-10 23:21 ` Tkhai Kirill [this message]
2011-05-11 12:53 ` [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic Daniel Hellstrom
2011-05-11 17:10 ` [PATCH]SPARC32: Fixed unaligned memory copying in function David Miller
2011-05-12  4:38 ` David Miller

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=414351305069709@web42.yandex.ru \
    --to=tkhai@yandex.ru \
    --cc=sparclinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.