{
cpu_synchronize_state(cs);
- return !FIELD_EX64(cpu_env(cs)->msr, MSR, LE);
+ return !ppc_env_is_little_endian(cpu_env(cs));
}
static bool ppc_get_irq_stats(InterruptStatsProvider *obj,
{
CPUPPCState *env = cpu_env(cs);
- if ((env->msr >> MSR_LE) & 1) {
- info->endian = BFD_ENDIAN_LITTLE;
- } else {
- info->endian = BFD_ENDIAN_BIG;
- }
+ info->endian = ppc_env_is_little_endian(env) ? BFD_ENDIAN_LITTLE
+ : BFD_ENDIAN_BIG;
info->mach = env->bfd_mach;
if (!env->bfd_mach) {
#ifdef TARGET_PPC64
void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len)
{
#ifndef CONFIG_USER_ONLY
- if (!FIELD_EX64(env->msr, MSR, LE)) {
+ if (!ppc_env_is_little_endian(env)) {
/* do nothing */
} else if (len == 4) {
bswap32s((uint32_t *)mem_buf);
int adjust = HI_IDX * (n_elems - 1); \
int sh = sizeof(r->element[0]) >> 1; \
int index = (addr & 0xf) >> sh; \
- bool byteswap = FIELD_EX64(env->msr, MSR, LE); \
+ bool byteswap = ppc_env_is_little_endian(env); \
\
if (byteswap) { \
index = n_elems - index - 1; \
int adjust = HI_IDX * (n_elems - 1); \
int sh = sizeof(r->element[0]) >> 1; \
int index = (addr & 0xf) >> sh; \
- bool byteswap = FIELD_EX64(env->msr, MSR, LE); \
+ bool byteswap = ppc_env_is_little_endian(env); \
\
if (byteswap) { \
index = n_elems - index - 1; \
t.s128 = int128_zero(); \
if (nb) { \
nb = (nb >= 16) ? 16 : nb; \
- if (FIELD_EX64(env->msr, MSR, LE) && !lj) { \
+ if (ppc_env_is_little_endian(env) && !lj) { \
for (i = 16; i > 16 - nb; i--) { \
t.VsrB(i - 1) = cpu_ldub_data_ra(env, addr, GETPC()); \
addr = addr_add(env, addr, 1); \
} \
\
nb = (nb >= 16) ? 16 : nb; \
- if (FIELD_EX64(env->msr, MSR, LE) && !lj) { \
+ if (ppc_env_is_little_endian(env) && !lj) { \
for (i = 16; i > 16 - nb; i--) { \
cpu_stb_data_ra(env, addr, xt->VsrB(i - 1), GETPC()); \
addr = addr_add(env, addr, 1); \