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