MIPS中的浮点寄存器是什么数字寄存器? [英] What number registers are the floating point registers in MIPS?

查看:562
本文介绍了MIPS中的浮点寄存器是什么数字寄存器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为与浮点寄存器有关的机器指令写出MIPS二进制代码.但是,尽管我可以找到浮点指令的操作码,但我无法找出哪些数字指的是哪个浮点寄存器.我的书和互联网可以告诉我,如果我想引用$ t1,我将使用哪个数字寄存器,但是我找不到有关如何引用$ f1的任何信息.

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.

推荐答案

有32个浮点寄存器:$f0 .. $f31.但是每个浮点操作都是在单独的处理单元FPU(浮点单元)中完成的(在早期的MIPS处理器中),因此您无法使用普通(整数)命令访问浮点寄存器.用于FPU命令的FPU寄存器和用于CPU命令的CPU寄存器.

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.

有图片和透明的说明 http://www.cim.mcgill.ca/~langer/273 /12-coprocessors.pdf

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

对于协处理器1(CP1),所有FPU命令都被编码为协处理器指令. 检查 http://www.cs.sunysb.edu/的首页和最后一页〜lw/spim/MIPSinstHex.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

字段ft(5)fs(5)fd(5)是寄存器的代码(均为5位宽). $ f0将被编码为0; $ f31为31(十进制)或0x1f(十六进制).对于双寄存器值(64位双格式),仅记录寄存器对中第一个寄存器的数量(仅允许偶数regnumber:0,2 ..30).

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).

详细的操作码表在此处: http://www. math.unipd.it/~sperduti/ARCHITETTURE-1/mips32.pdf (第A-73页)

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

这篇关于MIPS中的浮点寄存器是什么数字寄存器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆