Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.arch Subject: Re: Unusual instructions and constructions Message-ID: <22782:Mar1502:10:3291@kramden.acf.nyu.edu> Date: 15 Mar 91 02:10:32 GMT References: <7499@mentor.cc.purdue.edu> <2378@tuvie.UUCP> Organization: IR Lines: 20 In article <2378@tuvie.UUCP> alex@vmars.tuwien.ac.at (Alexander Vrchoticky) writes: > hrubin@pop.stat.purdue.edu (Herman Rubin) writes: > > Even the addition of two vectors to > > produce a result should have different C code on different machines. > For the purposes of design diversity? Are you sure you did not want to > type `machine' instead of `C' there? #ifdef VECTOR for (i = 0; i < k; i++) y[i] = neg(x[i + r - k]); for (i = k; i < r; i++) y[i] = x[i - k]; for (i = 0; i < r; i++) x[i] = y[i]; #else for (i = 0; i < k; i++) y[i] = x[i + r - k]; for (i = r - 1; i >= k; i--) x[i] = x[i - k]; for (i = 0; i < k; i++) x[i] = neg(y[i]); #endif Well, okay, this is negacyclic rotation, but the point is the same. ---Dan