My method is to spill the int register and load into the float register and then convert
li $t0, 2
sw $t0, -88($fp)
l.s $f4, -88($fp)
cvt.d.s $f6, $f4
I'm trying to translate an expression like
float a = 3.0;
float b = a / 2;
But the above method doesn't give me a proper answer (print out inf
).
So where have I done wrong? Any suggestions?
P.S. 2
doesn't know the lhs operand is a float type so I can not load 2.0
instead