Il 02/06/2013 16:50, Peter Maydell ha scritto: > On 2 June 2013 15:36, Paolo Bonzini <pbonz...@redhat.com> wrote: >> This should work: >> >> int64_t h; >> if (!n) { >> return a; >> } >> h = a.hi >> n; > > This is undefined for n >= 64.
Yes, it has to be a.hi >> (n & 63). > I would suggest looking at fpu/softfloat-macros.h:shift128Right() > except that that has at least one clearly dubious thing in it > (a check for "count < 64" in an else case that can't be reached > if count < 64)... It's a bit different in that I want an arithmetic right shift. Paolo