home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / sci / math / 11291 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.8 KB

  1. Xref: sparky sci.math:11291 comp.lang.misc:3033 comp.lang.fortran:3526 comp.std.c:2610 comp.lang.c:13554
  2. Newsgroups: sci.math,comp.lang.misc,comp.lang.fortran,comp.std.c,comp.lang.c
  3. Path: sparky!uunet!sun-barr!ames!think.com!paperboy.osf.org!meissner
  4. From: meissner@osf.org (Michael Meissner)
  5. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  6. In-Reply-To: a_rubin@dsg4.dse.beckman.com's message of 10 Sep 92 19:12:27 GMT
  7. Message-ID: <MEISSNER.92Sep11164441@curley.osf.org>
  8. Sender: news@osf.org (USENET News System)
  9. Organization: Open Software Foundation
  10. References: <92Sep1.205116edt.669@neuron.ai.toronto.edu>
  11.     <1992Sep4.162938.29237@dscomsf.desy.de>
  12.     <Bu2r42.5xr@mentor.cc.purdue.edu> <id.I12T.GP4@ferranti.com>
  13.     <a_rubin.716152347@dn66>
  14. Date: 11 Sep 92 16:44:41
  15. Lines: 31
  16.  
  17. In article <a_rubin.716152347@dn66> a_rubin@dsg4.dse.beckman.com
  18. (Arthur Rubin) writes:
  19.  
  20. | Using, instead, 
  21. |     c = (long)a * b;
  22. | it becomes a "quality of implementation" issue; and using the 4/2->2,2
  23. | divide instruction would incorrect on 80x86 machines, as the divide
  24. | instruction would overflow in cases where the C operations would be legal.
  25.  
  26. With most optimizing compilers, this is pretty simple to put in, since
  27. most optimizations are essentially pattern matching (you match the two
  28. converts, and long multiply).  Some time ago, I put long long multiply
  29. code into the MIPS port of GCC for instance in about 2 minutes of
  30. time.  The code:
  31.  
  32.     long long mul (long a, long b) { return (long long)a * b; }
  33.  
  34. produces the following code:
  35.  
  36.     mul:
  37.         mult    $4,$5
  38.         mfhi    $3
  39.         mflo    $2
  40.         j       $31
  41. --
  42. Michael Meissner    email: meissner@osf.org        phone: 617-621-8861
  43. Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142
  44.  
  45. You are in a twisty little passage of standards, all conflicting.
  46.