Le 09/11/2016 à 14:46, Richard Henderson a écrit : > --- a/target-m68k/op_helper.c > +++ b/target-m68k/op_helper.c > +uint32_t HELPER(bfexts_mem)(CPUM68KState *env, uint32_t addr, > + int32_t ofs, uint32_t len) > +{ > + uintptr_t ra = GETPC(); > + struct bf_data d = bf_prep(addr, ofs, len); > + uint64_t data = bf_load(env, d.addr, d.blen, ra); > + > + return (int64_t)(data << d.bofs) >> (64 - len);
We must use d.len instead of len, otherwise we shift with 32bit value. - return (int64_t)(data << d.bofs) >> (64 - len); + return (int64_t)(data << d.bofs) >> (64 - d.len); Laurent