mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
include/exec/memop: Move get_alignment_bits from tcg.h
This function is specific to MemOp, not TCG in general. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
49d1866a6e
commit
da335fe12a
2 changed files with 23 additions and 23 deletions
|
@ -170,4 +170,27 @@ static inline bool memop_big_endian(MemOp op)
|
||||||
return (op & MO_BSWAP) == MO_BE;
|
return (op & MO_BSWAP) == MO_BE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_alignment_bits
|
||||||
|
* @memop: MemOp value
|
||||||
|
*
|
||||||
|
* Extract the alignment size from the memop.
|
||||||
|
*/
|
||||||
|
static inline unsigned get_alignment_bits(MemOp memop)
|
||||||
|
{
|
||||||
|
unsigned a = memop & MO_AMASK;
|
||||||
|
|
||||||
|
if (a == MO_UNALN) {
|
||||||
|
/* No alignment required. */
|
||||||
|
a = 0;
|
||||||
|
} else if (a == MO_ALIGN) {
|
||||||
|
/* A natural alignment requirement. */
|
||||||
|
a = memop & MO_SIZE;
|
||||||
|
} else {
|
||||||
|
/* A specific alignment requirement. */
|
||||||
|
a = a >> MO_ASHIFT;
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -281,29 +281,6 @@ static inline int tcg_type_size(TCGType t)
|
||||||
return 4 << i;
|
return 4 << i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* get_alignment_bits
|
|
||||||
* @memop: MemOp value
|
|
||||||
*
|
|
||||||
* Extract the alignment size from the memop.
|
|
||||||
*/
|
|
||||||
static inline unsigned get_alignment_bits(MemOp memop)
|
|
||||||
{
|
|
||||||
unsigned a = memop & MO_AMASK;
|
|
||||||
|
|
||||||
if (a == MO_UNALN) {
|
|
||||||
/* No alignment required. */
|
|
||||||
a = 0;
|
|
||||||
} else if (a == MO_ALIGN) {
|
|
||||||
/* A natural alignment requirement. */
|
|
||||||
a = memop & MO_SIZE;
|
|
||||||
} else {
|
|
||||||
/* A specific alignment requirement. */
|
|
||||||
a = a >> MO_ASHIFT;
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef tcg_target_ulong TCGArg;
|
typedef tcg_target_ulong TCGArg;
|
||||||
|
|
||||||
/* Define type and accessor macros for TCG variables.
|
/* Define type and accessor macros for TCG variables.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue