Xref: csiph.com comp.arch:29332 Newsgroups: comp.arch Path: csiph.com!xmission!news.glorb.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!kithrup.com!mrs From: mrs@kithrup.com (Mike Stump) Subject: Re: Four significant reasons for a 12X word size Message-ID: Date: Mon, 24 Aug 2015 21:32:47 GMT References: <95ba0003-95e2-4b06-837a-96b746634836@googlegroups.com> <55621862-521d-4cdb-afcc-700715510abe@googlegroups.com> <3a1828c7-52b5-412e-ad32-baa0f1778619@googlegroups.com> Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Lines: 45 In article , EricP wrote: >Bruce Hoult wrote: >> On Monday, August 24, 2015 at 3:43:44 AM UTC+3, Quadibloc wrote: >>> On Sunday, August 23, 2015 at 5:23:49 PM UTC-6, thomas....@gmail.com wrote: >>> (quoting somebody) >>>>> a downside though of 12/24/... is that then the bit count would no >>>>> longer be a power of 2. >>>> I do not see any benefit in the byte-size being a power of 2. >>> There's really only one benefit, although very few computer systems make use of >>> it. >>> >>> If the byte and word sizes are a power of two, then one can address *individual >>> bits* in the computer's memory. This was done on the STRETCH, for example.. >>> >>> John Savard >> >> A lot of code does things such as: >> >> if ((arr[i/WORDBITS]) & (1<<(i%WORDBITS))) ... >> >> div and mod with a power of two WORDBITS is just shift and mask. >> >> With normal hardware, doing this by a multiple of 12 is not as fast. >> >> Can special-purpose circuits with transistors to burn make it enough faster than general division to be competitive for most purposes? Note >that it's ok for the result of the mod to have a cache reference worth of extra latency, so that's easy enough with a normal msub. It's the >divide that needs work. >> > >You don't have to store the bit values contiguously. >For 12 bit chars you could have an array of 8 bit bytes at positive >array indexes and 4 bit nibbles, packed 2 per byte, at ones-compliment >negative index. > > > [nibble-(~1)] > [nibble-(~0)] > array_ptr-> [byte-0] > [byte-1] > > >and use special bit extract/insert ops to reassemble and disassemble >the 12 bit char values. The above can't _ever_ work. But, thanks for playing.