From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <4FA5E8D2.7090102@gmail.com> References: <1411330.QJAbfBr5F9@blitz> <4FA5E8D2.7090102@gmail.com> Date: Sun, 6 May 2012 04:46:29 -0400 Message-ID: From: Comeau At9Fans To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=f46d0447979b9766d604bf5a3091 Subject: Re: [9fans] integer width on AMD64 Topicbox-Message-UUID: 84527664-ead7-11e9-9d60-3106f5b1d025 --f46d0447979b9766d604bf5a3091 Content-Type: text/plain; charset=ISO-8859-1 On Sat, May 5, 2012 at 10:58 PM, Joel C. Salomon wrote: > On 05/05/2012 05:06 PM, Comeau At9Fans wrote: > > On Sat, May 5, 2012 at 1:48 PM, Charles Forsyth wrote: > > > > if it's performance you're worried about, for programs that don't > > care about width, i'd expect 32 bits at least > > to match performance with 64 bits (if there's a measurable > > difference). for one thing, cache lines will contain > > more values, and several will be fetched at once when cache lines > > are filled. > > > > And for programs that do care about this, C99 provides things such as > > int_fast64_t (which IIRC 8c et al does not currently support). > > is just a bunch of typedef's, some of which have been > included, under different names (u{8,16,32,64}int), in . Wouldn't > be hard to provide for APE if anyone wants it. Yes, the u{...}int names are important. Those "different names" are normally for other (though obviously related) purposes (conceptually int_exact_*), and the int_least_* and int_fast_* names, usually are built from the exact ones. BTW, more generally re the greater issue raised earlier by an OP, if ones intent is X bits, then int is not expressing that intent, and even if your assumption happens to be correct, it might also create a portability faux pas if that is a concern. Also, if int was X bits underneath, then arrays of int, now in the case of X == 64 effectively become arrays of long stuff since not only is there now maybe wasted memory, but cache management and such can be a concern. This all has architecture dependencies though. -- Greg Comeau / 4.3.10.1 with C++0xisms now in beta! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it? --f46d0447979b9766d604bf5a3091 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, May 5, 2012 at 10:58 PM, Joel C. Salomon <joelcsalomon@gmail.= com> wrote:
On 05/05/2012 05:06 PM, Comeau At9Fans wrote:
> On Sat, May 5, 2012 at 1:48 PM, Charles Forsyth wrote:
>
> =A0 =A0 if it's performance you're worried about, for programs= that don't
> =A0 =A0 care about width, i'd expect 32 bits at least
> =A0 =A0 to match performance with 64 bits (if there's a measurable=
> =A0 =A0 difference). for one thing, cache lines will contain
> =A0 =A0 more values, and several will be fetched at once when cache li= nes
> =A0 =A0 are filled.
>
> And for programs that do care about this, C99 provides things such as<= br> > int_fast64_t (which IIRC 8c et al does not currently support).

<stdint.h> is just a bunch of typedef's, some of which have been<= br> included, under different names (u{8,16,32,64}int), in <u.h>. =A0Woul= dn't
be hard to provide for APE if anyone wants it.

<= div>Yes, the u{...}int names are important. =A0Those "different names&= quot; are normally for other (though obviously related) purposes (conceptua= lly int_exact_*), and the int_least_* and int_fast_* names, usually are bui= lt from the exact ones. =A0BTW, more generally re the greater issue raised = earlier by an OP, if=A0ones intent is X bits, then int is not expressi= ng that intent, and even if your assumption happens to be correct, it might= also create a portability faux pas if that is a concern. =A0Al= so, if int was X bits underneath, then arrays of int, now in the case of X = =3D=3D 64 effectively become arrays of long stuff since not only is there n= ow maybe wasted memory, but cache management and such can be a concern. =A0= This all has architecture dependencies though.

--
Greg Comeau / 4.3.10.1 with C++0xisms now = in beta!
Comeau C/C++ ONLINE =3D=3D> =A0 =A0 http://www.comeaucompu= ting.com/tryitout
World Class Compilers: =A0Breathtaking C++, Amazing C99, Fabulous C90.=
Comeau C/C++ with Dinkumware's Libraries... Have you tried i= t?

--f46d0447979b9766d604bf5a3091--