Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!wendyt From: wendyt@pyramid.UUCP (Wendy Thrash) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C (Really arguments in registers) Message-ID: <357@pyramid.UUCP> Date: Thu, 8-May-86 14:30:20 EDT Article-I.D.: pyramid.357 Posted: Thu May 8 14:30:20 1986 Date-Received: Sun, 11-May-86 00:37:04 EDT References: <778@bentley.UUCP> <791@bentley.UUCP> <268@valid.UUCP> Reply-To: wendyt@pyramid.UUCP (Wendy Thrash) Organization: Pyramid Technology Corp., Mountain View, CA Lines: 42 WARNING: This article discusses compiler issues, not specifically C language issues. In article <268@valid.UUCP> sbs@valid.UUCP (Steven Brian McKechnie Sargent) writes: >* Arguments passed in registers... >... have the same effect of reducing simplicity for doubtful gain. I don't want to quote too much of the original article -- it was rather long. The thrust of it was that passing parameters in registers doesn't make things run faster. This does not fit with my experience. When we implemented parameter passing in registers at Zilog, it was a big win. The argument that register variables must be pushed on the stack in order to pass parameters in registers seems tenuous. If you have only one set of registers available for variables, you have to save them sometime, unless the routine you are calling has no register variables itself. More commonly, registers used for parameter passing are not used for register variables; they may be used for temporaries. It is true that this may cut down on the number of available registers, but our work showed that we had enough registers remaining to allow good code generation for most programs. We did, indeed, allow the callee to use its arguments in place. Mr. Sargent's statements about "spaghetti code" make no sense at all to me -- this was a COMPILER; it was designed to produce efficient assembly language, not readable assembly language. When the compiler functioned correctly (as it usually did) there were no "attendant side effects and untraceable bugs." I will admit that this parameter passing caused difficulties. In particular, varargs code was messy, and debuggers more difficult to implement. Was it worth it? I believe so. Our emphasis was on speed, and that we had. Of course, this is all moot on RISC machines with sliding register windows. The concept of parameter passing in registers is then wired into the architecture, and there are plenty of registers left for register variables. --- Disclaimer: My opinions have obviously been influenced by the parameter passing in registers of my former employer (Zilog) and the sliding windows of my current employer (Pyramid). -- Wendy Thrash {allegra,cmcl2,decwrl,hplabs,topaz,ut-sally}!pyramid!wendyt Pyramid Technology Corp, Mountain View, CA +1 415 965 7200 ext. 3001