Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Mar 2008 11:21:14 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/i386/include _types.h
Message-ID:  <200803051121.m25BLE03035426@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
bde         2008-03-05 11:21:14 UTC

  FreeBSD src repository

  Modified files:
    sys/i386/include     _types.h 
  Log:
  Change float_t and double_t to long double on i386.  All floating point
  expressions on i386 are evaluated in the range of the long double type,
  so this is wrong in a different but hopefully less worse way than
  before.  Since expressions are evaluated in long double registers,
  there is no runtime cost to using long double instead of double to
  declare intermediate values (except in cases where this avoids compiler
  bugs), and by careful use of float_t or double_t it is possible to
  avoid some of the compiler bugs in this area, provided these types are
  declared as long double.
  
  I was going to change float.h to be less broken and more usable in
  combination with the change here (in particular, it is more necessary
  to know the effective number of bits in a double_t when double_t !=
  double, since DBL_MANT_DIG no longer logically gives this, and
  LDBL_MANT_DIG doesn't give it either with FreeBSD-i386's default
  rounding precision.  However, this was too hard for now.  In particular,
  LDBL_MANT_DIG is used a lot in libm, so it cannot be changed.  One
  thing that is completely broken now is LDBL_MAX.  This may have sort
  of worked when it was changed from DBL_MAX in 2002 (adding 0 to it at
  runtime gave +Inf, but you could at least compare with it), but starting
  with gcc-3.3.1 in 2003, it is always +Inf due to evaluating it at
  compile time in the default rounding precision.
  
  Revision  Changes    Path
  1.15      +2 -2      src/sys/i386/include/_types.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803051121.m25BLE03035426>