On Sat, Sep 03, 2016 at 09:39:41PM +0100, Richard Henderson wrote: > --- a/tcg/tcg.h > +++ b/tcg/tcg.h > @@ -1175,6 +1175,59 @@ uint64_t helper_be_ldq_cmmu(CPUArchState *env, > target_ulong addr, > # define helper_ret_ldq_cmmu helper_le_ldq_cmmu > #endif > > +uint32_t helper_atomic_cmpxchgb_mmu(CPUArchState *env, target_ulong addr, > + uint32_t cmpv, uint32_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr); > +uint32_t helper_atomic_cmpxchgw_le_mmu(CPUArchState *env, target_ulong addr, > + uint32_t cmpv, uint32_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr); > +uint32_t helper_atomic_cmpxchgl_le_mmu(CPUArchState *env, target_ulong addr, > + uint32_t cmpv, uint32_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr); > +uint64_t helper_atomic_cmpxchgq_le_mmu(CPUArchState *env, target_ulong addr, > + uint64_t cmpv, uint64_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr); > +uint32_t helper_atomic_cmpxchgw_be_mmu(CPUArchState *env, target_ulong addr, > + uint32_t cmpv, uint32_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr); > +uint32_t helper_atomic_cmpxchgl_be_mmu(CPUArchState *env, target_ulong addr, > + uint32_t cmpv, uint32_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr); > +uint64_t helper_atomic_cmpxchgq_be_mmu(CPUArchState *env, target_ulong addr, > + uint64_t cmpv, uint64_t newv, > + TCGMemOpIdx oi, uintptr_t retaddr);
Wouldn't it be useful if tcg.h provided also aliases for _le/_be atomic helpers (equivalent to helper_ret_X_mmu) so that in target-* code we wouldn't need to care about the endianness (specifically I'm thinking about SC in MIPS where I need to select between helper_atomic_cmpxchgl_le_mmu() and helper_atomic_cmpxchgl_be_mmu()). Thanks, Leon