Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!gatech!amdcad!tim From: tim@amdcad.AMD.COM (Tim Olson) Newsgroups: comp.arch Subject: Re: What should be in hardware but isn't Message-ID: <18336@amdcad.AMD.COM> Date: Tue, 22-Sep-87 12:11:11 EDT Article-I.D.: amdcad.18336 Posted: Tue Sep 22 12:11:11 1987 Date-Received: Thu, 24-Sep-87 05:28:04 EDT References: <581@l.cc.purdue.edu> Reply-To: tim@amdcad.UUCP (Tim Olson) Organization: Advanced Micro Devices Lines: 50 In article <581@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: +----- | There are many instructions which are easy to implement in hardware, but | for which software implementation may even be so costly that a procedure | using the instruction may be worthless. Some of these instructions have | been implemented in the past and have died because the ill-designed | languages do not even recognize their existence. Others have not been | included due to the non-recognition of them by the so-called experts and | by the stupid attitude that something should not be implemented unless | 99.99% of the users of the machine should be able to want the instruction | _now_. As you can tell from this article, I consider the present CISC | computers to be RISCy. +----- From the following examples, it sure appears as if you are arguing for "letting the user decide" how certain functions are implemented. The easiest (and probably best) way to do this is to provide a fast, fixed set of primitive operations, and let users build what they need from that set (i.e. RISC). +----- | One situation of this type which has been discussed in this newsgroup is | the proper treatment of quotient and remainder for integer division when | the numbers are not both positive. Everyone took a stand for some specific- | ation. I say "let the user decide." Even if both signs are positive, | which alternative I want for one problem may not be the one I want for | another problem. Having 2-4 bits to specify the alternative for each | sign combination should take very little run time and little space. +----- With the correct primatives, you can easily code these as procedures which will run *as fast* as standard div, mod, rem. +----- | I have run into situations in non-uniform random number generation for which | considerable time is needed to carry out tests which would be better handled | as exceptions. One of these is to decrement an index, use the result for a | read or write instruction if non-negative, and interrupt if negative to a | user-provided exception handler. +----- Fast (free) detection of over/underflow conditions is important, especially to efficiently implement languages with runtime bounds-checking and exception handling. This is why the Am29000 (and other RISC processors) have, in addition to the standard add and sub instructions, adds (add signed) and addu (add unsigned) which trap on overflow/underflow conditions. -- Tim Olson Advanced Micro Devices (tim@amdcad.amd.com)