pkarashchenko commented on a change in pull request #5695: URL: https://github.com/apache/incubator-nuttx/pull/5695#discussion_r821751061
########## File path: libs/libc/machine/risc-v/common/arch_setjmp.S ########## @@ -18,38 +18,64 @@ # ############################################################################ -#if __riscv_xlen == 64 -# define SZREG 8 +#include <nuttx/config.h> + +#ifdef CONFIG_ARCH_RV64 +# define SZREG 8 # define REG_S sd # define REG_L ld -#elif __riscv_xlen == 32 -# define SZREG 4 +#elif defined(CONFIG_ARCH_RV32) +# define SZREG 4 # define REG_S sw # define REG_L lw -#else -# error __riscv_xlen must equal 32 or 64 +#endif + +#ifdef CONFIG_ARCH_DPFPU +# define SZFREG 8 +# define FREG_S fsd +# define FREG_L fld +#elif defined(CONFIG_ARCH_FPU) +# define SZFREG 4 +# define FREG_S fsw +# define FREG_L flw Review comment: Looking into `arch/risc-v/src/common/riscv_fpu.S` and `arch/risc-v/src/common/riscv_exception_common.S` makes me think that we need ``` #if defined(CONFIG_ARCH_DPFPU) # define SZFREG 8 # define FLOAD fld # define FSTORE fsd #elif defined(CONFIG_ARCH_QPFPU) # define SZFREG 16 # define FLOAD flq # define FSTORE fsq #else # define SZFREG 4 # define FLOAD flw # define FSTORE fsw #endif #ifdef CONFIG_ARCH_RV32 # define SZREG 4 # define REGLOAD lw # define REGSTORE sw #else # define SZREG 8 # define REGLOAD ld # define REGSTORE sd #endif ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org