[Mono-bugs] [Bug 68723][Nor] Changed - Performance on long arith

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 25 Oct 2004 11:20:25 -0400 (EDT)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.


--- shadow/68723	2004-10-25 09:44:01.000000000 -0400
+++ shadow/68723.tmp.24324	2004-10-25 11:20:24.000000000 -0400
@@ -138,6 +138,28 @@
 large values of n. In practice the constants may have a large impact
 on the runtime. Professors often don't tell you about this fundamental
 detail, possibly because few of them actually write code.
 The main issue here is that we don't optimize division and modulus by
 power of two on longs and the helper functions are called through the
 icall wrapper which does increase the constant overhead.
+------- Additional Comments From bmaurer@users.sf.net  2004-10-25 11:20 -------
+Actually, we don't optimize div/mod *at all* on powers of 2 for 
+signed types (int or long).
+In my code (but not the origional code) there are a few problems with 
+extra code motion. The problem is that we do not do [mem] = [mem] + c 
+with the ad[dc] [mem], const x86 encoding.
+Also, it is probably possible to optimize the code for n^2 (where n 
+is long). (it is easier to do this for unsigned, am not sure how it 
+would work for signed types).
+Paolo, do you think it is worthwhile to write a 64 bit 
+multiply/divide in assembly to optimize for specific platforms? I 
+don't think it is possible to do this in a cross platform way. Is 
+there any way we could generate the code in a .s file and then safely 
+call it without the icall stuff?
+Maybe its best to first work on the [%/] by two, which can probably 
+be more xplatform.