home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / bsd / 8988 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.2 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!tools!ws
  2. From: ws@tools.de (Wolfgang Solfrank)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: [386BSD] A caution on using new man & gcc 2.3.1 notes.
  5. Date: 17 Nov 92 13:54:38
  6. Organization: TooLs GmbH, Bonn, Germany
  7. Lines: 53
  8. Distribution: comp
  9. Message-ID: <WS.92Nov17135438@kurt.tools.de>
  10. References: <JKH.92Nov9195806@esel.lotus.com>
  11.     <1992Nov15.232902.5582@raid.dell.com>
  12. NNTP-Posting-Host: kurt.tools.de
  13. In-reply-to: james@raid.dell.com's message of 15 Nov 92 23:29:02 GMT
  14.  
  15. In article <1992Nov15.232902.5582@raid.dell.com> james@raid.dell.com (James Van Artsdalen) writes:
  16.  
  17.    > Of course, when I tried to compile libc with it, it coredumped on
  18.    > ldexp.c, so it's not *that* robust either!
  19.  
  20.    I would bet that there is an asm statement in ldexp.c that tries to
  21.    use 387 registers.  gcc 2.3.1 uses a different syntax for such
  22.    expressions than gcc 1.39, and it's unlikely that any asm statement
  23.    involving 387 regs will work without being rewritten.
  24.  
  25. That's correct. I changed ldexp for use with gcc 2.1 some time ago.
  26. Here is the context diff for my version. It should compile with both
  27. the new and the old version of gcc.
  28.  
  29. diff -c bsd/lib/libc/i386/gen/ldexp.c:1.1.1.1 bsd/lib/libc/i386/gen/ldexp.c:1.3
  30. *** bsd/lib/libc/i386/gen/ldexp.c:1.1.1.1    Tue Nov 17 13:47:27 1992
  31. --- bsd/lib/libc/i386/gen/ldexp.c    Tue Nov 17 13:47:27 1992
  32. ***************
  33. *** 43,48 ****
  34. --- 43,50 ----
  35.    *
  36.    * Written by Sean Eric Fagan (sef@kithrup.COM)
  37.    * Sun Mar 11 20:27:09 PST 1990
  38. +  * Modified by Wolfgang Solfrank (ws@tools.de) for GCC 2.1
  39. +  * Tue Jun  9 12:56:33 MET DST 1992
  40.    */
  41.   
  42.   /*
  43. ***************
  44. *** 55,62 ****
  45. --- 57,74 ----
  46.   {
  47.       double temp, texp, temp2;
  48.       texp = exp;
  49. + #ifdef    __GNUC__
  50. + #if    __GNUC__ >= 2
  51. +     asm ("fscale "
  52. +         : "=u" (temp), "=t" (temp2)
  53. +         : "0" (texp), "1" (value));
  54. + #else
  55.       asm ("fscale ; fxch %%st(1) ; fstp%L1 %1 "
  56.           : "=f" (temp), "=0" (temp2)
  57.           : "0" (texp), "f" (value));
  58. + #endif
  59. + #else
  60. + error unknown asm
  61. + #endif
  62.       return (temp);
  63.   }
  64.  
  65. Hope this helps someone...
  66. --
  67. ws@tools.de     (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
  68.