mipsmips32fpumips64

Difference between single and double precision instructions


We all know that MIPS FPU has two precisions, single or double. When I looked it in the instruction set, I found for a same operation, the instruction for single precision and double precision have no different.

For example, here from the MIPS Architecture For Programmers Volume II: , the instruction ADD.fmt enter image description here

No matter it is double or single precision, the operand and function code are both same. How decoder know it is a single or double precision instruction? Or any hidden information in the 5-bit fmt region? I can not find any good answers from google, can someone explain how this instruction works?


Solution

  • The MIPS documentation has details on this, under "FPU Operand Format Field". The fmt field contains that specific data.

    The fmt field is 5 bit length and it can take the following values:

    0-15: reserved
    16: single
    17: double
    18-19: reserved
    20: word
    21: long
    22-31: reserved
    

    Word and Long are Unimplemented for ADD.S and ADD.D.