From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Wed, 25 Apr 2012 15:32:06 -0400 To: 9fans@9fans.net Message-ID: In-Reply-To: References: <4f1198ef9ee73aa22ab59844e561e59c@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] AMD64 system Topicbox-Message-UUID: 7e2cfd0e-ead7-11e9-9d60-3106f5b1d025 On Wed Apr 25 15:17:15 EDT 2012, strake888@gmail.com wrote: > On 25/04/2012, erik quanstrom wrote: > > i think you mean the maximum value of an integer > > rather than a count. assuming this, vlongs are > > still 64 bits with 8c and the 32-bit architecture. > > > > what's wrong with them? > > Twice as many instructions, if I'm not mistaken, and a waste of good > 64-bit registers. it's not like the registers are real on a modern x86 machine in any mode after renaming, etc. and this is also offset somewhat by the fact that pointers are now twice as big. so best case for 64-bit, is that you are adding 64-bit numbers in a tight loop with almost no memory access. i get only a 2-3x speedup for this case 32-bit machine (not idle): minooka; time 8.addv 3.08u 0.00s 3.11r 8.addv # status= main minooka; aux/cpuid -i Intel(R) Xeon(R) CPU E5540 @ 2.53GHz 64-bit machine (idle, but slower) bonanza; time 6.addv 1.55u 0.00s 1.58r 6.addv # status= main bonanza; aux/cpuid -i Intel(R) Xeon(R) CPU E5504 @ 2.00GHz by amdahl's law, you're going to have to be doing a hell of a lot of vlong arithmetic to make this pay. also, in case you missed it sizeof(int)==sizeof(long)==4 on both 32 and 64 bit plan 9, so recompiled programs won't get bigger integers just for the recompiling. - erik ----- bonanza; cat addv.c #include #include void main(void) { int i; vlong acc; acc = 0; for(i = 0; i < 1000000000; i++) acc += i; }