RISC-V MCU中文社区

【分享】 浮点指令(四<修改>)

发表于 全国大学生集成电路创新创业大赛 2023-05-25 10:56:57
0
639
0

团队介绍

报名编号:CICC3940
团队名称:树上鸟儿成双队

fmv.x.w
fmv.x.w rd, rs1, rs2 //x[rd] = sext(f[rs1][31:0])
单精度浮点移动(Floating-point Move Word to Integer). R-type, RV32F and RV64F.
把寄存器 f[rs1]中的低32位整数复制到 x[rd]中作为一个单精度浮点数表示。

fclass.s
fclass.s rd, rs1, rs2 //x[rd] = classifys(f[rs1])
单精度浮点分类(Floating-point Classify, Single-Precision). R-type, RV32F and RV64F.
把一个表示寄存器 f[rs1]中单精度浮点数类别的掩码写入 x[rd]中。 x[rd]中有且仅有一位被置上,见下表
图片alt

fcvt.w.d
fcvt.w.d rd, rs1, rs2 //x[rd] = sext(s32f64(f[rs1]))
双精度浮点向字转换(Floating-point Convert to Word from Double). R-type, RV32D and RV64D
把寄存器 f[rs1]中的双精度浮点数转化为 32 位二进制补码表示的整数,再写入 x[rd]中。

fcvt.wu.d
fcvt.wu.d rd, rs1, rs2 //x[rd] = sext(u32f64(f[rs1]))
双精度浮点向无符号字转换(Floating-point Convert to Unsigned Word from Double). R-type,RV32D and RV64D.
把寄存器 f[rs1]中的双精度浮点数转化为 32 位无符号整数,再写入 x[rd]中。

fcvt.l.d
fcvt.l.d rd, rs1, rs2 //x[rd] = s64f64(f[rs1])
双精度浮点向长整型转换(Floating-point Convert to Long from Double). R-type, RV64D.
把寄存器 f[rs1]中的双精度浮点数转化为 64 位二进制补码表示的整数,再写入 x[rd]中。

fcvt.lu.d
fcvt.lu.d rd, rs1, rs2 //x[rd] = u64f64(f[rs1])
双精度浮点向无符号长整型转换(Floating-point Convert to Unsigned Long from Double). Rtype, RV64D.
把寄存器 f[rs1]中的双精度浮点数转化为 64 位无符号整数,再写入 x[rd]中。

fmv.x.d
fmv.x.d rd, rs1, rs2 //x[rd] = f[rs1][63:0]
双精度浮点移动(Floating-point Move Doubleword to Integer). R-type, RV64D.
把寄存器 f[rs1]中的双精度浮点数复制到 x[rd]中。

fclass.d
fclass.d rd, rs1, rs2 //x[rd] = classifyd(f[rs1])
双精度浮点分类(Floating-point Classify, Double-Precision). R-type, RV32D and RV64D.
把一个表示寄存器 f[rs1]中双精度浮点数类别的掩码写入 x[rd]中。关于如何解释写入 x[rd]的值,请参阅指令 fclass.s 的介绍。

fcvt.s.w
fcvt.s.w rd, rs1, rs2 //f[rd] = f32s32(x[rs1])
字向单精度浮点转换(Floating-point Convert to Single from Word). R-type, RV32F and RV64F.
把寄存器 x[rs1]中的 32 位二进制补码表示的整数转化为单精度浮点数,再写入 f[rd]中。

fcvt.s.wu
fcvt.s.wu rd, rs1, rs2 //f[rd] = f32u32(x[rs1])
无符号字向单精度浮点转换(Floating-point Convert to Single from Unsigned Word). R-type,RV32F and RV64F.
把寄存器 x[rs1]中的 32 位无符号整数转化为单精度浮点数,再写入 f[rd]中。

fcvt.s.l
fcvt.s.l rd, rs1, rs2 //f[rd] = f32s64(x[rs1])
长整型向单精度浮点转换(Floating-point Convert to Single from Long). R-type, RV64F.
把寄存器 x[rs1]中的 64 位二进制补码表示的整数转化为单精度浮点数,再写入 f[rd]中。

fcvt.s.lu
fcvt.s.lu rd, rs1, rs2 //f[rd] = f32u64(x[rs1])
无符号长整型向单精度浮点转换(Floating-point Convert to Single from Unsigned Long). R-type,RV64F.
把寄存器 x[rs1]中的 64 位的无符号整数转化为单精度浮点数,再写入 f[rd]中。

fmv.w.x
fmv.x.w rd, rs1, rs2 //x[rd] = sext(f[rs1][31:0])
单精度浮点移动(Floating-point Move Word to Integer). R-type, RV32F and RV64F.
把寄存器 f[rs1]中的补码表示的整数复制到 x[rd]中作为单精度浮点数,。

fcvt.d.w
fcvt.d.w rd, rs1, rs2 //f[rd] = f64s32(x[rs1])
字向双精度浮点转换(Floating-point Convert to Double from Word). R-type, RV32D and RV64D.
把寄存器 x[rs1]中的 32 位二进制补码表示的整数转化为双精度浮点数,再写入 f[rd]中。

fcvt.d.wu
fcvt.d.wu rd, rs1, rs2 //f[rd] = f64u32(x[rs1])
无符号字向双精度浮点转换(Floating-point Convert to Double from Unsigned Word). R-type,RV32D and RV64D.
把寄存器 x[rs1]中的 32 位无符号整数转化为双精度浮点数,再写入 f[rd]中。

喜欢0
用户评论
LiYH

LiYH 实名认证


积分
问答
粉丝
关注
  • RV-STAR 开发板
  • RISC-V处理器设计系列课程
  • 培养RISC-V大学土壤 共建RISC-V教育生态
RV-STAR 开发板