This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v3] Use long for mantissa for generic mp code
- From: Richard Henderson <rth at twiddle dot net>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 22 Mar 2013 07:13:31 -0700
- Subject: Re: [PATCH v3] Use long for mantissa for generic mp code
- References: <512D7D56 dot 2030209 at twiddle dot net> <20130308123807 dot GA21984 at spoyarek dot pnq dot redhat dot com> <5140AD70 dot 7090808 at twiddle dot net> <20130314082826 dot GT22471 at spoyarek dot pnq dot redhat dot com> <51432D0E dot 60407 at twiddle dot net> <CAAHN_R13LUMFd+YYrqj8_FRVdbsHG65ettLfQV81Uy_06ASmOQ at mail dot gmail dot com> <CAAHN_R15C_K4vabAWH863xNdZ6dRxH_rxnV+mFxWADkxmmgFRQ at mail dot gmail dot com> <514339B4 dot 1060307 at twiddle dot net> <51434720 dot 2070601 at twiddle dot net> <51434EAF dot 4090706 at twiddle dot net> <20130322092654 dot GH2409 at spoyarek dot pnq dot redhat dot com>
On 2013-03-22 02:26, Siddhesh Poyarekar wrote:
+typedef long mantissa_t;
+typedef int64_t mantissa_store_t;
It seems like it would make sense to have mantissa_t be int32_t explicitly,
rather than let it be 64-bit on x86_64.
That'll save data space, in the mp_no structure -- we know that half the data
must be zeros at the moment.
More importantly, it'll make the consequences of omitting a cast to
mantissa_store_t be the same for the most popular testing platform as for the
(If we could prove the no negatives property and use uint32_t, it would save
code size on x86_64 too. Some rex prefixes would be avoided; the implicit
zero-extension of all 32-bit operations would come into play, avoiding the
extra sign-extension insns that we will get with my int32_t suggestion.)
Otherwise I think the patch looks ok.