Mersenne Digest Saturday, October 9 1999 Volume 01 : Number 639 ---------------------------------------------------------------------- Date: Thu, 7 Oct 1999 18:07:28 EDT From: [EMAIL PROTECTED] Subject: Mersenne: Re: register usage Guillermo Ballester Valor wrote: > i) MacLucasUNIX uses intensively the 'register' key in local > definitions, so a processor with many internal registers can allocate > most of them. It is a good thing because they can be accessed very fast. > The bad thing that is that in processors with very few registers (like > intel's) it can slowdown the speed. Brian Beesley replied: << And (according to a local computer scientist, who I think knows what he's talking about) with modern processors making extensive use of register renaming, it's not usually sensible to use the "register" keyword _at all_. The theory is that the instruction scheduler can do at least as good a job as the programmer >> Indeed. I note that when I tried to compile MacLucasUNIX on my Alpha, the C compiler gave me an error message about being unable to allocate sufficient registers in routine FFT_IFFT8 - I had to delete the "register" keyword in that routine to get it to compile. The most complex, register- greedy routine in my Mlucas code, wrapper_square, defines 103 floating- point temporaries, any of which deserves the "register" keyword (were such available in f90, which it isn't) as much as the others. However, typically at most 30 of these temporaries need be in registers at any one time, and a good compiler should be able to decide which registers to use for what and when at least as well (or better) than I can. Since such decisions are going to be hardware-dependent anyway, it's better to leave it up to the compiler. The other nice thing about letting the compiler do this for you is that one can use meaningful variable names, and need not worry too much about minimizing the number of temporaries, which leads to excessive re-use of the same temporary names, and makes understanding/debugging the code harder. On the other hand, I was under the impression that the C "register" keyword was intended as a suggestion to the compiler, not an absolute, i.e. that compilers should be free to heed or ignore the programmer's advice on this point. Looks like whether that's true depends on the compiler. - -Ernst _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Fri, 08 Oct 1999 23:32:34 +1000 From: Simon Burge <[EMAIL PROTECTED]> Subject: Re: Mersenne: Re: register usage [EMAIL PROTECTED] wrote: > On the other hand, I was under the impression that the C "register" > keyword was intended as a suggestion to the compiler, not an absolute, > i.e. that compilers should be free to heed or ignore the programmer's > advice on this point. Looks like whether that's true depends on the compiler. >From what I understand of gcc (the GNU C compiler), the only thing that using "register" affects is what variables are retained by setjmp()/longjmp() - and you don't tend to see those routines being used in numerical code. As to which variables are actually stored in registers, I think gcc ignores the "register" keyword when making those decisions. Indeed, a good optimiser may make some variables disappear altogether, which can make object-level debugging difficult with heavy optimisation enabled... Simon. _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Fri, 8 Oct 1999 11:23:55 -0400 (EDT) From: [EMAIL PROTECTED] Subject: Re: Mersenne: Re: register usage > From what I understand of gcc (the GNU C compiler), > the only thing that using "register" affects is what > variables are retained by setjmp()/longjmp() There are some ANSI C-compliant restrictions on what you can and cannot do with a 'register' variable. For instance, you can't apply it to something that won't fit in the machine word length (like an array), and you cant take the address-of it with &. > in registers, I think gcc ignores the "register" > keyword when making those decisions. >From the horses' mouth (7.1.1.3 in the 1997 ISO public review effort for C++) 3 A register specifier has the same semantics as an auto specifier together with a hint to the implementation that the object so declared will be heavily used. [Note: the hint can be ignored and in most implementations it will be ignored if the address of the object is taken. --end note] It's great that we have to deal with double talk like that these days :) After all, these days something as supposedly horrendous as [esp+4*edx+32] doesn't actually cost a lot. In fact, placing demands on register inclusion can really mess up the pipeline. Chris Nash Lexington KY UNITED STATES _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Fri, 08 Oct 1999 18:36:22 +0200 From: Guillermo Ballester Valor <[EMAIL PROTECTED]> Subject: Re: Mersenne: Re: register usage [EMAIL PROTECTED] wrote: > << And (according to a local computer scientist, who I think knows what > he's talking about) with modern processors making extensive use of > register renaming, it's not usually sensible to use the "register" > keyword _at all_. The theory is that the instruction scheduler can do > at least as good a job as the programmer >> > Before the beginning of FFTW thread, this was the thinking I had about 'register' keyword. I had never used it in my programs. When I was learning C the use of register keyword made the programs slower and so I left to the compiler the good use of them (I remember the compiler was Borland Turbo-C under DOS). > On the other hand, I was under the impression that the C "register" > keyword was intended as a suggestion to the compiler, not an absolute, > i.e. that compilers should be free to heed or ignore the programmer's > advice on this point. Looks like whether that's true depends on the compiler. Yes, I've compiled MacLucasUNIX in my pentium 166-MMX (linux/gcc) and it doesn't give any error or warning about 'register'. My question is still why works so different FFTW on modern RISC processors?. Likely, the use of register is not the answer. The code of FFTW tries to minimize the memory accesses, the mul and add operations and stack temporary variables. Perhaps the weight assigned to every of this task is the correct to intel machines but not for alphas or mips, I don't know. By the way, the memory accesses in FFTW seems very good for intel but I've not seen any similar in Mlucas or MaclucasUNIX. FFTW uses the memory access in the form X[i*iostride] where iostride is not necessary a power of two. I don't know a word about assembler on alpha's or other machine than x86 but perhaps is better to store the offset on a register and then use X[offset] when is needed. Again, a good compiler would have to do it. Regards | Guillermo Ballester Valor | | [EMAIL PROTECTED] | | c/ cordoba, 19 | | 18151-Ogijares (Spain) | | (Linux registered user 1171811) | _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: 8 Oct 1999 20:44:41 -0000 From: "D. J. Bernstein" <[EMAIL PROTECTED]> Subject: Mersenne: FFT speed djbfft 0.76 is faster than FFTW on most computers, notably the Pentium and the UltraSPARC: http://pobox.com/~djb/djbfft.html The range of FFT sizes in djbfft 0.76 is too small to support Mersenne testing directly, but it wouldn't be difficult to build tolerably fast big transforms out of the existing pieces. - ---Dan _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Fri, 8 Oct 1999 17:45:43 EDT From: [EMAIL PROTECTED] Subject: Mersenne: Gaudeamus Igitur (Latin for "let's party!") Dear All: Luke Welsh indicates that he'll be in the San Francisco Bay area around the end of October and asked me to announce the SECOND NOT-QUITE-ANNUAL SF BAY MERSENNERS GET-TOGETHER-KIND-OF-DEAL (a.k.a. as GIMPS OktoberGeekFest II.1, rev 1) Of course, any GIMPSer is welcome to attend, whether they live in the bay area or not. Perhaps other areas of the globe with a high concentration of GIMPSers could organize their own local local GOGfests - that would be fun - "you've seen the power of distributed computing, now try distributed imbibing!" (whichever beverage you prefer, of course - not everyone's a beer aficionado like Luke and me). We've settled on a date of Friday, 29 October for the festivities. In an attempt to keep the tradition of the first such meeting, our first choice of venue is the Tied House in Mountain View, whose back patio can accommodate around 50 persons. Of course, we have no idea how many might attend, so if you're reasonably certain you'll be coming, please let me know via private e-mail. Other possible venues include the Faultline pub (I quake at the thought :) and Gordon Biersch (perhaps too small), both in Sunnyvale. Other suggestions for venues are welcome, too. Looking forward to a fun time, - -Ernst "der Bra"umeister" Mayer _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Fri, 8 Oct 1999 23:38:18 +0200 From: "Steinar H. Gunderson" <[EMAIL PROTECTED]> Subject: Mersenne: Re: register usage On Fri, Oct 08, 1999 at 11:32:34PM +1000, Simon Burge wrote: >>From what I understand of gcc (the GNU C compiler), the only thing >that using "register" affects is what variables are retained by >setjmp()/longjmp() >From the gcc manpage: gcc, g++ - GNU project C and C++ Compiler (gcc-2.95) [...] Without `-O', only variables declared register are allocated in registers. /* Steinar * - -- Homepage: http://members.xoom.com/sneeze/ _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Fri, 8 Oct 1999 23:55:05 +0100 From: "Brian J. Beesley" <[EMAIL PROTECTED]> Subject: Re: Mersenne: Re: register usage On 7 Oct 99, at 18:07, [EMAIL PROTECTED] wrote: > On the other hand, I was under the impression that the C "register" > keyword was intended as a suggestion to the compiler, not an absolute, > i.e. that compilers should be free to heed or ignore the programmer's > advice on this point. Looks like whether that's true depends on the compiler. This is indeed true. MS VC++ for Intel (at least up to v5.1) dedicates the ESI & EDI registers for register variables, they are assigned to the first two (integer) variables to be allocated in each block. It _does_ make sense to use the 'register' keyword for the two innermost loop counters (or pointers) because otherwise the object code generated by the compiler doesn't use these registers at all (without pushing their values to the stack & popping them off again, and only then for those peculiar Intel instructions like MOVSB which implicitly use ESI & EDI as pointers). If you declare more than two register variables in a block, the (MS VC++) compiler ignores the register modifier for the third & subsequent declarations. This actually makes sense for a CPU architecture like 486 or "plain" Pentium, but, for P6 architecture chips, experiments indicate that the effects of the use of the "register" keyword in MS VC++ code are variable, but (on average) about neutral. Regards Brian Beesley _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Sat, 9 Oct 1999 17:18:35 +0200 From: "Steinar H. Gunderson" <[EMAIL PROTECTED]> Subject: Mersenne: Re: Re: register usage On Fri, Oct 08, 1999 at 11:55:05PM +0100, Brian J. Beesley wrote: >MS VC++ for Intel (at least up to v5.1) dedicates the ESI & EDI >registers for register variables, they are assigned to the first two >(integer) variables to be allocated in each block. Isn't this a bit weird behaviour? As you said, it helps to use all registers (at least on 486 and Pentium), and having 30% extra registers or so never _hurts_ :-) /* Steinar */ - -- Homepage: http://members.xoom.com/sneeze/ _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ Date: Sun, 10 Oct 1999 03:13:28 +0100 From: "Ian L McLoughlin" <[EMAIL PROTECTED]> Subject: Mersenne: Version 19 Problems/Win 98 Hi. Not my remit really ...but having downloaded the new version and unzipped it...with all the parameters and subsidiary crap ..i.e RPC and HTTP files, It suddenly links up to the server and downloads new exponens....I am sure testing LL 9xxxxxx is enough on a cyrix....its my baby! Surely the EXE. file (Red) is the one.......I now after grappling with shortcuts and supplanting various files blah blah cant download any work that I have managed to salvage from an exponent I have been testing for over 4 months.... Please can not somebody make it a bit more user friendly... No wonder people go to other more friendly collective projects... Very dissappointed at the supplementation and interface.... O.K. I downloaded it...Version 19 is no faster than 18, and wasted me a lot of time.. If you are looking to pull people in to this project dont assume to much knowledge as to the users, Keep It simple stupid please... There is a problem with Maths/Computer buffs...they assume to much...!! Some off us might want to contribute but wading through .txt files isnt it???!! Sorry I will have to be off to see what is in certian folders,DOS files.....I think Seti might be easier.. FOR GOD SAKE GIVE ME A USER FRIENDLY INTERFACE, PROPER HELP MENU.... AHHHHHH.... Ian McLoughlin, Chematek U.K. Tel/Fax : +44(0)1904 679906 Mobile : +44(0)7801 823421 Website: www.chematekuk.co.uk _________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers ------------------------------ End of Mersenne Digest V1 #639 ******************************
