dmlaur@phoenix.Princeton.EDU (David M. Laur) (06/29/91)
I found this in the computer-architecture newsgroup (comp.arch) last week; provoked by an elder and better (Hi Lee!) I'm submitting it for your perusal: --------- Forwarded NetNews Article -------- Newsgroups: comp.arch Subject: Re: Branchless conditionals (Was: More on Linpack pivoting) Date: 22 Jun 91 10:50:28 GMT Organization: National Radio Astronomy Observatory, Charlottesville, VA In article <MAC.91Jun21094148@gold.kpc.com> mac@gold.kpc.com (Mike McNamara) writes: ... Most vector machines, (Ardent Titan, Convex, etc) have a vector compare instruction that sets or clears bits in any specified register based upon the compare; further, other operations can be specified to operate "undermask" of that register. This facilitates vectorization of loops containing conditionals... In most such machines one can use the bits to mask the "compress" of a vector of values 1...n by one means or another. The resulting vector is a list of indicies of the loop for which the condition was satisfied (or not satisfied). In such machines the list can then be used as an index vector for load and store (gather, scatter) operations. This technique is especially advantageous when the truth ratio (probability of test being satisfied) is low, or when the amount of work (especially load/store) being done in the loop is large. This approach is a part of standard bag of tricks for high performance programming of conditionals on vector boxes. Some compilers, notably the Fujitsu, produce such code automatically for loops preceded by a suitable truth ratio compiler directive, based on a execution cost analysis. It is even practical to use the approach on concurrent vector machines like the Alliants (yes, a concurrent vector compress!). Perhaps in this era of supersonic RISC engines nobody cares anymore about these old vector programming tactics... -- Donald C. Wells Associate Scientist dwells@nrao.edu National Radio Astronomy Observatory +1-804-296-0277 Edgemont Road Fax= +1-804-296-0278 Charlottesville, Virginia 22903-2475 USA 78:31.1W, 38:02.2N