RV32FDQ/RV64RDQ指令集(1)
Risc-V架构定义了可选的单精度浮点指令(F扩展指令集)和双精度浮点指令(D扩展指令集),以及四精度浮点指令集(Q扩展指令集)。Risc-V架构规定:处理器可以选择只实现F扩展指令子集而不支持D扩展指令子集;但是如果支持了D扩展指令子集,则必须支持F扩展指令子集;如果支持了Q扩展指令集,必须支持D扩展指令集。Risc-V架构规定的浮点数符合IEEE754 2008规则,可以从下面的链接了解浮点数格式的详细信息:
https://www.cnblogs.com/german-iris/p/5759557.html
Risc-V规定,如果支持单精度浮点指令或者双精度浮点指令,四精度浮点指令,则需要增加一组独立的通用浮点寄存器组,包括32个通用浮点寄存器,标号位f0到f31。如果仅支持F扩展指令子集,则每个通用寄存器是32位的,如果支持D扩展指令子集,则每个通用寄存器是64位的,如果支持Q扩展指令集,则每个浮点通用寄存器是128位的。
如果处理器同时支持 RV32F 和 RV32D 扩展,则单精度数据仅使用 f 寄存器中的低 32位。与 RV32I 中的 x0 不同,寄存器 f0 不是硬连线到常量 0, 而是和所有其他 31 个 f 寄存器一样,是一个可变寄存器。下面是32位和64位浮点寄存器的名字,别名和注释。
63-32 | 31-0(名字和别名) | 注释 |
f0/ft0 | FP Temporary | |
f1/ft1 | FP Temporary | |
f2/ft2 | FP Temporary | |
f3/ft3 | FP Temporary | |
f4/ft4 | FP Temporary | |
f5/ft5 | FP Temporary | |
f6/ft6 | FP Temporary | |
f7/ft7 | FP Temporary | |
f8 / fs0 | FP Saved register | |
f9 / fs1 | FP Saved register | |
f10 / fa0 | FP Function argument, return value | |
f11 / fa1 | FP Function argument, return value | |
f12 / fa2 | FP Function argument | |
f13 / fa3 | FP Function argument | |
f14 / fa4 | FP Function argument | |
f15 / fa5 | FP Function argument | |
f16 / fa6 | FP Function argument | |
f17 / fa7 | FP Function argument | |
f18 / fs2 | FP Saved register | |
f19 / fs3 | FP Saved register | |
f20 / fs4 | FP Saved register | |
f21 / fs5 | FP Saved register | |
f22 / fs6 | FP Saved register | |
f23 / fs7 | FP Saved register | |
f24 / fs8 | FP Saved register | |
f25 / fs9 | FP Saved register | |
f26 / fs10 | FP Saved register | |
f27 / fs11 | FP Saved register | |
f28 / ft8 | FP Temporary | |
f29 / ft9 | FP Temporary | |
f30 / ft10 | FP Temporary | |
f31 / ft11 | FP Temporary |
Risc-V架构规定,如果支持浮点指令,需要增加一个浮点控制状态寄存器fcsr,该寄存器是一个可读可写的csr寄存器。
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Reserved | Rounding mode(frm) | accrued exceptions(fflags) |
|||||||||||||||||||||||||||||
NV | DZ | OF | UF | NX |
fcsr寄存器包含浮点异常标志域(fflags),不同的标志位表示不同的异常类型。如果浮点运算单元在运算中出现了相应的异常,则会将fcsr寄存器中对应的标志位设置为1,且会一直保持累积。软件可以通过写0的方式单独清除某个异常标志位。
flag mnemonic | flag meaning |
NV | invalid operation |
DZ | divide by zero |
OF | overflow |
UF | underflow |
NX | inexact,不精确 |
根据IEEE-754标准,浮点运算需要指定舍入模式(rounding mode),这有助于确定误差范围和编写数值库。最准确且最常见的舍入模式是舍入到最近的偶数(RNE)。舍入模式可以通过浮点控制和状态寄存器 fcsr 进行设置。
Risc-V架构浮点运算的舍入模式可以通过两种方式指定。
使用静态舍入模式,浮点指令编码中有3位作为舍入模式域,不同的舍入模式编码如下图,Risc-V支持5种合法的舍入模式。如果舍入模式编码为101或110,则为非法模式;如果舍入模式编码为111,则意味着使用动态舍入模式。如果使用动态舍入模式,则使用fcsr寄存器中的舍入模式域,舍入模式域定义如上图,如果fcsr寄存器中的舍入模式域指定为非法的舍入模式,则后续浮点指令会产生非法指令异常。
rounding mode | mnemonic | meaning |
000 | RNE | round to nearest ties to even,舍入到最近的偶数 |
001 | RTZ | round towards zero 向零舍入 |
010 | RDN | round down(towards -∞),向负无穷舍入 |
011 | RUP | round up(towards +∞),向正无穷舍入 |
100 | RMM | round to nearest ties to max magnitude,向最近的最大值舍入 |
101 | invalid reserved for future use | |
110 | invalid reserved for future use | |
111 | in instruction's rm field, selects dynamic rounding mode; in rounding mode register, invalid. |
如果处理器不想使用浮点单元,比如把浮点单元关电以节省功耗,可以使用csr写指令将mstatus寄存器的FS域设置成0,将浮点单元的功能予以关闭。当浮点单元功能关闭后,任何访问浮点csr寄存器的操作或者执行浮点指令的行为将会产生非法指令异常。
Risc-V规定,对于非规格化数(subnormal Numbers)的处理完全遵循IEEE754定义。根据IEEE-754标准,在浮点数的表示中,有一类特殊编码数据属于NaN(not a number)类型,且NaN分为Signaling-NaN和Quiet-NAN。Risc-V架构规定,如果浮点运算的结果是一个NaN数,那么使用一个固定的NaN数,将之命名为Canonical-NaN。单精度浮点对应的Canonical-NaN数值为0x7fc00000,双精度浮点对应Canonical-NaN数值为0x7ff80000_00000000
如果同时支持单精度浮点(F扩展指令子集)和双精度浮点(D扩展指令子集),由于浮点通用寄存器的宽度为64位,Risc-V架构规定单精度浮点指令产生的32位结果写入浮点通用寄存器(64位)时,将结果写入低32位,而高位全部写入数值1,RiscV架构规定此种做法称之为NaN-Boxing。NaN-boxing可以发生在如下情形:
对于单精度浮点数的读(Load)/写(store)指令和传送(Move)指令(包括FLW,FSW,FMV.W.X,FMV.X.W),如果需要将32位的数值写入通用浮点寄存器,则采用NaN-boxing的方式;如果需要将浮点通用寄存器中的数值读出,则仅使用其低32位值。
对于单精度浮点运算(compute)和符号注入(sign-injection)指令,需要判断其操作数浮点寄存器中的值是否为合法的NaN-Boxed值,即高位都是1,如果是,则正常使用其低32位,如果不是,则将此操作数当作Canonical-NaN来使用。
对于整数至单精度的浮点转化指令(比如FCVT.S.X),则采用NaN-boxing的方式写回浮点通用寄存器。对于单精度浮点至整数的转化指令(比如FCVT.X.S),需要判断其操作数浮点寄存器中的值是否为合法的NaN-boxed值(即高位都为1)。如果是,则正常使用其低32位,如果不是,则将此操作数当作Canonical-NaN来使用。
浮点指令总共96条,指令格式如下列表。
rs2 | rs1 | func3(rm) | rd | opcode | |||||||||||||||||||||||||||||||||||
name | type | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | RV32F | RV64F | RV32D | RV64D | RV32Q | RV64Q |
fadd.s | R | 0 | 0 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||||
fsub.s | R | 0 | 0 | 0 | 0 | 1 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||||
fmul.s | R | 0 | 0 | 0 | 1 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||||
fdiv.s | R | 0 | 0 | 0 | 1 | 1 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||||
fsgnj.s | R | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
fsgnjn.s | R | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
fsgnjx.s | R | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
fmin.s | R | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
fmax.s | R | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
fsqrt.s | R | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fadd.d | R | 0 | 0 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||||
fsub.d | R | 0 | 0 | 0 | 0 | 1 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||||
fmul.d | R | 0 | 0 | 0 | 1 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||||
fdiv.d | R | 0 | 0 | 0 | 1 | 1 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||||
fsgnj.d | R | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
fsgnjn.d | R | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
fsgnjx.d | R | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
fmin.d | R | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
fmax.d | R | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
fcvt.s.d | R | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.d.s | R | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fsqrt.d | R | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fadd.q | R | 0 | 0 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||||
fsub.q | R | 0 | 0 | 0 | 0 | 1 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||||
fmul.q | R | 0 | 0 | 0 | 1 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||||
fdiv.q | R | 0 | 0 | 0 | 1 | 1 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||||
fsgnj.q | R | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
fsgnjn.q | R | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
fsgnjx.q | R | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
fmin.q | R | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
fmax.q | R | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
fcvt.s.q | R | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.q.s | R | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.d.q | R | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.q.d | R | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fsqrt.q | R | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fle.s | R | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
flt.s | R | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
feq.s | R | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | |||||||||||||||
fle.d | R | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
flt.d | R | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
feq.d | R | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | |||||||||||||||
fle.q | R | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
flt.q | R | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
feq.q | R | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | |||||||||||||||
fcvt.w.s | R | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.wu.s | R | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.l.s | R | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.lu.s | R | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fmv.x | R | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||
fclass.s | R | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||
fcvt.w.d | R | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fcvt.wu.d | R | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fcvt.l.d | R | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fcvt.lu.d | R | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fmv.x | R | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||
fclass.d | R | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||
fcvt.w.q | R | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.wu | R | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.l.q | R | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.lu.q | R | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fmv.x | R | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||
fclass.q | R | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||
fcvt.s.w | R | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.s.wu | R | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.s.l | R | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fcvt.s.lu | R | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||
fmv.w | R | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | √ | ✘ | ✘ | ✘ | ✘ | ✘ | ||||||||||
fcvt.d.w | R | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fcvt.d.wu | R | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||
fcvt.d.l | R | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | √ | ✘ | ✘ | ||||||||||||
fcvt.d.lu | R | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | √ | ✘ | ✘ | ||||||||||||
fmv.d.x | R | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||
fcvt.q.wu | R | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.q.wu | R | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.q.lu | R | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fcvt.q.lu | R | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | rm | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||
fmv.q | R | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||
imm | |||||||||||||||||||||||||||||||||||||||
11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | rs1 | func3 | rd | opcode | ||||||||||||||||||||||||
name | type | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | RV32F | RV64F | RV32D | RV64D | RV32Q | RV64Q |
flw | I | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||||||||||||
fld | I | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||||||||||||
flq | I | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||||||||||||
imm | imm | ||||||||||||||||||||||||||||||||||||||
11 | 10 | 9 | 8 | 7 | 6 | 5 | rs2 | rs1 | func3 | 4 | 3 | 2 | 1 | 0 | opcode | ||||||||||||||||||||||||
name | type | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | RV32F | RV64F | RV32D | RV64D | RV32Q | RV64Q |
fsw | S | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||||||||||||
fsd | S | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||||||||||||
fsq | S | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||||||||||||
rs3 | rs2 | rs1 | func3(rm) | rd | opcode | ||||||||||||||||||||||||||||||||||
name | type | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | RV32F | RV64F | RV32D | RV64D | RV32Q | RV64Q |
fmadd.s | R4 | 0 | 0 | rm | 1 | 0 | 0 | 0 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||||||||||||
fmsub.s | R4 | 0 | 0 | rm | 1 | 0 | 0 | 0 | 1 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||||||||||||
fnmsub.s | R4 | 0 | 0 | rm | 1 | 0 | 0 | 1 | 0 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||||||||||||
fnmadd.s | R4 | 0 | 0 | rm | 1 | 0 | 0 | 1 | 1 | 1 | 1 | √ | √ | ✘ | ✘ | ✘ | ✘ | ||||||||||||||||||||||
fmadd.d | R4 | 0 | 1 | rm | 1 | 0 | 0 | 0 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||||||||||||
fmsub.d | R4 | 0 | 1 | rm | 1 | 0 | 0 | 0 | 1 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||||||||||||
fnmsub.d | R4 | 0 | 1 | rm | 1 | 0 | 0 | 1 | 0 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||||||||||||
fnmadd.d | R4 | 0 | 1 | rm | 1 | 0 | 0 | 1 | 1 | 1 | 1 | ✘ | ✘ | √ | √ | ✘ | ✘ | ||||||||||||||||||||||
fmadd.q | R4 | 1 | 1 | rm | 1 | 0 | 0 | 0 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||||||||||||
fmsub.q | R4 | 1 | 1 | rm | 1 | 0 | 0 | 0 | 1 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||||||||||||
fnmsub.q | R4 | 1 | 1 | rm | 1 | 0 | 0 | 1 | 0 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ | ||||||||||||||||||||||
fnmadd.q | R4 | 1 | 1 | rm | 1 | 0 | 0 | 1 | 1 | 1 | 1 | ✘ | ✘ | ✘ | ✘ | √ | √ |
RV32FDQ/RV64RDQ指令集(1)的更多相关文章
- RV32FDQ/RV64RDQ指令集(2)
下面我们逐个看下每个指令的细节: fadd.s fadd.s rd, rs1, rs2 //f [rd] = f [rs1] + f [rs2]单精度浮点加(Floating-point Ad ...
- SSE指令集学习:Compiler Intrinsic
大多数的函数是在库中,Intrinsic Function却内嵌在编译器中(built in to the compiler). 1. Intrinsic Function Intrinsic Fun ...
- ARM-汇编指令集(总结)
ARM汇编指令集 指令.伪指令 (汇编)指令: 是机器码的助记符,经过汇编器编译后,由CPU执行. (汇编)伪指令:用来指导指令执行,是汇编器的产物,最终不会生成机器码. 有两种不同风格的ARM指 ...
- iOS------苹果设备处理器指令集(iPhone初代到iPhone5s)
(via 雅香小筑) Arm处理器,因为其低功耗和小尺寸而闻名,几乎所有的手机处理器都基于arm,其在嵌入式系统中的应用非常广泛,它的性能在同等功耗产品中也很出色. Armv6.armv7.armv7 ...
- SSE指令集优化学习:双线性插值
对SSE的学习总算迈出了第一步,用2天时间对双线性插值的代码进行了优化,现将实现的过程梳理以下,算是对这段学习的一个总结. 1. 什么是SSE 说到SSE,首先要弄清楚的一个概念是SIMD(单指令多数 ...
- RISC指令集的五个周期
RISC指令集的五个周期 RISC(reduced instruction set computer,精简指令集计算机)简称为精简指令集.RISC把执行指令的精力主要放在了经常使用的指令上面.本文主要 ...
- x86指令集同频性能提升
x86近5000条指令,迄今为止最复杂的指令集.这里不研究CISC & RISC,也不考虑process制程变化,主要是看最近几代IA架构对于同频率下性能的提升. x86指令集nasm文档 h ...
- CPU指令集
cpu作为一台电脑中的核心,它的作用是无法替代的.而cpu本身只是在块硅晶片上所集成的超大规模的集成电路,集成的晶体管数量可达到上亿个,是由非常先进复杂的制造工艺制造出来的,拥有相当高的科技含量. C ...
- 在UWP应用中加入Cortana语音指令集
本文介绍小娜语音指令集的使用场景,如何将UWP应用接入小娜的语音指令集,使用户直接通过小娜启动应用并使用应用中 一些轻量级的功能.文中以必应词典作为实例讲解必应词典UWP版本是如何接入小娜语音功能的. ...
随机推荐
- ubuntu18.04 安装 flameshot截图工具
安装flameshot:https://github.com/lupoDharkael/flameshot sudo apt-get install flameshot 然后设置一个快捷键,设置> ...
- PAT 1007 Maximum Subsequence Sum 最大连续子序列和
Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni ...
- ADO.NET ORM数据库增删改查封装(工具一)
约束 public abstract class BaseModel { public int Id { get; set; } } 连接字符串 public static readonly stri ...
- Selenium(六):frame切换、窗口切换
1. 切换到frame index.html: <!DOCTYPE html> <html> <head> <meta charset="UTF-8 ...
- SpringCloud(四):使用Feign实现声明式服务调用
一.Feign介绍Feign是一个声明式的伪Http客户端,它使得写Http客户端变得更简单.使用Feign,只需要创建一个接口并注解.它具有可插拔的注解特性,可使用Feign 注解和JAX-RS注解 ...
- electronr进行签名与公证
windows: 1.设置package.json的有关window打包的相关内容 "win": { "icon": "build/icons/ico ...
- js截取两个字符串之间的子字符串
// 截取两个字符串之间的子字符串,返回第一个 function subStringOne(text, begin, end) { var regex; if (end == '\\n') regex ...
- 使用MailKit发送带有内嵌图片的邮件且图片不显示成附件
使用MailKit发送带有内嵌图片的邮件且图片不显示成附件 参考文章:MailKit---发送邮件 注意 在邮件客户端中是否显示内嵌图片为附件依据不同邮件有所不同,暂经测试Outlook和qq不显示为 ...
- 005 C/C++ 数据类型_void
1.void的字面意思是'无类型'.void * 是无类型指针,void * 可以指向任何类型的数据. 2.数据类型的分装: int InitHardEnv(void ** handle); 典型的内 ...
- acwing 848 有向图的拓扑序列
地址 https://www.acwing.com/problem/content/description/850/ 题目描述给定一个n个点m条边的有向图,图中可能存在重边和自环. 请输出任意一个该有 ...