Path: blob/main/lib/libc/softfloat/timesoftfloat.txt
39476 views
$NetBSD: timesoftfloat.txt,v 1.1 2000/06/06 08:15:11 bjh21 Exp $12Documentation for the `timesoftfloat' Program of SoftFloat Release 2a34John R. Hauser51998 December 14678-------------------------------------------------------------------------------9Introduction1011The `timesoftfloat' program evaluates the speed of SoftFloat's floating-12point routines. Each routine can be evaluated for every relevant rounding13mode, tininess mode, and/or rounding precision.141516-------------------------------------------------------------------------------17Contents1819Introduction20Contents21Legal Notice22Executing `timesoftfloat'23Options24-help25-precision32, -precision64, -precision8026-nearesteven, -tozero, -down, -up27-tininessbefore, -tininessafter28Function Sets29303132-------------------------------------------------------------------------------33Legal Notice3435The `timesoftfloat' program was written by John R. Hauser.3637THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort38has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT39TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO40PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY41AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.424344-------------------------------------------------------------------------------45Executing `timesoftfloat'4647The `timesoftfloat' program is intended to be invoked from a command line48interpreter as follows:4950timesoftfloat [<option>...] <function>5152Here square brackets ([]) indicate optional items, while angled brackets53(<>) denote parameters to be filled in. The `<function>' argument is54the name of the SoftFloat routine to evaluate, such as `float32_add' or55`float64_to_int32'. The allowed options are detailed in the next section,56_Options_. If `timesoftfloat' is executed without any arguments, a summary57of usage is written. It is also possible to evaluate all machine functions58in a single invocation as explained in the section _Function_Sets_ later in59this document.6061Ordinarily, a function's speed will be evaluated separately for each of62the four rounding modes, one after the other. If the rounding mode is not63supposed to have any affect on the results of a function--for instance,64some operations do not require rounding--only the nearest/even rounding mode65is timed. In the same way, if a function is affected by the way in which66underflow tininess is detected, `timesoftfloat' times the function both with67tininess detected before rounding and after rounding. For extended double-68precision operations affected by rounding precision control, `timesoftfloat'69also times the function for all three rounding precision modes, one after70the other. Evaluation of a function can be limited to a single rounding71mode, a single tininess mode, and/or a single rounding precision with72appropriate options (see _Options_).7374For each function and mode evaluated, `timesoftfloat' reports the speed of75the function in kops/s, or ``thousands of operations per second''. This76unit of measure differs from the traditional MFLOPS (``millions of floating-77point operations per second'') only in being a factor of 1000 smaller.78(1000 kops/s is exactly 1 MFLOPS.) Speeds are reported in thousands instead79of millions because software floating-point often executes at less than801 MFLOPS.8182The speeds reported by `timesoftfloat' may be affected somewhat by other83programs executing at the same time as `timesoftfloat'.8485Note that the remainder operations (`float32_rem', `float64_rem',86`floatx80_rem' and `float128_rem') will be markedly slower than other87operations, particularly for extended double precision (`floatx80') and88quadruple precision (`float128'). This is inherent to the remainder89function itself and is not a failing of the SoftFloat implementation.909192-------------------------------------------------------------------------------93Options9495The `timesoftfloat' program accepts several command options. If mutually96contradictory options are given, the last one has priority.9798- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -99-help100101The `-help' option causes a summary of program usage to be written, after102which the program exits.103104- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -105-precision32, -precision64, -precision80106107For extended double-precision functions affected by rounding precision108control, the `-precision32' option restricts evaluation to only the cases109in which rounding precision is equivalent to single precision. The other110rounding precision options are not timed. Likewise, the `-precision64'111and `-precision80' options fix the rounding precision equivalent to double112precision or extended double precision, respectively. These options are113ignored for functions not affected by rounding precision control.114115- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -116-nearesteven, -tozero, -down, -up117118The `-nearesteven' option restricts evaluation to only the cases in which119the rounding mode is nearest/even. The other rounding mode options are not120timed. Likewise, `-tozero' forces rounding to zero; `-down' forces rounding121down; and `-up' forces rounding up. These options are ignored for functions122that are exact and thus do not round.123124- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -125-tininessbefore, -tininessafter126127The `-tininessbefore' option restricts evaluation to only the cases128detecting underflow tininess before rounding. Tininess after rounding129is not timed. Likewise, `-tininessafter' forces underflow tininess to be130detected after rounding only. These options are ignored for functions not131affected by the way in which underflow tininess is detected.132133- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -134135136-------------------------------------------------------------------------------137Function Sets138139Just as `timesoftfloat' can test an operation for all four rounding modes in140sequence, multiple operations can also be tested with a single invocation.141Three sets are recognized: `-all1', `-all2', and `-all'. The set `-all1'142comprises all one-operand functions; `-all2' is all two-operand functions;143and `-all' is all functions. A function set can be used in place of a144function name in the command line, as in145146timesoftfloat [<option>...] -all147148149150151