Browse Source

Merge pull request #1367 from glg-rv/move_isaligned/0/topic

decode_macros: move 'is_aligned' from 'v_ext_macros.h'
pull/1373/head
Andrew Waterman 3 years ago
committed by GitHub
parent
commit
c7cc62952d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      riscv/decode_macros.h
  2. 5
      riscv/v_ext_macros.h

4
riscv/decode_macros.h

@ -120,6 +120,10 @@ do { \
if (rm > 4) throw trap_illegal_instruction(insn.bits()); \ if (rm > 4) throw trap_illegal_instruction(insn.bits()); \
rm; }) rm; })
static inline bool is_aligned(const unsigned val, const unsigned pos)
{
return pos ? (val & (pos - 1)) == 0 : true;
}
#define require_privilege(p) require(STATE.prv >= (p)) #define require_privilege(p) require(STATE.prv >= (p))
#define require_novirt() (unlikely(STATE.v) ? throw trap_virtual_instruction(insn.bits()) : (void) 0) #define require_novirt() (unlikely(STATE.v) ? throw trap_virtual_instruction(insn.bits()) : (void) 0)

5
riscv/v_ext_macros.h

@ -64,11 +64,6 @@ static inline bool is_overlapped_widen(const int astart, int asize,
} }
} }
static inline bool is_aligned(const unsigned val, const unsigned pos)
{
return pos ? (val & (pos - 1)) == 0 : true;
}
#define VI_NARROW_CHECK_COMMON \ #define VI_NARROW_CHECK_COMMON \
require_vector(true); \ require_vector(true); \
require(P.VU.vflmul <= 4); \ require(P.VU.vflmul <= 4); \

Loading…
Cancel
Save