Skip to content

Commit

Permalink
opcodes.h: Do not use casts in MIN_* and MAX_* macros
Browse files Browse the repository at this point in the history
This is to make it consistent with stdint.h.

Change-Id: Ibba824dad431b3a1675700ad4cc15f3e39a187f7
Signed-off-by: Jan Matyas <[email protected]>
  • Loading branch information
JanMatCodasip committed Feb 14, 2025
1 parent 85d9d06 commit 2c59e21
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/target/riscv/opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
#define MAX_VREG_NUM 31
#define MAX_CSR_NUM 4095

#define MIN_INT12 ((int16_t)(-0x800))
#define MAX_INT12 ((int16_t)0x7ff)
#define MIN_INT12 (-0x800)
#define MAX_INT12 0x7ff

#define MIN_INT13 ((int16_t)(-0x1000))
#define MAX_INT13 ((int16_t)0xfff)
#define MIN_INT13 (-0x1000)
#define MAX_INT13 0xfff

#define MIN_INT21 ((int16_t)(-0x100000))
#define MAX_INT21 ((int16_t)0xfffff)
#define MIN_INT21 (-0x100000)
#define MAX_INT21 0xfffff

#define MAX_UINT5 ((uint8_t)0x1f)
#define MAX_UINT11 ((uint16_t)0x7ff)
#define MAX_UINT12 ((uint16_t)0xfff)
#define MAX_UINT5 0x1f
#define MAX_UINT11 0x7ff
#define MAX_UINT12 0xfff

static uint32_t bits(uint32_t value, unsigned int hi, unsigned int lo)
{
Expand Down

0 comments on commit 2c59e21

Please sign in to comment.