All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arch: ia64: kernel: palinfo.c:  Optimization of the Code
Date: Mon, 02 Jun 2014 07:24:04 +0000	[thread overview]
Message-ID: <538C2694.1090308@ladisch.de> (raw)
In-Reply-To: <1401659019-17586-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Rickard Strandqvist wrote:
> From what I know, AND is faster then modulo.

Which is why the compiler does this optimization automatically,
if it can prove that it is correct.

> -		if (i != 0 && (i%64) = 0)
> +		if (i != 0 && (i&63) = 0)

Did you prove that i cannot be negative?


Regards,
Clemens

WARNING: multiple messages have this Message-ID (diff)
From: Clemens Ladisch <clemens@ladisch.de>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arch: ia64: kernel: palinfo.c:  Optimization of the Code
Date: Mon, 02 Jun 2014 09:24:04 +0200	[thread overview]
Message-ID: <538C2694.1090308@ladisch.de> (raw)
In-Reply-To: <1401659019-17586-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Rickard Strandqvist wrote:
> From what I know, AND is faster then modulo.

Which is why the compiler does this optimization automatically,
if it can prove that it is correct.

> -		if (i != 0 && (i%64) == 0)
> +		if (i != 0 && (i&63) == 0)

Did you prove that i cannot be negative?


Regards,
Clemens

  reply	other threads:[~2014-06-02  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01 21:43 [PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code Rickard Strandqvist
2014-06-01 21:43 ` Rickard Strandqvist
2014-06-02  7:24 ` Clemens Ladisch [this message]
2014-06-02  7:24   ` Clemens Ladisch
2014-06-02 17:59   ` Rickard Strandqvist
2014-06-02 17:59     ` Rickard Strandqvist

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=538C2694.1090308@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=fenghua.yu@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tony.luck@intel.com \
    /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.