1 1.2 msaitoh $NetBSD: timesoftfloat.txt,v 1.2 2023/06/19 08:24:21 msaitoh Exp $ 2 1.1 bjh21 3 1.1 bjh21 Documentation for the `timesoftfloat' Program of SoftFloat Release 2a 4 1.1 bjh21 5 1.1 bjh21 John R. Hauser 6 1.1 bjh21 1998 December 14 7 1.1 bjh21 8 1.1 bjh21 9 1.1 bjh21 ------------------------------------------------------------------------------- 10 1.1 bjh21 Introduction 11 1.1 bjh21 12 1.1 bjh21 The `timesoftfloat' program evaluates the speed of SoftFloat's floating- 13 1.1 bjh21 point routines. Each routine can be evaluated for every relevant rounding 14 1.1 bjh21 mode, tininess mode, and/or rounding precision. 15 1.1 bjh21 16 1.1 bjh21 17 1.1 bjh21 ------------------------------------------------------------------------------- 18 1.1 bjh21 Contents 19 1.1 bjh21 20 1.1 bjh21 Introduction 21 1.1 bjh21 Contents 22 1.1 bjh21 Legal Notice 23 1.1 bjh21 Executing `timesoftfloat' 24 1.1 bjh21 Options 25 1.1 bjh21 -help 26 1.1 bjh21 -precision32, -precision64, -precision80 27 1.1 bjh21 -nearesteven, -tozero, -down, -up 28 1.1 bjh21 -tininessbefore, -tininessafter 29 1.1 bjh21 Function Sets 30 1.1 bjh21 31 1.1 bjh21 32 1.1 bjh21 33 1.1 bjh21 ------------------------------------------------------------------------------- 34 1.1 bjh21 Legal Notice 35 1.1 bjh21 36 1.1 bjh21 The `timesoftfloat' program was written by John R. Hauser. 37 1.1 bjh21 38 1.1 bjh21 THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort 39 1.1 bjh21 has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT 40 1.1 bjh21 TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO 41 1.1 bjh21 PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY 42 1.1 bjh21 AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. 43 1.1 bjh21 44 1.1 bjh21 45 1.1 bjh21 ------------------------------------------------------------------------------- 46 1.1 bjh21 Executing `timesoftfloat' 47 1.1 bjh21 48 1.1 bjh21 The `timesoftfloat' program is intended to be invoked from a command line 49 1.1 bjh21 interpreter as follows: 50 1.1 bjh21 51 1.1 bjh21 timesoftfloat [<option>...] <function> 52 1.1 bjh21 53 1.1 bjh21 Here square brackets ([]) indicate optional items, while angled brackets 54 1.1 bjh21 (<>) denote parameters to be filled in. The `<function>' argument is 55 1.1 bjh21 the name of the SoftFloat routine to evaluate, such as `float32_add' or 56 1.1 bjh21 `float64_to_int32'. The allowed options are detailed in the next section, 57 1.1 bjh21 _Options_. If `timesoftfloat' is executed without any arguments, a summary 58 1.1 bjh21 of usage is written. It is also possible to evaluate all machine functions 59 1.1 bjh21 in a single invocation as explained in the section _Function_Sets_ later in 60 1.1 bjh21 this document. 61 1.1 bjh21 62 1.2 msaitoh Ordinarily, a function's speed will be evaluated separately for each of 63 1.1 bjh21 the four rounding modes, one after the other. If the rounding mode is not 64 1.1 bjh21 supposed to have any affect on the results of a function--for instance, 65 1.1 bjh21 some operations do not require rounding--only the nearest/even rounding mode 66 1.1 bjh21 is timed. In the same way, if a function is affected by the way in which 67 1.1 bjh21 underflow tininess is detected, `timesoftfloat' times the function both with 68 1.1 bjh21 tininess detected before rounding and after rounding. For extended double- 69 1.1 bjh21 precision operations affected by rounding precision control, `timesoftfloat' 70 1.1 bjh21 also times the function for all three rounding precision modes, one after 71 1.1 bjh21 the other. Evaluation of a function can be limited to a single rounding 72 1.1 bjh21 mode, a single tininess mode, and/or a single rounding precision with 73 1.1 bjh21 appropriate options (see _Options_). 74 1.1 bjh21 75 1.1 bjh21 For each function and mode evaluated, `timesoftfloat' reports the speed of 76 1.1 bjh21 the function in kops/s, or ``thousands of operations per second''. This 77 1.1 bjh21 unit of measure differs from the traditional MFLOPS (``millions of floating- 78 1.1 bjh21 point operations per second'') only in being a factor of 1000 smaller. 79 1.1 bjh21 (1000 kops/s is exactly 1 MFLOPS.) Speeds are reported in thousands instead 80 1.1 bjh21 of millions because software floating-point often executes at less than 81 1.1 bjh21 1 MFLOPS. 82 1.1 bjh21 83 1.1 bjh21 The speeds reported by `timesoftfloat' may be affected somewhat by other 84 1.1 bjh21 programs executing at the same time as `timesoftfloat'. 85 1.1 bjh21 86 1.1 bjh21 Note that the remainder operations (`float32_rem', `float64_rem', 87 1.1 bjh21 `floatx80_rem' and `float128_rem') will be markedly slower than other 88 1.1 bjh21 operations, particularly for extended double precision (`floatx80') and 89 1.1 bjh21 quadruple precision (`float128'). This is inherent to the remainder 90 1.1 bjh21 function itself and is not a failing of the SoftFloat implementation. 91 1.1 bjh21 92 1.1 bjh21 93 1.1 bjh21 ------------------------------------------------------------------------------- 94 1.1 bjh21 Options 95 1.1 bjh21 96 1.1 bjh21 The `timesoftfloat' program accepts several command options. If mutually 97 1.1 bjh21 contradictory options are given, the last one has priority. 98 1.1 bjh21 99 1.1 bjh21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 100 1.1 bjh21 -help 101 1.1 bjh21 102 1.1 bjh21 The `-help' option causes a summary of program usage to be written, after 103 1.1 bjh21 which the program exits. 104 1.1 bjh21 105 1.1 bjh21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 106 1.1 bjh21 -precision32, -precision64, -precision80 107 1.1 bjh21 108 1.1 bjh21 For extended double-precision functions affected by rounding precision 109 1.1 bjh21 control, the `-precision32' option restricts evaluation to only the cases 110 1.1 bjh21 in which rounding precision is equivalent to single precision. The other 111 1.1 bjh21 rounding precision options are not timed. Likewise, the `-precision64' 112 1.1 bjh21 and `-precision80' options fix the rounding precision equivalent to double 113 1.1 bjh21 precision or extended double precision, respectively. These options are 114 1.1 bjh21 ignored for functions not affected by rounding precision control. 115 1.1 bjh21 116 1.1 bjh21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 117 1.1 bjh21 -nearesteven, -tozero, -down, -up 118 1.1 bjh21 119 1.1 bjh21 The `-nearesteven' option restricts evaluation to only the cases in which 120 1.1 bjh21 the rounding mode is nearest/even. The other rounding mode options are not 121 1.1 bjh21 timed. Likewise, `-tozero' forces rounding to zero; `-down' forces rounding 122 1.1 bjh21 down; and `-up' forces rounding up. These options are ignored for functions 123 1.1 bjh21 that are exact and thus do not round. 124 1.1 bjh21 125 1.1 bjh21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 126 1.1 bjh21 -tininessbefore, -tininessafter 127 1.1 bjh21 128 1.1 bjh21 The `-tininessbefore' option restricts evaluation to only the cases 129 1.1 bjh21 detecting underflow tininess before rounding. Tininess after rounding 130 1.1 bjh21 is not timed. Likewise, `-tininessafter' forces underflow tininess to be 131 1.1 bjh21 detected after rounding only. These options are ignored for functions not 132 1.1 bjh21 affected by the way in which underflow tininess is detected. 133 1.1 bjh21 134 1.1 bjh21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 135 1.1 bjh21 136 1.1 bjh21 137 1.1 bjh21 ------------------------------------------------------------------------------- 138 1.1 bjh21 Function Sets 139 1.1 bjh21 140 1.1 bjh21 Just as `timesoftfloat' can test an operation for all four rounding modes in 141 1.1 bjh21 sequence, multiple operations can also be tested with a single invocation. 142 1.1 bjh21 Three sets are recognized: `-all1', `-all2', and `-all'. The set `-all1' 143 1.1 bjh21 comprises all one-operand functions; `-all2' is all two-operand functions; 144 1.1 bjh21 and `-all' is all functions. A function set can be used in place of a 145 1.1 bjh21 function name in the command line, as in 146 1.1 bjh21 147 1.1 bjh21 timesoftfloat [<option>...] -all 148 1.1 bjh21 149 1.1 bjh21 150