Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!hao!oddjob!mimsy!umd5!uvaarpa!virginia!babbage!mac3n From: mac3n@babbage.UUCP Newsgroups: comp.lang.c,comp.misc Subject: Re: 32bit = 16bit x 16bit (Really: Compiler deficiencies) Message-ID: <120@babbage.acc.virginia.edu> Date: Tue, 27-Oct-87 14:25:54 EST Article-I.D.: babbage.120 Posted: Tue Oct 27 14:25:54 1987 Date-Received: Sat, 31-Oct-87 02:21:40 EST References: <141@kesmai.COM> 7349@alice.UUCP <146MAXHAM@RICE> <593@l.cc.purdue.edu> Organization: University of Virginia Lines: 28 Xref: utgpu comp.lang.c:4928 comp.misc:1368 In article <593@l.cc.purdue.edu>, cik@l.cc.purdue.edu (Herman Rubin) writes: > A general problem with HLL's is that they do not have the necessary > flexibility to handle situations like this. I do not know of any language > which has in its operation list an operation to multiply two 16 bit object > and get a 32 bit object. In, e.g., Ada the overloading operators allow one to extend "*" for use with two "16 bit" objects when the context calls for a "32 bit" object. Ada is fairly unusual in allowing overload resolution based on context, a feature that adds considerable complexity to the compiler. > I know > of no way to tell the compiler that here is an operation with a given syntax, > and the compiler should put it in its set of operations. The usual way to extend the set of operations in a language is with procedures. Many languages are compatible with machine-language procedures. Some languages allow inline procedues. Some even allow inline assembler. If you really want that much control over the code generated, perhaps you should write your own compiler. There are several systems which construct code generators from a set of instructions and their semantics. Automatic code generation generation is still pretty new. > It is clear that the languages need more flexibility > and that the gurus who claim that they have the solutions are wrong. Few Gurus claim that they have the perfect solutions. Merely adequate.