Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Anonymous Newsgroups: comp.arch,sci.electronics.design Subject: Re: t cluttered Date: 13 Jan 2016 14:36:03 GMT Lines: 55 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net DzrpXX1Ht1xe1yAMbvSI5QO2I5i2rj5B2qkLJqWxNdlhpeQd2I Cancel-Lock: sha1:fblluUa+h3/hRCW0la8j8pAOTXk= sha1:4pnlhTyzQz4W0GnVCkX+WQFxgq8= User-Agent: NewsTap/5.1.2 (iPad) Xref: csiph.com comp.arch:32732 sci.electronics.design:393650 Nick Maclaren wrote: > In article , > Ivan Godard wrote: >> >>> It has been known for half a century that integer multiply is a >>> critical addressing operation for a significant proportion of >>> important codes, though 'computer scientists' often refuse to >>> admit it. >> >> Nick - mul for scaling by stride, when you can't strength-reduce to an >> add, or when there are more disjoint addresses than you have registers >> to use for control variables. >> >> However, with modern high-reg-count architectures (or long belt-count) >> and a general choice of natural alignment in arrays (leading to the mul >> being a manifest power-of-two and hence implementable with a shift) it's >> much less an issue. And where neither strength reduction nor shift work, >> most compilers are fairly clever about doing immediate multiplies as >> shift-and-add combinations. > > Not in my experience :-( The sort of algorithms that critically need > such code are not typically ones where you can control the sizes or > strides. I would be interested in which compilers, because I have > observed the converse - i.e. that trick is less common than it used > to be. But see below: dynamic sizes and strides are the ones of > interest. > >> We looked hard at this, and concluded that we needed to support stride >> scaling in addressing for all scalar strides. Pending measurement we >> have not yet settled on whether to extend that to 2*scalar stride, >> primarily for complex. Actually the bits are there to encode strides up >> to 128, although the utility of that is questionable :-) > > Grrk. That's a CATASTROPHIC solution! I am not arguing about whether > to be able to address in terms of simple, fixed object sizes - that's > a separate issue and the one that actually resolves. But, once you > start thinking of array sizes and strides as fixed at compile-time, > you end up with (original) Pascal/C/C++ - ghastly languages for array > algorithms, all. Yup. It is fascinating that the KDF9, delivered 52 years ago, had auto-increment addressing modes that updated the loop count by 1 and the address/offset by a dynamically-settable stride that could be as large as the largest address, and either positive or negative. In conjunction with its FMA operation, and a jump-on-nonzero-count instruction that looped inside the instruction buffer, it made a superb scalar-product evaluator of a machine with very modest h/w resources. I think I might detect the influence of Jim Wilkinson in this. -- Bill Findlay