Ignore:
Timestamp:
2011-08-06T07:04:50Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d3e241a, e0e922d
Parents:
9a6034a
Message:

Quadruple-precision softfloat, coding style improvements. Details below…

Highlights:

  • completed double-precision support
  • added quadruple-precision support
  • added SPARC quadruple-precision wrappers
  • added doxygen comments
  • corrected and unified coding style

Current state of the softfloat library:

Support for single, double and quadruple precision is currently almost complete (apart from power, square root, complex multiplication and complex division) and provides the same set of features (i.e. the support for all three precisions is now aligned). In order to extend softfloat library consistently, addition of quadruple precision was done in the same spirit as already existing single and double precision written by Josef Cejka in 2006 - that is relaxed standard-compliance for corner cases while mission-critical code sections heavily inspired by the widely used softfloat library written by John R. Hauser (although I personally think it would be more appropriate for HelenOS to use something less optimized, shorter and more readable).

Most of the quadruple-precision code is just an adapted double-precision code to work on 128-bit variables. That means if there is TODO, FIXME or some defect in single or double-precision code, it is most likely also in the quadruple-precision code. Please note that quadruple-precision functions are currently not tested - it is challenging task for itself, especially when the ports that use them are either not finished (mips64) or badly supported by simulators (sparc64). To test whole softfloat library, one would probably have to either write very non-trivial native tester, or use some existing one (e.g. TestFloat from J. R. Hauser) and port it to HelenOS (or rip the softfloat library out of HelenOS and test it on a host system). At the time of writing this, the code dependent on quadruple-precision functions (on mips64 and sparc64) is just a libposix strtold() function (and its callers, most notably scanf backend).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/softfloat/include/conversion.h

    r9a6034a rc67aff2  
    11/*
    22 * Copyright (c) 2005 Josef Cejka
     3 * Copyright (c) 2011 Petr Koupy
    34 * All rights reserved.
    45 *
     
    3031 * @{
    3132 */
    32 /** @file
     33/** @file Conversion of precision and conversion between integers and floats.
    3334 */
    3435
     
    3738
    3839extern float64 convertFloat32ToFloat64(float32);
     40extern float128 convertFloat32ToFloat128(float32);
     41extern float128 convertFloat64ToFloat128(float64);
     42
     43
    3944extern float32 convertFloat64ToFloat32(float64);
     45extern float32 convertFloat128ToFloat32(float128);
     46extern float64 convertFloat128ToFloat64(float128);
     47
    4048
    4149extern uint32_t float32_to_uint32(float32);
     
    4553extern int64_t float32_to_int64(float32);
    4654
     55extern uint32_t float64_to_uint32(float64);
     56extern int32_t float64_to_int32(float64);
     57
    4758extern uint64_t float64_to_uint64(float64);
    4859extern int64_t float64_to_int64(float64);
    4960
    50 extern uint32_t float64_to_uint32(float64);
    51 extern int32_t float64_to_int32(float64);
     61extern uint32_t float128_to_uint32(float128);
     62extern int32_t float128_to_int32(float128);
     63
     64extern uint64_t float128_to_uint64(float128);
     65extern int64_t float128_to_int64(float128);
     66
    5267
    5368extern float32 uint32_to_float32(uint32_t);
     
    6378extern float64 int64_to_float64(int64_t);
    6479
     80extern float128 uint32_to_float128(uint32_t);
     81extern float128 int32_to_float128(int32_t);
     82
     83extern float128 uint64_to_float128(uint64_t);
     84extern float128 int64_to_float128(int64_t);
     85
    6586#endif
    6687
Note: See TracChangeset for help on using the changeset viewer.