1. How much of this was part of Iverson's original (the book, not the movie^H^H^H^H^Htimeshared programming language) language "APL" ? 2. How many other "hidden" instructions does Intel and/or AMD have in their chips thanks to the Boys(&girls) from Baltimore? Has anyone fully explored the Intel/AMD order code set for any ghost instructions? --- Lisp/Haskell/whatever has "mapping" mechanisms, but many looping constructs really want "convolution" mechanisms. E.g., when processing sequences of GPS points, I don't just want to examine the points individually, but may want to compute incremental distances, speeds, & possibly apply 3rd order filters. Which languages already offer elegant convolution-type mechanisms? There used to be a version of Fortran that automatically computed derivatives (various levels of differences) which could do some of these things. It never seemed to have caught on. At 10:07 PM 5/2/2009, rwg@sdf.lonestar.org wrote:
Knuth is *emphatically* calling for 8x8bit matrix multiply, both xor and ior. --rwg
Xor Multiply
Intel is introducing the PCLMULQDQ instruction, which does a 64x64->128 bit Xor-Multiplication. (Their naming conventions remind me of the Tom Lehrer song about the Red Line.) This instruction is helpful in several crypto applications, and also in working with error correcting codes.
Puzzle: a) Use the new instruction in a routine to reverse 64 bits. This swaps the sign bit with the low order bit, etc. b) The new instruction can obviously be used to Xor-Square a 64-bit quantity. Use it to do "square root": collect the odd numbered bits 63-1 in the left half of the word, and the even numbered bits 62-0 in the right half. c) Extra credit: describe the relationship with card shuffling. d) Is PCLMULQDQ useful in implementing an arbitrary pre-specified bit permutation?
Rich