VirtualBox

source: vbox/trunk/src/libs/softfloat-3e/testfloat/doc/timesoftfloat.html@ 102455

Last change on this file since 102455 was 94551, checked in by vboxsync, 3 years ago

libs/softfloat: Copied TestFloat-3e from vendor branch and to testfloat subdir. bugref:9898

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette