Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux