| 1 |
4 |
sergeykhbr |
/**
|
| 2 |
|
|
* @file
|
| 3 |
|
|
* @copyright Copyright 2016 GNSS Sensor Ltd. All right reserved.
|
| 4 |
|
|
* @author Sergey Khabarov - sergeykhbr@gmail.com
|
| 5 |
|
|
* @brief RISC-V extension-F (Floating-point Instructions).
|
| 6 |
|
|
*/
|
| 7 |
|
|
|
| 8 |
|
|
#include "api_utils.h"
|
| 9 |
|
|
#include "riscv-isa.h"
|
| 10 |
|
|
#include "cpu_riscv_func.h"
|
| 11 |
|
|
|
| 12 |
|
|
namespace debugger {
|
| 13 |
|
|
|
| 14 |
|
|
void CpuRiver_Functional::addIsaExtensionF() {
|
| 15 |
|
|
// TODO
|
| 16 |
|
|
/*
|
| 17 |
|
|
addInstr("FADD_S", "0000000??????????????????1010011", NULL, out);
|
| 18 |
|
|
addInstr("FSUB_S", "0000100??????????????????1010011", NULL, out);
|
| 19 |
|
|
addInstr("FMUL_S", "0001000??????????????????1010011", NULL, out);
|
| 20 |
|
|
addInstr("FDIV_S", "0001100??????????????????1010011", NULL, out);
|
| 21 |
|
|
addInstr("FSGNJ_S", "0010000??????????000?????1010011", NULL, out);
|
| 22 |
|
|
addInstr("FSGNJN_S", "0010000??????????001?????1010011", NULL, out);
|
| 23 |
|
|
addInstr("FSGNJX_S", "0010000??????????010?????1010011", NULL, out);
|
| 24 |
|
|
addInstr("FMIN_S", "0010100??????????000?????1010011", NULL, out);
|
| 25 |
|
|
addInstr("FMAX_S", "0010100??????????001?????1010011", NULL, out);
|
| 26 |
|
|
addInstr("FSQRT_S", "010110000000?????????????1010011", NULL, out);
|
| 27 |
|
|
addInstr("FADD_D", "0000001??????????????????1010011", NULL, out);
|
| 28 |
|
|
addInstr("FSUB_D", "0000101??????????????????1010011", NULL, out);
|
| 29 |
|
|
addInstr("FMUL_D", "0001001??????????????????1010011", NULL, out);
|
| 30 |
|
|
addInstr("FDIV_D", "0001101??????????????????1010011", NULL, out);
|
| 31 |
|
|
addInstr("FSGNJ_D", "0010001??????????000?????1010011", NULL, out);
|
| 32 |
|
|
addInstr("FSGNJN_D", "0010001??????????001?????1010011", NULL, out);
|
| 33 |
|
|
addInstr("FSGNJX_D", "0010001??????????010?????1010011", NULL, out);
|
| 34 |
|
|
addInstr("FMIN_D", "0010101??????????000?????1010011", NULL, out);
|
| 35 |
|
|
addInstr("FMAX_D", "0010101??????????001?????1010011", NULL, out);
|
| 36 |
|
|
addInstr("FCVT_S_D", "010000000001?????????????1010011", NULL, out);
|
| 37 |
|
|
addInstr("FCVT_D_S", "010000100000?????????????1010011", NULL, out);
|
| 38 |
|
|
addInstr("FSQRT_D", "010110100000?????????????1010011", NULL, out);
|
| 39 |
|
|
addInstr("FLE_S", "1010000??????????000?????1010011", NULL, out);
|
| 40 |
|
|
addInstr("FLT_S", "1010000??????????001?????1010011", NULL, out);
|
| 41 |
|
|
addInstr("FEQ_S", "1010000??????????010?????1010011", NULL, out);
|
| 42 |
|
|
addInstr("FLE_D", "1010001??????????000?????1010011", NULL, out);
|
| 43 |
|
|
addInstr("FLT_D", "1010001??????????001?????1010011", NULL, out);
|
| 44 |
|
|
addInstr("FEQ_D", "1010001??????????010?????1010011", NULL, out);
|
| 45 |
|
|
addInstr("FCVT_W_S", "110000000000?????????????1010011", NULL, out);
|
| 46 |
|
|
addInstr("FCVT_WU_S", "110000000001?????????????1010011", NULL, out);
|
| 47 |
|
|
addInstr("FCVT_L_S", "110000000010?????????????1010011", NULL, out);
|
| 48 |
|
|
addInstr("FCVT_LU_S", "110000000011?????????????1010011", NULL, out);
|
| 49 |
|
|
addInstr("FMV_X_S", "111000000000?????000?????1010011", NULL, out);
|
| 50 |
|
|
addInstr("FCLASS_S", "111000000000?????001?????1010011", NULL, out);
|
| 51 |
|
|
addInstr("FCVT_W_D", "110000100000?????????????1010011", NULL, out);
|
| 52 |
|
|
addInstr("FCVT_WU_D", "110000100001?????????????1010011", NULL, out);
|
| 53 |
|
|
addInstr("FCVT_L_D", "110000100010?????????????1010011", NULL, out);
|
| 54 |
|
|
addInstr("FCVT_LU_D", "110000100011?????????????1010011", NULL, out);
|
| 55 |
|
|
addInstr("FMV_X_D", "111000100000?????000?????1010011", NULL, out);
|
| 56 |
|
|
addInstr("FCLASS_D", "111000100000?????001?????1010011", NULL, out);
|
| 57 |
|
|
addInstr("FCVT_S_W", "110100000000?????????????1010011", NULL, out);
|
| 58 |
|
|
addInstr("FCVT_S_WU", "110100000001?????????????1010011", NULL, out);
|
| 59 |
|
|
addInstr("FCVT_S_L", "110100000010?????????????1010011", NULL, out);
|
| 60 |
|
|
addInstr("FCVT_S_LU", "110100000011?????????????1010011", NULL, out);
|
| 61 |
|
|
addInstr("FMV_S_X", "111100000000?????000?????1010011", NULL, out);
|
| 62 |
|
|
addInstr("FCVT_D_W", "110100100000?????????????1010011", NULL, out);
|
| 63 |
|
|
addInstr("FCVT_D_WU", "110100100001?????????????1010011", NULL, out);
|
| 64 |
|
|
addInstr("FCVT_D_L", "110100100010?????????????1010011", NULL, out);
|
| 65 |
|
|
addInstr("FCVT_D_LU", "110100100011?????????????1010011", NULL, out);
|
| 66 |
|
|
addInstr("FMV_D_X", "111100100000?????000?????1010011", NULL, out);
|
| 67 |
|
|
addInstr("FLW", "?????????????????010?????0000111", NULL, out);
|
| 68 |
|
|
addInstr("FLD", "?????????????????011?????0000111", NULL, out);
|
| 69 |
|
|
addInstr("FSW", "?????????????????010?????0100111", NULL, out);
|
| 70 |
|
|
addInstr("FSD", "?????????????????011?????0100111", NULL, out);
|
| 71 |
|
|
addInstr("FMADD_S", "?????00??????????????????1000011", NULL, out);
|
| 72 |
|
|
addInstr("FMSUB_S", "?????00??????????????????1000111", NULL, out);
|
| 73 |
|
|
addInstr("FNMSUB_S", "?????00??????????????????1001011", NULL, out);
|
| 74 |
|
|
addInstr("FNMADD_S", "?????00??????????????????1001111", NULL, out);
|
| 75 |
|
|
addInstr("FMADD_D", "?????01??????????????????1000011", NULL, out);
|
| 76 |
|
|
addInstr("FMSUB_D", "?????01??????????????????1000111", NULL, out);
|
| 77 |
|
|
addInstr("FNMSUB_D", "?????01??????????????????1001011", NULL, out);
|
| 78 |
|
|
addInstr("FNMADD_D", "?????01??????????????????1001111", NULL, out);
|
| 79 |
|
|
def FRFLAGS = BitPat("b00000000000100000010?????1110011")
|
| 80 |
|
|
def FSFLAGS = BitPat("b000000000001?????001?????1110011")
|
| 81 |
|
|
def FSFLAGSI = BitPat("b000000000001?????101?????1110011")
|
| 82 |
|
|
def FRRM = BitPat("b00000000001000000010?????1110011")
|
| 83 |
|
|
def FSRM = BitPat("b000000000010?????001?????1110011")
|
| 84 |
|
|
def FSRMI = BitPat("b000000000010?????101?????1110011")
|
| 85 |
|
|
def FSCSR = BitPat("b000000000011?????001?????1110011")
|
| 86 |
|
|
def FRCSR = BitPat("b00000000001100000010?????1110011")
|
| 87 |
|
|
*/
|
| 88 |
|
|
uint64_t isa = portCSR_.read(CSR_misa).val;
|
| 89 |
|
|
isa |= (1LL << ('F' - 'A'));
|
| 90 |
|
|
portCSR_.write(CSR_misa, isa);
|
| 91 |
|
|
}
|
| 92 |
|
|
|
| 93 |
|
|
} // namespace debugger
|