MIPS - convert integer to floating point??

Reply

Join Date: Mar 2007
Posts: 2
Reputation: ajrabbit is an unknown quantity at this point 
Solved Threads: 0
ajrabbit ajrabbit is offline Offline
Newbie Poster

MIPS - convert integer to floating point??

 
0
  #1
Mar 8th, 2007
does anyone know how to convert an integer (3) to floating point single (3.0) ?

it tried this but got an error bc of the $t3
cvt.w.s $f4, $f4, $t3

i have a value stored in $t3 register and need to move it from there to a fp register like $f6. whqat can i do?
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1
Reputation: kaliko is an unknown quantity at this point 
Solved Threads: 0
kaliko kaliko is offline Offline
Newbie Poster

Re: MIPS - convert integer to floating point??

 
0
  #2
Apr 9th, 2007
try this

float to int
=======
cvt.w.s $f4, $f4
mfc1 $t0,$f4


int to float
=======
mtc1 $t0, $f0
cvt.s.w $f0, $f0


kaliko


Originally Posted by ajrabbit View Post
does anyone know how to convert an integer (3) to floating point single (3.0) ?

it tried this but got an error bc of the $t3
cvt.w.s $f4, $f4, $t3

i have a value stored in $t3 register and need to move it from there to a fp register like $f6. whqat can i do?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC