diff mbox series

[04/11] riscv: Add RV64F instructions description

Message ID 20200711161655.2856-5-zhiwei_liu@c-sky.com
State New
Headers show
Series RISC-V risu porting | expand

Commit Message

LIU Zhiwei July 11, 2020, 4:16 p.m. UTC
For supporting multi-precision, split all 32 fp registers into two groups.
The RV64F instructions will use only 16 fp registers selected by gfp32().

Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
---
 rv64.risu | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)
diff mbox series

Patch

diff --git a/rv64.risu b/rv64.risu
index ad5dee9..0dcc9a1 100644
--- a/rv64.risu
+++ b/rv64.risu
@@ -270,3 +270,97 @@  AMOMINU_D  RISCV 11000 imm:2 rs2:5 rs1:5 011 rd:5 0101111 \
 AMOMAXU_D  RISCV 11100 imm:2 rs2:5 rs1:5 011 rd:5 0101111 \
 !constraints { greg($rd) && greg($rs2) && gbase($rs1) && $rs2 != $rs1; }\
 !memory { align(8); reg($rs1, $rd); }
+
+@RV64F
+
+FLW RISCV imm:12 rs1:5 010 rd:5 0000111 \
+!constraints { gbase($rs1) && gfp32($rd); } \
+!memory { align(4); reg_plus_imm($rs1, sextract($imm, 12)); }
+
+FSW RISCV imm5:7 rs2:5 rs1:5 010 imm:5 0100111 \
+!constraints { gbase($rs1) && gfp32($rs2); } \
+!memory { align(4); reg_plus_imm($rs1, sextract($imm5 << 5 | $imm, 12)); }
+
+FMADD_S RISCV rs3:5 00 rs2:5 rs1:5 rm:3 rd:5 1000011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FMSUB_S RISCV rs3:5 00 rs2:5 rs1:5 rm:3 rd:5 1000111 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FNMSUB_S RISCV rs3:5 00 rs2:5 rs1:5 rm:3 rd:5 1001011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FNMADD_S RISCV rs3:5 00 rs2:5 rs1:5 rm:3 rd:5 1001111 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FADD_S RISCV 0000000 rs2:5 rs1:5 rm:3 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FSUB_S RISCV 0000100 rs2:5 rs1:5 rm:3 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FMUL_S RISCV 0001000 rs2:5 rs1:5 rm:3 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FDIV_S RISCV 0001100 rs2:5 rs1:5 rm:3 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd) && grm($rm); }
+
+FSQRT_S RISCV 0101100 00000  rs1:5 rm:3 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rd) && grm($rm); }
+
+FSGNJ_S RISCV 0010000 rs2:5  rs1:5 000 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd); }
+
+FSGNJN_S RISCV 0010000 rs2:5  rs1:5 001 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd); }
+
+FSGNJX_S RISCV 0010000 rs2:5  rs1:5 010 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd); }
+
+FMIN_S RISCV 0010100 rs2:5  rs1:5 000 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd); }
+
+FMAX_S RISCV 0010100 rs2:5  rs1:5 001 rd:5 1010011 \
+!constraints { gfp32($rs1) && gfp32($rs2) && gfp32($rd); }
+
+FCVT_W_S RISCV 1100000 00000 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && grm($rm); }
+
+FCVT_WU_S RISCV 1100000 00001 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && grm($rm); }
+
+FMV_X_W RISCV 1110000 00000 rs1:5 000 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1); }
+
+FEQ_S RISCV 1010000 rs2:5 rs1:5 010 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && gfp32($rs2); }
+
+FLT_S RISCV 1010000 rs2:5 rs1:5 001 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && gfp32($rs2); }
+
+FLE_S RISCV 1010000 rs2:5 rs1:5 000 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && gfp32($rs2); }
+
+FCLASS_S RISCV 1110000 00000 rs1:5 001 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1); }
+
+FCVT_S_W RISCV 1101000 00000 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rs1) && gfp32($rd) && grm($rm); }
+
+FCVT_S_WU RISCV 1101000 00001 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rs1) && gfp32($rd) && grm($rm); }
+
+FMV_W_X RISCV 1111000 00000 rs1:5 000 rd:5 1010011 \
+!constraints { greg($rs1) && gfp32($rd); }
+
+FCVT_L_S RISCV 1100000 00010 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && grm($rm); }
+
+FCVT_LU_S RISCV 1100000 00011 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rd) && gfp32($rs1) && grm($rm);  }
+
+FCVT_S_L RISCV 1101000 00010 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rs1) && gfp32($rd) && grm($rm); }
+
+FCVT_S_LU RISCV 1101000 00011 rs1:5 rm:3 rd:5 1010011 \
+!constraints { greg($rs1) && gfp32($rd) && grm($rm); }