Line 45... |
Line 45... |
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* Unavailable extensions warning.
|
* Unavailable extensions warning.
|
**************************************************************************/
|
**************************************************************************/
|
#if defined __riscv_f || (__riscv_flen == 32)
|
#if defined __riscv_f || (__riscv_flen == 32)
|
#warning Single-precision floating-point extension <F/Zfinx> is WORK-IN-PROGRESS and NOT FULLY OPERATIONAL yet!
|
#warning Single-precision floating-point extension <F/Zfinx> is WORK-IN-PROGRESS and there is NO NATIVE SUPPORT BY THE COMPILER yet!
|
#endif
|
#endif
|
|
|
#if defined __riscv_d || (__riscv_flen == 64)
|
#if defined __riscv_d || (__riscv_flen == 64)
|
#error Double-precision floating-point extension <D/Zdinx> is NOT supported!
|
#error Double-precision floating-point extension <D/Zdinx> is NOT supported!
|
#endif
|
#endif
|
Line 712... |
Line 712... |
|
|
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* Check if certain Z* extension is available
|
* Check if certain Z* extension is available
|
*
|
*
|
* @param[in] flag Index of the Z-extension to check from #NEORV32_CSR_MZEXT_enum
|
* @param[in] flag_id Index of the Z-extension to check from #NEORV32_CSR_MZEXT_enum
|
* @return 0 if extension is NOT available, != 0 if extension is available.
|
* @return 0 if extension is NOT available, != 0 if extension is available.
|
**************************************************************************/
|
**************************************************************************/
|
int neorv32_check_zextension(uint32_t flag) {
|
int neorv32_cpu_check_zext(uint8_t flag_id) {
|
|
|
// check if out of range
|
// check if out of range
|
if (flag > 31) {
|
if (flag_id > 31) {
|
return 0;
|
return 0;
|
}
|
}
|
|
|
uint32_t tmp = neorv32_cpu_csr_read(CSR_MZEXT);
|
uint32_t mask = (uint32_t)(1 << flag_id);
|
if ((tmp & (1 << flag)) == 0) {
|
if ((neorv32_cpu_csr_read(CSR_MZEXT) & mask) == 0) {
|
return 0;
|
return 0;
|
}
|
}
|
else {
|
else {
|
return 1;
|
return 1;
|
}
|
}
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
|
|
No newline at end of file
|
No newline at end of file
|