1

I'm trying to create an equivalent of li for double-precision numbers. It seems like the following should work, but it doesn't:

.main: 
    li $t0, 0
    li $t1, 5
    mtc1 $t1, $f12
    mtc1 $t0, $f13
    li $v0, 3
    syscall

When I look at $f12 and $f13 it has the value 5, which I think should be interpreted as 5*2^0. But it's not. Instead, it gives me 2.5E-323. What am I doing wrong? I think SPIM lets you do this, so I've been diving through their source unsuccessfully to copy it.

Xodarap
  • 11,581
  • 11
  • 56
  • 94

1 Answers1

2

You have created a denormalized number (using an exponenent value of zero and a non-zero mantissa). You need to look at the format of doubles.

Doug Currie
  • 40,708
  • 1
  • 95
  • 119