1 |
|
---|
2 | <HTML>
|
---|
3 |
|
---|
4 | <HEAD>
|
---|
5 | <TITLE>timesoftfloat</TITLE>
|
---|
6 | </HEAD>
|
---|
7 |
|
---|
8 | <BODY>
|
---|
9 |
|
---|
10 | <H1>Berkeley TestFloat Release 3e: <CODE>timesoftfloat</CODE></H1>
|
---|
11 |
|
---|
12 | <P>
|
---|
13 | John R. Hauser<BR>
|
---|
14 | 2018 January 20<BR>
|
---|
15 | </P>
|
---|
16 |
|
---|
17 |
|
---|
18 | <H2>Overview</H2>
|
---|
19 |
|
---|
20 | <P>
|
---|
21 | The <CODE>timesoftfloat</CODE> program provides a simple way to evaluate the
|
---|
22 | speed of the floating-point operations of the Berkeley SoftFloat library.
|
---|
23 | Program <CODE>timesoftfloat</CODE> is included with the Berkeley TestFloat
|
---|
24 | package, a small collection of programs for testing that an implementation of
|
---|
25 | floating-point conforms to the IEEE Standard for Binary Floating-Point
|
---|
26 | Arithmetic.
|
---|
27 | Although <CODE>timesoftfloat</CODE> does not test floating-point correctness
|
---|
28 | like the other TestFloat programs, nevertheless <CODE>timesoftfloat</CODE> is a
|
---|
29 | partner to TestFloat’s <CODE>testsoftfloat</CODE> program.
|
---|
30 | For more about TestFloat generally and <CODE>testsoftfloat</CODE> specifically,
|
---|
31 | see file
|
---|
32 | <A HREF="TestFloat-general.html"><NOBR><CODE>TestFloat-general.html</CODE></NOBR></A>.
|
---|
33 | </P>
|
---|
34 |
|
---|
35 | <P>
|
---|
36 | Ordinarily, <CODE>timesoftfloat</CODE> will measure a function’s speed
|
---|
37 | separately for each of the five rounding modes defined by the IEEE
|
---|
38 | Floating-Point Standard, one after the other, plus possibly a sixth mode,
|
---|
39 | <I>round to odd</I> (depending on the options selected when
|
---|
40 | <CODE>timesoftfloat</CODE> was compiled).
|
---|
41 | If an operation is not supposed to require rounding, it will by default be
|
---|
42 | timed only with the rounding mode set to <CODE>near_even</CODE> (nearest/even).
|
---|
43 | In the same way, if an operation is affected by the way in which underflow
|
---|
44 | tininess is detected, <CODE>timesoftfloat</CODE> times the function with
|
---|
45 | tininess detected both before rounding and after rounding.
|
---|
46 | For <NOBR>80-bit</NOBR> double-extended-precision operations affected by
|
---|
47 | rounding precision control, <CODE>timesoftfloat</CODE> also times the function
|
---|
48 | for each of the three rounding precision modes, one after the other.
|
---|
49 | Evaluation of a function can be limited to a single rounding mode, a single
|
---|
50 | tininess mode, and/or a single rounding precision with appropriate command-line
|
---|
51 | options.
|
---|
52 | </P>
|
---|
53 |
|
---|
54 | <P>
|
---|
55 | For each function and mode evaluated, <CODE>timesoftfloat</CODE> reports the
|
---|
56 | measured speed of the function in Mop/s, or “millions of operations per
|
---|
57 | second”.
|
---|
58 | The speeds reported by <CODE>timesoftfloat</CODE> may be affected somewhat by
|
---|
59 | other software executing at the same time as <CODE>timesoftfloat</CODE>.
|
---|
60 | Be aware also that the exact execution time of any SoftFloat function depends
|
---|
61 | partly on the values of arguments and the state of the processor’s caches
|
---|
62 | at the time the function is called.
|
---|
63 | Your actual experience with SoftFloat may differ from the speeds reported by
|
---|
64 | <CODE>timesoftfloat</CODE> for all these reasons.
|
---|
65 | </P>
|
---|
66 |
|
---|
67 | <P>
|
---|
68 | Note that the remainder operations for larger formats (<CODE>f64_rem</CODE>,
|
---|
69 | <CODE>extF80_rem</CODE>, and <CODE>f128_rem</CODE>) can be markedly slower than
|
---|
70 | other operations, particularly for double-extended-precision
|
---|
71 | (<CODE>extF80_rem</CODE>) and quadruple precision (<CODE>f128_rem</CODE>).
|
---|
72 | This is inherent to the remainder operation itself and is not a failing of the
|
---|
73 | SoftFloat implementation.
|
---|
74 | </P>
|
---|
75 |
|
---|
76 |
|
---|
77 | <H2>Command Syntax</H2>
|
---|
78 |
|
---|
79 | <P>
|
---|
80 | The <CODE>timesoftfloat</CODE> program is executed as a command with this
|
---|
81 | syntax:
|
---|
82 | <BLOCKQUOTE>
|
---|
83 | <PRE>
|
---|
84 | timesoftfloat [<<I>option</I>>...] <<I>function</I>>
|
---|
85 | </PRE>
|
---|
86 | </BLOCKQUOTE>
|
---|
87 | Square brackets (<CODE>[ ]</CODE>) denote optional arguments,
|
---|
88 | <CODE><<I>option</I>></CODE> is a supported option, and
|
---|
89 | <CODE><<I>function</I>></CODE> is the name of either a testable function
|
---|
90 | or a function set.
|
---|
91 | The available options and function sets are documented below.
|
---|
92 | If <CODE>timesoftfloat</CODE> is executed without any arguments, a summary of
|
---|
93 | usage is written.
|
---|
94 | </P>
|
---|
95 |
|
---|
96 |
|
---|
97 | <H2>Options</H2>
|
---|
98 |
|
---|
99 | <P>
|
---|
100 | The <CODE>timesoftfloat</CODE> program accepts several command options.
|
---|
101 | If mutually contradictory options are given, the last one has priority.
|
---|
102 | </P>
|
---|
103 |
|
---|
104 | <H3><CODE>-help</CODE></H3>
|
---|
105 |
|
---|
106 | <P>
|
---|
107 | The <CODE>-help</CODE> option causes a summary of program usage to be written,
|
---|
108 | after which the program exits.
|
---|
109 | </P>
|
---|
110 |
|
---|
111 | <H3><CODE>-precision32, -precision64, -precision80</CODE></H3>
|
---|
112 |
|
---|
113 | <P>
|
---|
114 | For <NOBR>80-bit</NOBR> double-extended-precision funcions affected by
|
---|
115 | rounding precision control, the <CODE>-precision32</CODE> option restricts
|
---|
116 | timing of an operation to only the cases in which the rounding precision is
|
---|
117 | <NOBR>32 bits</NOBR>, equivalent to <NOBR>32-bit</NOBR> single-precision.
|
---|
118 | Other rounding precision choices are not timed.
|
---|
119 | Likewise, <CODE>-precision64</CODE> fixes the rounding precision to
|
---|
120 | <NOBR>64 bits</NOBR>, equivalent to <NOBR>64-bit</NOBR> double-precision;
|
---|
121 | and <CODE>-precision80</CODE> fixes the rounding precision to the full
|
---|
122 | <NOBR>80 bits</NOBR> of the double-extended-precision format.
|
---|
123 | All these options are ignored for operations not affected by rounding precision
|
---|
124 | control.
|
---|
125 | </P>
|
---|
126 |
|
---|
127 | <H3><CODE>-rnear_even, -rnear_maxMag, -rminMag, -rmin, -rmax, -rodd</CODE></H3>
|
---|
128 |
|
---|
129 | <P>
|
---|
130 | The <CODE>-rnear_even</CODE> option restricts timing of an operation to only
|
---|
131 | the cases in which the rounding mode is nearest/even.
|
---|
132 | Other rounding mode choices are not timed.
|
---|
133 | Likewise, <CODE>-rnear_maxMag</CODE> forces rounding to nearest/maximum
|
---|
134 | magnitude (nearest-away), <CODE>-rminMag</CODE> forces rounding to minimum
|
---|
135 | magnitude (toward zero), <CODE>-rmin</CODE> forces rounding to minimum (down,
|
---|
136 | toward negative infinity), <CODE>-rmax</CODE> forces rounding to maximum (up,
|
---|
137 | toward positive infinity), and <CODE>-rodd</CODE>, if supported, forces
|
---|
138 | rounding to odd.
|
---|
139 | These options are ignored for operations that are exact and thus do not round.
|
---|
140 | </P>
|
---|
141 |
|
---|
142 | <H3><CODE>-tininessbefore, -tininessafter</CODE></H3>
|
---|
143 |
|
---|
144 | <P>
|
---|
145 | The <CODE>-tininessbefore</CODE> option restricts timing of an operation to
|
---|
146 | only the cases in which tininess on underflow is detected before rounding.
|
---|
147 | Likewise, <CODE>-tininessafter</CODE> restricts measurement to only the cases
|
---|
148 | in which tininess on underflow is detected after rounding.
|
---|
149 | </P>
|
---|
150 |
|
---|
151 | <H3><CODE>-notexact, -exact</CODE></H3>
|
---|
152 |
|
---|
153 | <P>
|
---|
154 | For functions that round to an integer (conversions to integer types and the
|
---|
155 | <CODE>roundToInt</CODE> functions), the <CODE>-notexact</CODE> option restricts
|
---|
156 | timing of an operation to only the cases for which the
|
---|
157 | <CODE><I>exact</I></CODE> operand (specifying whether the <I>inexact</I>
|
---|
158 | exception flag may be raised) is <CODE>false</CODE>.
|
---|
159 | Likewise, the <CODE>-exact</CODE> option restricts measurement to only the
|
---|
160 | cases for which the <CODE><I>exact</I></CODE> operand is <CODE>true</CODE>.
|
---|
161 | </P>
|
---|
162 |
|
---|
163 |
|
---|
164 | <H2>Function Sets</H2>
|
---|
165 |
|
---|
166 | <P>
|
---|
167 | Just as <CODE>timesoftfloat</CODE> can time a function for all five or six
|
---|
168 | rounding modes in sequence, multiple functions can be timed with a single
|
---|
169 | execution of <CODE>timesoftfloat</CODE>.
|
---|
170 | Three sets are recognized:
|
---|
171 | <CODE>-all1</CODE>, <CODE>-all2</CODE>, and <CODE>-all</CODE>.
|
---|
172 | The set <CODE>-all1</CODE> is all one-operand operations, <CODE>-all2</CODE> is
|
---|
173 | all two-operand operations, and <CODE>-all</CODE> is obviously all operations.
|
---|
174 | A function set is used in place of a function name in the
|
---|
175 | <CODE>timesoftfloat</CODE> command line, such as
|
---|
176 | <BLOCKQUOTE>
|
---|
177 | <PRE>
|
---|
178 | timesoftfloat [<<I>option</I>>...] -all1
|
---|
179 | </PRE>
|
---|
180 | </BLOCKQUOTE>
|
---|
181 | </P>
|
---|
182 |
|
---|
183 | <P>
|
---|
184 | For the purpose of deciding the number of operands of an operation, any
|
---|
185 | <CODE><I>roundingMode</I></CODE> and <CODE><I>exact</I></CODE> arguments are
|
---|
186 | ignored.
|
---|
187 | (Such arguments specify the rounding mode and whether the <I>inexact</I>
|
---|
188 | exception flag may be raised, respectively.)
|
---|
189 | Thus, functions that convert to integer type and the <CODE>roundToInt</CODE>
|
---|
190 | functions are included in the set of one-operand operations timed by
|
---|
191 | <CODE>-all1</CODE>.
|
---|
192 | </P>
|
---|
193 |
|
---|
194 |
|
---|
195 | </BODY>
|
---|
196 |
|
---|