From 4d3847f0ff293cbf82049bf4bd87bbc431b74347 Mon Sep 17 00:00:00 2001 From: Gianluca Guida Date: Thu, 25 May 2023 14:27:00 +0100 Subject: [PATCH] decode_macros: move 'is_aligned' from 'v_ext_macros.h' --- riscv/decode_macros.h | 4 ++++ riscv/v_ext_macros.h | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/riscv/decode_macros.h b/riscv/decode_macros.h index fee8ae7f..43912359 100644 --- a/riscv/decode_macros.h +++ b/riscv/decode_macros.h @@ -120,6 +120,10 @@ do { \ if (rm > 4) throw trap_illegal_instruction(insn.bits()); \ 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_novirt() (unlikely(STATE.v) ? throw trap_virtual_instruction(insn.bits()) : (void) 0) diff --git a/riscv/v_ext_macros.h b/riscv/v_ext_macros.h index e00b0c0a..8b0d0fde 100644 --- a/riscv/v_ext_macros.h +++ b/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 \ require_vector(true); \ require(P.VU.vflmul <= 4); \