[Mono-dev] Register allocation and overlapping registers

Zoltan Varga vargaz at gmail.com
Tue Mar 25 17:10:09 UTC 2014


Hi,

  The mono JIT only uses double precision registers in most cases and only
uses single precision ones for temporary purposes, like to implement casts.
There were some problems with choosing these temporary registers, but they
should be fixed in 3.4.0/master.

             Zoltan


On Tue, Mar 25, 2014 at 12:23 PM, SilentBob <cinnamondonkey at gmail.com>wrote:

> Hi,
>
> I'm hoping someone can provide some insight into how the cross-compiler
> handles allocating registers when the registers overlap.
>
> I'm looking at a case on ARM where the following code:
>
>     double d = 7.2199997900000001;
>     float f = (f)d;
>
> Results in:
>
>     vcvt.f32.f64 s4, d2
>
> Because the 'd' registers are made up of pairs of 's' registers (in this
> case d2 overlaps with s4 and s5) there is the potential for collision as in
> this case. The end result is that d2 changes as s4 is updated. It would be
> fine if it was not for d2 then being used immediately by the next
> instruction.
>
> mono_local_regalloc () in mini-codegen.c seems to be translating
> 'float_conv_to_r4 R25 <- R24' and ending up with dreg = 4 and sreg1 = 4
> this
> eventually gets emitted as above.
>
> Thank you in advance for all help.
>
> Regards,
> Shaun
>
>
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Register-allocation-and-overlapping-registers-tp4662363.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20140325/d3685b09/attachment.html>


More information about the Mono-devel-list mailing list