Richard Henderson <richard.hender...@linaro.org> writes:
> We will shortly be using these more than once. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> <snip> > } > > /* > @@ -1415,7 +1412,8 @@ load_helper(CPUArchState *env, target_ulong addr, > TCGMemOpIdx oi, > static uint64_t full_ldub_mmu(CPUArchState *env, target_ulong addr, > TCGMemOpIdx oi, uintptr_t retaddr) > { > - return load_helper(env, addr, oi, retaddr, MO_UB, false, full_ldub_mmu); > + return load_helper(env, addr, oi, retaddr, MO_UB, false, > + full_ldub_mmu); This is an unrelated change, otherwise: Reviewed-by: Alex Bennée <alex.ben...@linaro.org> > } > > tcg_target_ulong helper_ret_ldub_mmu(CPUArchState *env, target_ulong addr, > @@ -1530,6 +1528,36 @@ tcg_target_ulong helper_be_ldsl_mmu(CPUArchState *env, > target_ulong addr, > * Store Helpers > */ > > +static inline void QEMU_ALWAYS_INLINE > +store_memop(void *haddr, uint64_t val, MemOp op) > +{ > + switch (op) { > + case MO_UB: > + stb_p(haddr, val); > + break; > + case MO_BEUW: > + stw_be_p(haddr, val); > + break; > + case MO_LEUW: > + stw_le_p(haddr, val); > + break; > + case MO_BEUL: > + stl_be_p(haddr, val); > + break; > + case MO_LEUL: > + stl_le_p(haddr, val); > + break; > + case MO_BEQ: > + stq_be_p(haddr, val); > + break; > + case MO_LEQ: > + stq_le_p(haddr, val); > + break; > + default: > + optimize_away(); > + } > +} > + > static inline void QEMU_ALWAYS_INLINE > store_helper(CPUArchState *env, target_ulong addr, uint64_t val, > TCGMemOpIdx oi, uintptr_t retaddr, MemOp op) > @@ -1657,31 +1685,7 @@ store_helper(CPUArchState *env, target_ulong addr, > uint64_t val, > > do_aligned_access: > haddr = (void *)((uintptr_t)addr + entry->addend); > - switch (op) { > - case MO_UB: > - stb_p(haddr, val); > - break; > - case MO_BEUW: > - stw_be_p(haddr, val); > - break; > - case MO_LEUW: > - stw_le_p(haddr, val); > - break; > - case MO_BEUL: > - stl_be_p(haddr, val); > - break; > - case MO_LEUL: > - stl_le_p(haddr, val); > - break; > - case MO_BEQ: > - stq_be_p(haddr, val); > - break; > - case MO_LEQ: > - stq_le_p(haddr, val); > - break; > - default: > - optimize_away(); > - } > + store_memop(haddr, val, op); > } > > void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val, -- Alex Bennée