Convert Integer to Double in MIPS -
i want divide 2 values in $tn
registers.
i have divide these 2 values double result function div
returns integer part of division can out?
do need convert $t1
, $t2
$f0
, $f2
?
how do that?
li $t1,2 li $t2,5 div $f0,$t2,$t1
this gives me error because expects $tn
value not $fn
value...
you have move , convert integer stored in general purpose register floating point or double register.
assuming number stored in $a1
, convert double pair ($f12
, $f13
) have issue:
mtc1.d $a1, $f12 cvt.d.w $f12, $f12
and convert single precision float ($f12
) you'd do:
mtc1 $a1, $f12 cvt.s.w $f12, $f12
Comments
Post a Comment