home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 11039 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  2.8 KB

  1. Xref: sparky comp.arch:11039 comp.lang.misc:3846
  2. Newsgroups: comp.arch,comp.lang.misc
  3. Path: sparky!uunet!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  4. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  5. Subject: Re: Hardware Support for Numeric Algorithms
  6. Message-ID: <By6vop.2KM@mentor.cc.purdue.edu>
  7. Sender: news@mentor.cc.purdue.edu (USENET News)
  8. Organization: Purdue University Statistics Department
  9. References: <1efg1gINNm6c@network.ucsd.edu> <1992Nov22.192342.10288@qb.rhein-main.de>
  10. Date: Mon, 23 Nov 1992 21:58:00 GMT
  11. Lines: 42
  12.  
  13. In article <1992Nov22.192342.10288@qb.rhein-main.de> vhs@rhein-main.de writes:
  14. >In article <1efg1gINNm6c@network.ucsd.edu> mbk@lyapunov.ucsd.edu (Matt Kennel) writes:
  15. >> akao@.com (Adam Kao) writes:
  16. >> : In article <Bxv2t2.4FH@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman  
  17. >Rubin) writes:
  18.  
  19.             ....................
  20.  
  21. >In the very moment you get hardware dependent you also lose portability. If
  22. >you accept loss in portability, do it in assembler. If you need a portable
  23. >assembler with elementary type-conversion and safe subroutine calls, symbolic
  24. >names for variables and little overhead, use C. That's about as close to
  25. >assembler (as hardware dependent) as you can get without resorting to assembler.
  26. >I also can hardly imagine what a language would look like that had some special
  27. >operators for e.g. "FP division by integer value with remainder saved" on one
  28. >architecture but would compile and run on another one.
  29. >Other than #define-ing some assembler macros for each machine and inlining the
  30. >expansions.
  31.  
  32. We do not have full portability now, nor is it likely we ever will.  If 
  33. word lengths change, or rounding changes, or whatever, portability is 
  34. lost.  It is not necessary to lose all portability to get great improvement.
  35.  
  36. C is an atrocity as a portable assembler.  Too many of the instructions are
  37. missing.  Such simple things as packing and unpacking, n x n -> 2n products
  38. and the corresponding quotients, handling of overflows, bit operations,
  39. and many others vary from non-existent to dead slow if you can do them.
  40.  
  41. This carries over to architecture.  Finding the next one in a bit stream
  42. costs an arm and a leg in C, or even in machine language on most machines. 
  43. Think of how much information must be considered; the number of bits left
  44. in the current word being looked at, and of course what they are, the address
  45. of the next word in the stream, and also that of the end of the stream.  Even
  46. if all of these are in registers, it is not cheap, and we have 4 registers,
  47. plus the output register, involved in this very simple operation, and we
  48. have conditional code all down the line.
  49.  
  50. -- 
  51. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  52. Phone: (317)494-6054
  53. hrubin@snap.stat.purdue.edu (Internet, bitnet)  
  54. {purdue,pur-ee}!snap.stat!hrubin(UUCP)
  55.