From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biPO2-0004vI-U9 for qemu-devel@nongnu.org; Fri, 09 Sep 2016 13:14:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biPNx-0001Uy-5J for qemu-devel@nongnu.org; Fri, 09 Sep 2016 13:14:45 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:34503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biPNw-0001Ud-Pq for qemu-devel@nongnu.org; Fri, 09 Sep 2016 13:14:41 -0400 Received: by mail-wm0-x229.google.com with SMTP id 199so6973689wma.1 for ; Fri, 09 Sep 2016 10:14:40 -0700 (PDT) References: <1472935202-3342-1-git-send-email-rth@twiddle.net> <1472935202-3342-4-git-send-email-rth@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1472935202-3342-4-git-send-email-rth@twiddle.net> Date: Fri, 09 Sep 2016 18:14:38 +0100 Message-ID: <87r38t3sht.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 03/34] exec: Avoid direct references to Int128 parts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org Richard Henderson writes: > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > exec.c | 4 ++-- > include/qemu/int128.h | 10 ++++++++++ > 2 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/exec.c b/exec.c > index 8ffde75..373313d 100644 > --- a/exec.c > +++ b/exec.c > @@ -320,9 +320,9 @@ static inline bool section_covers_addr(const MemoryRegionSection *section, > /* Memory topology clips a memory region to [0, 2^64); size.hi > 0 means > * the section must cover the entire address space. > */ > - return section->size.hi || > + return int128_gethi(section->size) || > range_covers_byte(section->offset_within_address_space, > - section->size.lo, addr); > + int128_getlo(section->size), addr); > } > > static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr, > diff --git a/include/qemu/int128.h b/include/qemu/int128.h > index c598881..52aaf99 100644 > --- a/include/qemu/int128.h > +++ b/include/qemu/int128.h > @@ -20,6 +20,16 @@ static inline uint64_t int128_get64(Int128 a) > return a.lo; > } > > +static inline uint64_t int128_getlo(Int128 a) > +{ > + return a.lo; > +} > + > +static inline int64_t int128_gethi(Int128 a) > +{ > + return a.hi; > +} > + > static inline Int128 int128_zero(void) > { > return int128_make64(0); -- Alex Bennée