From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvlRZ-0003PO-1A for qemu-devel@nongnu.org; Mon, 09 Nov 2015 07:21:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvlRV-00040d-3Q for qemu-devel@nongnu.org; Mon, 09 Nov 2015 07:21:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvlRU-00040T-UC for qemu-devel@nongnu.org; Mon, 09 Nov 2015 07:21:01 -0500 References: <1446740339-31366-1-git-send-email-pmorel@linux.vnet.ibm.com> <563B8498.7070804@redhat.com> <563C6695.7030507@linux.vnet.ibm.com> <563CD658.9060507@redhat.com> <56408B28.8070408@linux.vnet.ibm.com> From: Paolo Bonzini Message-ID: <56408FA8.60602@redhat.com> Date: Mon, 9 Nov 2015 13:20:56 +0100 MIME-Version: 1.0 In-Reply-To: <56408B28.8070408@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/7] int128: reparing broken 128 bit memory calculations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pierre Morel , qemu-devel On 09/11/2015 13:01, Pierre Morel wrote: >>> This leads to have UINT64_MAX represented with {1, 0} instead of >>> {0, UINT64_MAX} while {1, 0} is 2^64. This again leads to have >>> unnecessary and obfuscating transformations with int128_2_64() to >>> test for UINT64_MAX and return {1,0} in memory_region_init() >>> while using inverse translation test{1,0} and return UINT64_MAX >>> in memory_region_size()>> >> >> Yes, the use of UINT64_MAX for 2^64 is a hack, but it is unrelated to >> the signedness of Int128. > > OK, we agree it is a hack, > but sorry, I should have missed something, > because I do not understand what this hack is useful for. It's used in the size argument of memory_region_init*, so that it can remain an uint64_t. The size is usually small (up to 2^40, say) unless it is 2^64 meaning "the whole address space". The latter case is covered by UINT64_MAX. Paolo