[Mono-list] 32-bit vs 64-bit Performance Discrepency

Justin Holewinski justin.holewinski at gmail.com
Wed Oct 26 20:12:40 EDT 2011

On Wed, Oct 26, 2011 at 7:37 PM, Rodrigo Kumpera <kumpera at gmail.com> wrote:

> On Wed, Oct 26, 2011 at 9:06 PM, Justin Holewinski <
> justin.holewinski at gmail.com> wrote:
>> On Wed, Oct 26, 2011 at 6:15 PM, Rodrigo Kumpera <kumpera at gmail.com>wrote:
>>> The CLR demands that all floating point calculations to be conducted with
>>> double precision.
>> Where in the spec does it state this?  Everything I've read allows for
>> both 32-bit and 64-bit representations, with the only restriction being that
>> arithmetic must be performed with enough precision for the expression type.
>> And if 64-bit arithmetic is required, why is 32-bit used in the 32-bit
>> Mono VM, and in the .NET VM?
> 32bits mono uses 64bits precision for both float and double types.

> AFAICT, .net uses 64bits precision on all cases.

I'm getting code like the following on .NET 4.0 x64:

00000099  mov         rcx,qword ptr [rsp+000000D8h]
000000a1  mov         rax,qword ptr [rsp+30h]
000000a6  movss       xmm0,dword ptr [rsp+28h]
000000ac  mulss       xmm0,dword ptr [rcx+rax*4+10h]
000000b2  movss       dword ptr [rsp+38h],xmm0

Is there any way to force Mono to use 32-bit arithmetic for floats?



Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20111026/312a3a60/attachment.html 

More information about the Mono-list mailing list