Browse Source

refactor: set_fp_exceptions: Use a new macro raise_fp_exceptions(flags) and refine coding style for clearity

pull/1740/head
YenHaoChen 2 years ago
parent
commit
1342c687f2
  1. 10
      riscv/decode_macros.h

10
riscv/decode_macros.h

@ -211,10 +211,12 @@ static inline bool is_aligned(const unsigned val, const unsigned pos)
} \
} while (0);
#define set_fp_exceptions ({ if (softfloat_exceptionFlags) { \
STATE.fflags->write(STATE.fflags->read() | softfloat_exceptionFlags); \
} \
softfloat_exceptionFlags = 0; })
#define raise_fp_exceptions(flags) do { if (flags) STATE.fflags->write(STATE.fflags->read() | (flags)); } while (0);
#define set_fp_exceptions \
do { \
raise_fp_exceptions(softfloat_exceptionFlags); \
softfloat_exceptionFlags = 0; \
} while (0);
#define sext32(x) ((sreg_t)(int32_t)(x))
#define zext32(x) ((reg_t)(uint32_t)(x))

Loading…
Cancel
Save