home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky sci.math:11353 comp.lang.misc:3056 comp.lang.fortran:3541 comp.std.c:2619 comp.lang.c:13611
- Path: sparky!uunet!gatech!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
- From: hrubin@pop.stat.purdue.edu (Herman Rubin)
- Newsgroups: sci.math,comp.lang.misc,comp.lang.fortran,comp.std.c,comp.lang.c
- Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
- Message-ID: <BuJ4Es.49w@mentor.cc.purdue.edu>
- Date: 13 Sep 92 18:23:16 GMT
- References: <id.I12T.GP4@ferranti.com> <a_rubin.716152347@dn66> <MEISSNER.92Sep11164441@curley.osf.org>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University Statistics Department
- Lines: 41
-
- In article <MEISSNER.92Sep11164441@curley.osf.org> meissner@osf.org (Michael Meissner) writes:
- >In article <a_rubin.716152347@dn66> a_rubin@dsg4.dse.beckman.com
- >(Arthur Rubin) writes:
-
- >| Using, instead,
-
- >| c = (long)a * b;
-
- >| it becomes a "quality of implementation" issue; and using the 4/2->2,2
- >| divide instruction would incorrect on 80x86 machines, as the divide
- >| instruction would overflow in cases where the C operations would be legal.
-
- >With most optimizing compilers, this is pretty simple to put in, since
- >most optimizations are essentially pattern matching (you match the two
- >converts, and long multiply). Some time ago, I put long long multiply
- >code into the MIPS port of GCC for instance in about 2 minutes of
- >time. The code:
-
- > long long mul (long a, long b) { return (long long)a * b; }
-
- >produces the following code:
-
- > mul:
- > mult $4,$5
- > mfhi $3
- > mflo $2
- > j $31
-
- >You are in a twisty little passage of standards, all conflicting.
-
- This may or may not depend on the compiler, however. And it still is
- not quite adequate. One should be able to have the option of overloading
- the * operator so that if c is long long, and a and b are long, this can
- be written as c = a * b.
-
- The point is that C is not the great answer, as many posters claim it is.
- --
- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
- Phone: (317)494-6054
- hrubin@pop.stat.purdue.edu (Internet, bitnet)
- {purdue,pur-ee}!pop.stat!hrubin(UUCP)
-