[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/21] memory: make section size a 128-bit integ
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 10/21] memory: make section size a 128-bit integer |
Date: |
Sun, 2 Jun 2013 15:50:05 +0100 |
On 2 June 2013 15:36, Paolo Bonzini <address@hidden> wrote:
> This should work:
>
> int64_t h;
> if (!n) {
> return a;
> }
> h = a.hi >> n;
This is undefined for n >= 64.
> if (n >= 64) {
> return (Int128) { h, h >> 63 };
> } else {
> return (Int128) { (a.lo >> n) | (a.hi << (64 - n)), h };
> }
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)...
thanks
-- PMM