Menu

#71 floating point mtc1 problem

v1.0_(example)
closed
1
2016-02-27
2016-02-26
PhilipM
No

In the following minimum example, mtc1 should set $f4 to the bit pattern of int 3 so the following cvt.s.w instruction can convert that to the FP bit pattern for 3.0. But the actual effect is that $f4 remains zero (before and after the cvt.s.w instruction). Tested on Mac version 9.1.7 downloaded today (and whatever the earler version was that I had before)
.text
main: li $t0, 3 # set up int value
mtc1 $t0, $f4 # move int to float register
cvt.s.w $f4, $f4 # convert float register to float value
jr $ra

Either this is a bug or I am seriously misunderstanding how coprocessor instructions work.

To make it more interesting, if I change the display mode to binary, the FP register DOES change and ends up as 3.0 when I change the display back to decimal mode.

Discussion

  • James Larus

    James Larus - 2016-02-27
    • status: open --> closed
     
  • James Larus

    James Larus - 2016-02-27

    Fixed in revision 689.

     

Anonymous
Anonymous

Add attachments
Cancel