[Mono-dev] Register allocation and overlapping registers

SilentBob cinnamondonkey at gmail.com
Tue Mar 25 16:23:32 UTC 2014


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.


More information about the Mono-devel-list mailing list