Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!hao!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: comp.arch Subject: Re: conditional branches Message-ID: <28200098@ccvaxa> Date: 14 Feb 88 21:54:00 GMT References: <191@telesoft.UUCP> Lines: 33 Nf-ID: #R:telesoft.UUCP:191:ccvaxa:28200098:000:1329 Nf-From: ccvaxa.UUCP!aglew Feb 14 15:54:00 1988 ..> Comparisons, branches, and booleans The test x = 0, and therefore x = y, can almost certainly be done with minimum delay in a pipeline, as can x < 0, looking just at the sign bit. A full arithmetic compare might be a problem because of carry. When storing the result of a compare into a register, it might be better to store all the CC bits, rather than just a boolean corresponding to what you wanted to test. Eg. compare result := x ? y if result was < branch foo if result was > branch bar if result was unordered branch foobar ... And have a loose encoding so that the "if result was ..." instruction is cheap. This is similar to what some vector processors do with vector compares: create a vector of CCs, and be able to do multiple tests with them without rescanning the vector. Andy "Krazy" Glew. Gould CSD-Urbana. 1101 E. University, Urbana, IL 61801 aglew@gould.com - preferred, if you have nameserver aglew@gswd-vms.gould.com - if you don't aglew@gswd-vms.arpa - if you use DoD hosttable aglew%mycroft@gswd-vms.arpa - domains are supposed to make things easier? My opinions are my own, and are not the opinions of my employer, or any other organisation. I indicate my company only so that the reader may account for any possible bias I may have towards our products.