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/softfloat.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 Softfloat API.
    3334 */
    3435
     
    156157extern int __ltdf2(double, double);
    157158extern int __lttf2(long double, long double);
     159
    158160extern int __lesf2(float, float);
    159161extern int __ledf2(double, double);
     
    166168/* Not implemented yet */
    167169extern float __powisf2(float, int);
     170extern double __powidf2 (double, int);
     171extern long double __powitf2 (long double, int);
     172extern long double __powixf2 (long double, int);
     173
     174
     175
     176/* SPARC quadruple-precision wrappers */
     177
     178extern void _Qp_add(long double *, long double *, long double *);
     179extern void _Qp_sub(long double *, long double *, long double *);
     180extern void _Qp_mul(long double *, long double *, long double *);
     181extern void _Qp_div(long double *, long double *, long double *);
     182extern void _Qp_neg(long double *, long double *);
     183
     184extern void _Qp_stoq(long double *, float);
     185extern void _Qp_dtoq(long double *, double);
     186extern float _Qp_qtos(long double *);
     187extern double _Qp_qtod(long double *);
     188
     189extern int _Qp_qtoi(long double *);
     190extern unsigned int _Qp_qtoui(long double *);
     191extern long _Qp_qtox(long double *);
     192extern unsigned long _Qp_qtoux(long double *);
     193
     194extern void _Qp_itoq(long double *, int);
     195extern void _Qp_uitoq(long double *, unsigned int);
     196extern void _Qp_xtoq(long double *, long);
     197extern void _Qp_uxtoq(long double *, unsigned long);
     198
     199extern int _Qp_cmp(long double *, long double *);
     200extern int _Qp_cmpe(long double *, long double *);
     201extern int _Qp_feq(long double *, long double *);
     202extern int _Qp_fge(long double *, long double *);
     203extern int _Qp_fgt(long double *, long double *);
     204extern int _Qp_fle(long double*, long double *);
     205extern int _Qp_flt(long double *, long double *);
     206extern int _Qp_fne(long double *, long double *);
     207
     208/* Not implemented yet */
     209extern void _Qp_sqrt(long double *, long double *);
    168210
    169211#endif
Note: See TracChangeset for help on using the changeset viewer.