/* Define if floating-point instructions are supported */
#undef RISCV_ENABLE_FPU
+/* Define if instruction compression is supported */
+#undef RISCV_ENABLE_RVC
+
/* Define if libopcodes exists */
#undef RISCV_HAVE_LIBOPCODES
enable_optional_subprojects
enable_fpu
enable_64bit
+enable_rvc
'
ac_precious_vars='build_alias
host_alias
Enable all optional subprojects
--disable-fpu Disable floating-point
--disable-64bit Disable 64-bit mode
+ --disable-rvc Disable instruction compression
Some influential environment variables:
CC C compiler command
$as_echo "#define RISCV_ENABLE_64BIT /**/" >>confdefs.h
+fi
+
+# Check whether --enable-rvc was given.
+if test "${enable_rvc+set}" = set; then :
+ enableval=$enable_rvc;
+fi
+
+if test "x$enable_rvc" != "xno"; then :
+
+
+$as_echo "#define RISCV_ENABLE_RVC /**/" >>confdefs.h
+
+
fi
libopc=`dirname \`which riscv-gcc\``/../`$ac_config_guess`/riscv/lib/libopcodes.a
#define SR_ET 0x0000000000000001ULL
#define SR_EF 0x0000000000000002ULL
-#define SR_PS 0x0000000000000004ULL
-#define SR_S 0x0000000000000008ULL
-#define SR_UX 0x0000000000000010ULL
-#define SR_SX 0x0000000000000020ULL
-#define SR_UC 0x0000000000000040ULL
-#define SR_SC 0x0000000000000080ULL
+#define SR_EV 0x0000000000000004ULL
+#define SR_EC 0x0000000000000008ULL
+#define SR_PS 0x0000000000000010ULL
+#define SR_S 0x0000000000000020ULL
+#define SR_UX 0x0000000000000040ULL
+#define SR_SX 0x0000000000000080ULL
#define SR_IM 0x000000000000FF00ULL
-#define SR_ZERO ~(SR_ET|SR_EF|SR_PS|SR_S|SR_UX|SR_SX|SR_UC|SR_SC|SR_IM)
+#define SR_ZERO ~(SR_ET|SR_EF|SR_EV|SR_EC|SR_PS|SR_S|SR_UX|SR_SX|SR_IM)
#define SR_IM_SHIFT 8
#define TIMER_IRQ 7
#define require_xpr64 if(!xpr64) throw trap_illegal_instruction
#define require_xpr32 if(xpr64) throw trap_illegal_instruction
#define require_fp if(!(sr & SR_EF)) throw trap_fp_disabled
+#define require_vector if(!(sr & SR_EV)) throw trap_vector_disabled
#define cmp_trunc(reg) (reg_t(reg) << (64-xprlen))
#define set_fp_exceptions ({ set_fsr(fsr | \
(softfloat_exceptionFlags << FSR_AEXC_SHIFT)); \
softfloat_exceptionFlags = 0; })
-#define rvc_mode ((sr & SR_S) ? (sr & SR_SC) : (sr & SR_UC))
-#define require_rvc if(!rvc_mode) throw trap_illegal_instruction
+#define require_rvc if(!(sr & SR_EC)) throw trap_illegal_instruction
#define sext32(x) ((sreg_t)(int32_t)(x))
#define insn_length(x) (((x).bits & 0x3) < 0x3 ? 2 : 4)
#ifndef RISCV_ENABLE_FPU
sr &= ~SR_EF;
#endif
-#ifdef RISCV_ENABLE_RVC
- sr &= ~SR_C;
+#ifndef RISCV_ENABLE_RVC
+ sr &= ~SR_EC;
#endif
xprlen = ((sr & SR_S) ? (sr & SR_SX) : (sr & SR_UX)) ? 64 : 32;
if(interrupts && (sr & SR_ET))
take_trap(trap_interrupt,noisy);
- insn_t insn = mmu.load_insn(pc, rvc_mode);
+ insn_t insn = mmu.load_insn(pc, sr & SR_EC);
reg_t npc = pc + insn_length(insn);
AC_DEFINE([RISCV_ENABLE_64BIT],,[Define if 64-bit mode is supported])
])
+AC_ARG_ENABLE([rvc], AS_HELP_STRING([--disable-rvc], [Disable instruction compression]))
+AS_IF([test "x$enable_rvc" != "xno"], [
+ AC_DEFINE([RISCV_ENABLE_RVC],,[Define if instruction compression is supported])
+])
+
libopc=`dirname \`which riscv-gcc\``/../`$ac_config_guess`/riscv/lib/libopcodes.a
AC_CHECK_FILES([$libopc],[have_libopcodes="yes"],[have_libopcodes="no"])
DECLARE_TRAP(data_address_misaligned), \
DECLARE_TRAP(load_access_fault), \
DECLARE_TRAP(store_access_fault), \
- DECLARE_TRAP(reserved1), \
+ DECLARE_TRAP(trap_vector_disabled), \
DECLARE_TRAP(reserved2), \
DECLARE_TRAP(reserved3), \
DECLARE_TRAP(reserved4), \