2 ##########################################################################
7 # IeeeCC754 or IEEE 754 Compliance Checker is a precision and range #
8 # independent tool to test whether an implementation of #
9 # floating-point arithmetic (in hardware or software) is compliant #
10 # with the principles of the IEEE 754-854 floating-point standards. #
11 # You can find out more about the testing tool IeeeCC754 at #
13 # http://win-www.uia.ac.be/u/cant/ieeecc754.html #
15 # This tool is in parts based on and greatly benefited from the #
16 # the program FPTEST developed by Jerome Coonen. For a full #
17 # description of the extensions to FPTEST and a reference to #
18 # the original Coonen program, please refer to the URL given above. #
19 # For the options available with the program IeeeCC754 and its #
20 # compatibility with David Hough's hexadecimal UCB format, we #
21 # also refer to the file readme.usage. #
23 # Usage: see readme.usage #
25 # Responsible authors: #
30 # Johan Bogo (1998-1999) #
31 # Tim Gevers (10-12/2000) #
32 # Debby Ooms (1996-1997) #
33 # Geert Vermuyten (1996-1997) #
34 # Dennis Verschaeren (09/1996-06/2000) #
36 # Copyright (C) 2000 University of Antwerp #
38 # This program can be obtained from the authors, free, but WITHOUT ANY #
39 # WARRANTY; without even the implied warranty of MERCHANTABILITY or #
40 # FITNESS FOR A PARTICULAR PURPOSE. #
43 # Brigitte.Verdonk@uia.ua.ac.be #
44 # Department of Mathematics and Computer Science #
45 # University of Antwerp (UIA) #
46 # Universiteitsplein 1 #
47 # B2610 Antwerp, BELGIUM #
49 ##########################################################################
60 #include <DriverFloatRepr.h>
65 DriverFloatRepr DriverFloatRepr::operator + (DriverFloatRepr& fl)
67 void *res = alloca(::fc_get_buffer_length());
68 void *op1 = alloca(::fc_get_buffer_length());
69 void *op2 = alloca(::fc_get_buffer_length());
76 // cout << "op1 : " << endl << op1 << endl << flush;
77 // cout << "op2 : " << endl << op2 << endl << flush;
79 ::fc_add(op1, op2, res);
80 // cout << "res: " << res << endl << flush; // debug
83 DriverFloatRepr r(res);
86 DriverFloatRepr DriverFloatRepr::operator - (DriverFloatRepr &fl)
88 void *res = alloca(::fc_get_buffer_length());
89 void *op1 = alloca(::fc_get_buffer_length());
90 void *op2 = alloca(::fc_get_buffer_length());
97 // cout << "op1 : " << endl << op1 << endl << flush;
98 // cout << "op2 : " << endl << op2 << endl << flush;
99 ::fc_sub(op1, op2, res);
100 // cout << "res: " << res << endl << flush; // debug
103 DriverFloatRepr r(res);
107 DriverFloatRepr DriverFloatRepr::operator * (DriverFloatRepr &fl)
109 void *res = alloca(::fc_get_buffer_length());
110 void *op1 = alloca(::fc_get_buffer_length());
111 void *op2 = alloca(::fc_get_buffer_length());
118 // cout << "op1 : " << endl << op1 << endl << flush;
119 // cout << "op2 : " << endl << op2 << endl << flush;
120 ::fc_mul(op1, op2, res);
121 // cout << "res: " << res << endl << flush; // debug
124 DriverFloatRepr r(res);
128 DriverFloatRepr DriverFloatRepr::operator / (DriverFloatRepr &fl)
130 void *res = alloca(::fc_get_buffer_length());
131 void *op1 = alloca(::fc_get_buffer_length());
132 void *op2 = alloca(::fc_get_buffer_length());
139 // cout << "op1 : " << endl << op1 << endl << flush;
140 // cout << "op2 : " << endl << op2 << endl << flush;
141 ::fc_div(op1, op2, res);
142 // cout << "res: " << res << endl << flush; // debug
145 DriverFloatRepr r(res);
146 // DriverFloatRepr r(op1); // debug
151 DriverFloatRepr DriverFloatRepr::operator % (DriverFloatRepr &fl)
153 DriverFloatRepr r(0l);
157 DriverFloatRepr DriverFloatRepr::sqrt()
159 DriverFloatRepr r(0l);