linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Rees <rees@umich.edu>
To: Benny Halevy <bhalevy@tonian.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>,
	fanchaoting <fanchaoting@cn.fujitsu.com>,
	Benny Halevy <benny@tonian.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch
Date: Sun, 25 Dec 2011 08:54:43 -0500	[thread overview]
Message-ID: <20111225135443.GA19491@umich.edu> (raw)
In-Reply-To: <4EF6B516.5070609@tonian.com>

Benny Halevy wrote:

  > speed = do_div(BENCH_SIZE, 1024) * count * do_div(NSEC_PER_SEC, ns_end);
  > 
  > This might not be exactly right because it changes the operator precedence,
  > but it should eliminate the calls to __udivdi3.
  
  Hmm, you mean execution order? (which you do not)
  C (and fortunately gcc too :) treats multiplication and division with the
  same priority and executes them from left to right...

Yes, execution order.  The original code executes left-to-right, my code
executes the divisions first.

But I wouldn't blindly apply this without understanding what's going on
here.  I thought the -fno-tree-scev-cprop compiler flag was supposed to
emit division code instead of calling into a library.

  reply	other threads:[~2011-12-25 13:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07 14:08 [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch Benny Halevy
2011-12-23  6:41 ` fanchaoting
2011-12-23 13:25   ` Jim Rees
2011-12-25  5:31     ` Benny Halevy
2011-12-25 13:54       ` Jim Rees [this message]
2011-12-25 15:25       ` Boaz Harrosh
2011-12-25 15:57         ` Jim Rees
2011-12-26  7:11         ` Benny Halevy

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=20111225135443.GA19491@umich.edu \
    --to=rees@umich.edu \
    --cc=benny@tonian.com \
    --cc=bhalevy@tonian.com \
    --cc=bharrosh@panasas.com \
    --cc=fanchaoting@cn.fujitsu.com \
    --cc=linux-nfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).