What number registers are the floating point registers in MIPS?

爱⌒轻易说出口 提交于 2020-01-05 02:42:06

问题


I am trying to write out MIPS binary code for machine instructions which have to do with floating-point registers. But while I can find the opcode for the floating-point instructions, I can't find out what numbers refer to which floating-point registers. My book and the Internet can tell me which number register I would use if I wanted to refer to $t1, but I can't find any information on how I would refer to $f1.


回答1:


There are 32 floating point registers: $f0..$f31. But every floating point operation is done (in early MIPS processors) in separate processing unit, FPU (Floating point unit), so you can't access floating point registers with ordinary (integer) command. FPU registers for FPU commands and CPU registers for CPU commands.

There is a picture and transparent description http://www.cim.mcgill.ca/~langer/273/12-coprocessors.pdf

All FPU commands are encoded as Coprocessor Instructions, for coprocessor 1 (CP1) Check first and last pages of http://www.cs.sunysb.edu/~lw/spim/MIPSinstHex.pdf

Fields ft(5) fs(5) fd(5) are codes of registers (all are 5 bit wide). $f0 will be coded as 0; $f31 as 31 (dec) or 0x1f (hex). For double-register values (64-bit double format), only number of first register from register pair is recorded (only even regnumber is allowed: 0,2 ..30).

Detailed tables of opcodes are here: http://www.math.unipd.it/~sperduti/ARCHITETTURE-1/mips32.pdf (page A-73)



来源:https://stackoverflow.com/questions/14902712/what-number-registers-are-the-floating-point-registers-in-mips

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!