From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f8a1,c95fd329226ae099 X-Google-Attributes: gid10f8a1,public X-Google-Thread: 102b75,b29bd286830e0ed8 X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,c95fd329226ae099 X-Google-Attributes: gid1164f8,public From: ae@skyline.mti.sgi.com (Andrew Essen) Subject: Re: DEC RIP Date: 1998/02/13 Message-ID: <6c0607$354@chronicle.mti.sgi.com>#1/1 X-Deja-AN: 324606408 References: <34D02C2C.131E@EasyInternet.net> <6btivi$hna@news.or.intel.com> Organization: Silicon Graphics, Inc., Mountain View, CA Newsgroups: comp.arch,comp.sys.dec,vmsnet.alpha In article <6btivi$hna@news.or.intel.com>, Jonathan C Hall wrote: >Andrew Reilly (reilly@zeta.org.au) wrote: >: But you can do this anyway, with something like the Alpha >: architecture, provided you have enough registers to store the >: intermediate results of both branches. You just go ahead and >: compute both sides of the branch, and at the point where you >: know that your original condition will have been resolved, you >: ditch one half or the other. That could be with a conditional >: move if only one value is involved, or a branch. I'm afraid >: that I don't see how predication helps at all, really. >: > >I am by no means an expert on predication, but I think that I can >answer this. > >The method you propose will not work if there are instructions on >the speculative path that could cause traps or exceptions. I don't >know about Alpha, but on x86, there are many instructions that can >produce exceptions. This makes it very difficult for the compiler >to insert optimizations involving a conditional move. on a typical risc chip running floating point code with exceptions enabled, this could be a problem. for integer code, most alu-type operations don't cause exceptions. for integer instructions which can cause exceptions, you'd need an extra cmov to move in a safe operand when the instruction is on the "wrong path" (e.g., cmov a 1 as the divisor when a divide isn't supposed to be done). this, of course, makes the code even bigger. another solution is to add non-faulting versions of instructions and demand software check the validity of the data (e.g., the non-faulting loads in sparc-v9). from what little i know of x86, it does sound like these sorts of optimizations would be really, really hard. but with only 8 registers, it's probably pointless to begin with. andrew essen essen@computer.org