real.cpp
17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
#include "fp-testing.h"
#include "testing.h"
#include "flang/Evaluate/type.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <type_traits>
using namespace Fortran::evaluate;
using namespace Fortran::common;
using Real2 = Scalar<Type<TypeCategory::Real, 2>>;
using Real3 = Scalar<Type<TypeCategory::Real, 3>>;
using Real4 = Scalar<Type<TypeCategory::Real, 4>>;
using Real8 = Scalar<Type<TypeCategory::Real, 8>>;
using Real10 = Scalar<Type<TypeCategory::Real, 10>>;
using Real16 = Scalar<Type<TypeCategory::Real, 16>>;
using Integer4 = Scalar<Type<TypeCategory::Integer, 4>>;
using Integer8 = Scalar<Type<TypeCategory::Integer, 8>>;
void dumpTest() {
struct {
std::uint64_t raw;
const char *expected;
} table[] = {
{0x7f876543, "NaN 0x7f876543"},
{0x7f800000, "Inf"},
{0xff800000, "-Inf"},
{0x00000000, "0.0"},
{0x80000000, "-0.0"},
{0x3f800000, "0x1.0p0"},
{0xbf800000, "-0x1.0p0"},
{0x40000000, "0x1.0p1"},
{0x3f000000, "0x1.0p-1"},
{0x7f7fffff, "0x1.fffffep127"},
{0x00800000, "0x1.0p-126"},
{0x00400000, "0x0.8p-127"},
{0x00000001, "0x0.000002p-127"},
{0, nullptr},
};
for (int j{0}; table[j].expected != nullptr; ++j) {
TEST(Real4{Integer4{table[j].raw}}.DumpHexadecimal() == table[j].expected)
("%d", j);
}
}
template <typename R> void basicTests(int rm, Rounding rounding) {
static constexpr int kind{R::bits / 8};
char desc[64];
using Word = typename R::Word;
std::snprintf(desc, sizeof desc, "bits=%d, le=%d, kind=%d", R::bits,
Word::littleEndian, kind);
R zero;
TEST(!zero.IsNegative())(desc);
TEST(!zero.IsNotANumber())(desc);
TEST(!zero.IsInfinite())(desc);
TEST(zero.IsZero())(desc);
MATCH(0, zero.Exponent())(desc);
TEST(zero.RawBits().IsZero())(desc);
MATCH(0, zero.RawBits().ToUInt64())(desc);
TEST(zero.ABS().RawBits().IsZero())(desc);
TEST(zero.Negate().RawBits().IEOR(Word::MASKL(1)).IsZero())(desc);
TEST(zero.Compare(zero) == Relation::Equal)(desc);
R minusZero{Word{std::uint64_t{1}}.SHIFTL(R::bits - 1)};
TEST(minusZero.IsNegative())(desc);
TEST(!minusZero.IsNotANumber())(desc);
TEST(!minusZero.IsInfinite())(desc);
TEST(minusZero.IsZero())(desc);
TEST(minusZero.ABS().RawBits().IsZero())(desc);
TEST(minusZero.Negate().RawBits().IsZero())(desc);
MATCH(0, minusZero.Exponent())(desc);
MATCH(0, minusZero.RawBits().LEADZ())(desc);
MATCH(1, minusZero.RawBits().POPCNT())(desc);
TEST(minusZero.Compare(minusZero) == Relation::Equal)(desc);
TEST(zero.Compare(minusZero) == Relation::Equal)(desc);
ValueWithRealFlags<R> vr;
MATCH(0, vr.value.RawBits().ToUInt64())(desc);
TEST(vr.flags.empty())(desc);
R nan{Word{std::uint64_t{1}}
.SHIFTL(R::bits)
.SubtractSigned(Word{std::uint64_t{1}})
.value};
MATCH(R::bits, nan.RawBits().POPCNT())(desc);
TEST(!nan.IsNegative())(desc);
TEST(nan.IsNotANumber())(desc);
TEST(!nan.IsInfinite())(desc);
TEST(!nan.IsZero())(desc);
TEST(zero.Compare(nan) == Relation::Unordered)(desc);
TEST(minusZero.Compare(nan) == Relation::Unordered)(desc);
TEST(nan.Compare(zero) == Relation::Unordered)(desc);
TEST(nan.Compare(minusZero) == Relation::Unordered)(desc);
TEST(nan.Compare(nan) == Relation::Unordered)(desc);
int significandBits{R::binaryPrecision - R::isImplicitMSB};
int exponentBits{R::bits - significandBits - 1};
std::uint64_t maxExponent{(std::uint64_t{1} << exponentBits) - 1};
MATCH(nan.Exponent(), maxExponent)(desc);
R inf{Word{maxExponent}.SHIFTL(significandBits)};
TEST(!inf.IsNegative())(desc);
TEST(!inf.IsNotANumber())(desc);
TEST(inf.IsInfinite())(desc);
TEST(!inf.IsZero())(desc);
TEST(inf.RawBits().CompareUnsigned(inf.ABS().RawBits()) == Ordering::Equal)
(desc);
TEST(zero.Compare(inf) == Relation::Less)(desc);
TEST(minusZero.Compare(inf) == Relation::Less)(desc);
TEST(nan.Compare(inf) == Relation::Unordered)(desc);
TEST(inf.Compare(inf) == Relation::Equal)(desc);
R negInf{Word{maxExponent}.SHIFTL(significandBits).IOR(Word::MASKL(1))};
TEST(negInf.IsNegative())(desc);
TEST(!negInf.IsNotANumber())(desc);
TEST(negInf.IsInfinite())(desc);
TEST(!negInf.IsZero())(desc);
TEST(inf.RawBits().CompareUnsigned(negInf.ABS().RawBits()) == Ordering::Equal)
(desc);
TEST(inf.RawBits().CompareUnsigned(negInf.Negate().RawBits()) ==
Ordering::Equal)
(desc);
TEST(inf.Negate().RawBits().CompareUnsigned(negInf.RawBits()) ==
Ordering::Equal)
(desc);
TEST(zero.Compare(negInf) == Relation::Greater)(desc);
TEST(minusZero.Compare(negInf) == Relation::Greater)(desc);
TEST(nan.Compare(negInf) == Relation::Unordered)(desc);
TEST(inf.Compare(negInf) == Relation::Greater)(desc);
TEST(negInf.Compare(negInf) == Relation::Equal)(desc);
for (std::uint64_t j{0}; j < 63; ++j) {
char ldesc[128];
std::uint64_t x{1};
x <<= j;
std::snprintf(ldesc, sizeof ldesc, "%s j=%d x=0x%jx rm=%d", desc,
static_cast<int>(j), static_cast<std::intmax_t>(x), rm);
Integer8 ix{x};
TEST(!ix.IsNegative())(ldesc);
MATCH(x, ix.ToUInt64())(ldesc);
vr = R::FromInteger(ix, rounding);
TEST(!vr.value.IsNegative())(ldesc);
TEST(!vr.value.IsNotANumber())(ldesc);
TEST(!vr.value.IsZero())(ldesc);
auto ivf = vr.value.template ToInteger<Integer8>();
if (j > (maxExponent / 2)) {
TEST(vr.flags.test(RealFlag::Overflow))(ldesc);
TEST(vr.value.IsInfinite())(ldesc);
TEST(ivf.flags.test(RealFlag::Overflow))(ldesc);
MATCH(0x7fffffffffffffff, ivf.value.ToUInt64())(ldesc);
} else {
TEST(vr.flags.empty())(ldesc);
TEST(!vr.value.IsInfinite())(ldesc);
TEST(ivf.flags.empty())(ldesc);
MATCH(x, ivf.value.ToUInt64())(ldesc);
if (rounding.mode == RoundingMode::TiesToEven) { // to match stold()
std::string buf;
llvm::raw_string_ostream ss{buf};
vr.value.AsFortran(ss, kind, false /*exact*/);
std::string decimal{ss.str()};
const char *p{decimal.data()};
MATCH(x, static_cast<std::uint64_t>(std::stold(decimal)))
("%s %s", ldesc, p);
auto check{R::Read(p, rounding)};
auto icheck{check.value.template ToInteger<Integer8>()};
MATCH(x, icheck.value.ToUInt64())(ldesc);
TEST(vr.value.Compare(check.value) == Relation::Equal)(ldesc);
}
}
TEST(vr.value.ToWholeNumber().value.Compare(vr.value) == Relation::Equal)
(ldesc);
ix = ix.Negate().value;
TEST(ix.IsNegative())(ldesc);
x = -x;
std::int64_t nx = x;
MATCH(x, ix.ToUInt64())(ldesc);
MATCH(nx, ix.ToInt64())(ldesc);
vr = R::FromInteger(ix);
TEST(vr.value.IsNegative())(ldesc);
TEST(!vr.value.IsNotANumber())(ldesc);
TEST(!vr.value.IsZero())(ldesc);
ivf = vr.value.template ToInteger<Integer8>();
if (j > (maxExponent / 2)) {
TEST(vr.flags.test(RealFlag::Overflow))(ldesc);
TEST(vr.value.IsInfinite())(ldesc);
TEST(ivf.flags.test(RealFlag::Overflow))(ldesc);
MATCH(0x8000000000000000, ivf.value.ToUInt64())(ldesc);
} else {
TEST(vr.flags.empty())(ldesc);
TEST(!vr.value.IsInfinite())(ldesc);
TEST(ivf.flags.empty())(ldesc);
MATCH(x, ivf.value.ToUInt64())(ldesc);
MATCH(nx, ivf.value.ToInt64())(ldesc);
}
TEST(vr.value.ToWholeNumber().value.Compare(vr.value) == Relation::Equal)
(ldesc);
}
}
// Takes an integer and distributes its bits across a floating
// point value. The LSB is used to complement the result.
std::uint32_t MakeReal(std::uint32_t n) {
int shifts[] = {-1, 31, 23, 30, 22, 0, 24, 29, 25, 28, 26, 1, 16, 21, 2, -1};
std::uint32_t x{0};
for (int j{1}; shifts[j] >= 0; ++j) {
x |= ((n >> j) & 1) << shifts[j];
}
x ^= -(n & 1);
return x;
}
std::uint64_t MakeReal(std::uint64_t n) {
int shifts[] = {
-1, 63, 52, 62, 51, 0, 53, 61, 54, 60, 55, 59, 1, 16, 50, 2, -1};
std::uint64_t x{0};
for (int j{1}; shifts[j] >= 0; ++j) {
x |= ((n >> j) & 1) << shifts[j];
}
x ^= -(n & 1);
return x;
}
inline bool IsNaN(std::uint32_t x) {
return (x & 0x7f800000) == 0x7f800000 && (x & 0x007fffff) != 0;
}
inline bool IsNaN(std::uint64_t x) {
return (x & 0x7ff0000000000000) == 0x7ff0000000000000 &&
(x & 0x000fffffffffffff) != 0;
}
inline bool IsInfinite(std::uint32_t x) {
return (x & 0x7fffffff) == 0x7f800000;
}
inline bool IsInfinite(std::uint64_t x) {
return (x & 0x7fffffffffffffff) == 0x7ff0000000000000;
}
inline bool IsNegative(std::uint32_t x) { return (x & 0x80000000) != 0; }
inline bool IsNegative(std::uint64_t x) {
return (x & 0x8000000000000000) != 0;
}
inline std::uint32_t NormalizeNaN(std::uint32_t x) {
if (IsNaN(x)) {
x = 0x7fe00000;
}
return x;
}
inline std::uint64_t NormalizeNaN(std::uint64_t x) {
if (IsNaN(x)) {
x = 0x7ffc000000000000;
}
return x;
}
enum FlagBits {
Overflow = 1,
DivideByZero = 2,
InvalidArgument = 4,
Underflow = 8,
Inexact = 16,
};
#ifdef __clang__
// clang support for fenv.h is broken, so tests of flag settings
// are disabled.
inline std::uint32_t FlagsToBits(const RealFlags &) { return 0; }
#else
inline std::uint32_t FlagsToBits(const RealFlags &flags) {
std::uint32_t bits{0};
if (flags.test(RealFlag::Overflow)) {
bits |= Overflow;
}
if (flags.test(RealFlag::DivideByZero)) {
bits |= DivideByZero;
}
if (flags.test(RealFlag::InvalidArgument)) {
bits |= InvalidArgument;
}
if (flags.test(RealFlag::Underflow)) {
bits |= Underflow;
}
if (flags.test(RealFlag::Inexact)) {
bits |= Inexact;
}
return bits;
}
#endif // __clang__
template <typename UINT = std::uint32_t, typename FLT = float, typename REAL>
void inttest(std::int64_t x, int pass, Rounding rounding) {
union {
UINT ui;
FLT f;
} u;
ScopedHostFloatingPointEnvironment fpenv;
Integer8 ix{x};
ValueWithRealFlags<REAL> real;
real = real.value.FromInteger(ix, rounding);
#ifndef __clang__ // broken and also slow
fpenv.ClearFlags();
#endif
FLT fcheck = x; // TODO unsigned too
auto actualFlags{FlagsToBits(fpenv.CurrentFlags())};
u.f = fcheck;
UINT rcheck{NormalizeNaN(u.ui)};
UINT check = real.value.RawBits().ToUInt64();
MATCH(rcheck, check)("%d 0x%llx", pass, x);
MATCH(actualFlags, FlagsToBits(real.flags))("%d 0x%llx", pass, x);
}
template <typename FLT = float> FLT ToIntPower(FLT x, int power) {
if (power == 0) {
return x / x;
}
bool negative{power < 0};
if (negative) {
power = -power;
}
FLT result{1};
while (power > 0) {
if (power & 1) {
result *= x;
}
x *= x;
power >>= 1;
}
if (negative) {
result = 1.0 / result;
}
return result;
}
template <typename FLT, int decimalDigits>
FLT TimesIntPowerOfTen(FLT x, int power) {
if (power > decimalDigits || power < -decimalDigits) {
auto maxExactPowerOfTen{
TimesIntPowerOfTen<FLT, decimalDigits>(1, decimalDigits)};
auto big{ToIntPower<FLT>(maxExactPowerOfTen, power / decimalDigits)};
auto small{
TimesIntPowerOfTen<FLT, decimalDigits>(1, power % decimalDigits)};
return (x * big) * small;
}
return x * ToIntPower<FLT>(10.0, power);
}
template <typename UINT = std::uint32_t, typename FLT = float,
typename REAL = Real4>
void subsetTests(int pass, Rounding rounding, std::uint32_t opds) {
for (int j{0}; j < 63; ++j) {
std::int64_t x{1};
x <<= j;
inttest<UINT, FLT, REAL>(x, pass, rounding);
inttest<UINT, FLT, REAL>(-x, pass, rounding);
}
inttest<UINT, FLT, REAL>(0, pass, rounding);
inttest<UINT, FLT, REAL>(
static_cast<std::int64_t>(0x8000000000000000), pass, rounding);
union {
UINT ui;
FLT f;
} u;
ScopedHostFloatingPointEnvironment fpenv;
for (UINT j{0}; j < opds; ++j) {
UINT rj{MakeReal(j)};
u.ui = rj;
FLT fj{u.f};
REAL x{typename REAL::Word{std::uint64_t{rj}}};
// unary operations
{
ValueWithRealFlags<REAL> aint{x.ToWholeNumber()};
#ifndef __clang__ // broken and also slow
fpenv.ClearFlags();
#endif
FLT fcheck{std::trunc(fj)};
auto actualFlags{FlagsToBits(fpenv.CurrentFlags())};
actualFlags &= ~Inexact; // x86 std::trunc can set Inexact; AINT ain't
u.f = fcheck;
#ifndef __clang__
if (IsNaN(u.ui)) {
actualFlags |= InvalidArgument; // x86 std::trunc(NaN) workaround
}
#endif
UINT rcheck{NormalizeNaN(u.ui)};
UINT check = aint.value.RawBits().ToUInt64();
MATCH(rcheck, check)
("%d AINT(0x%jx)", pass, static_cast<std::intmax_t>(rj));
MATCH(actualFlags, FlagsToBits(aint.flags))
("%d AINT(0x%jx)", pass, static_cast<std::intmax_t>(rj));
}
{
MATCH(IsNaN(rj), x.IsNotANumber())
("%d IsNaN(0x%jx)", pass, static_cast<std::intmax_t>(rj));
MATCH(IsInfinite(rj), x.IsInfinite())
("%d IsInfinite(0x%jx)", pass, static_cast<std::intmax_t>(rj));
static constexpr int kind{REAL::bits / 8};
std::string ssBuf, cssBuf;
llvm::raw_string_ostream ss{ssBuf};
llvm::raw_string_ostream css{cssBuf};
x.AsFortran(ss, kind, false /*exact*/);
std::string s{ss.str()};
if (IsNaN(rj)) {
css << "(0._" << kind << "/0.)";
MATCH(css.str(), s)
("%d invalid(0x%jx)", pass, static_cast<std::intmax_t>(rj));
} else if (IsInfinite(rj)) {
css << '(';
if (IsNegative(rj)) {
css << '-';
}
css << "1._" << kind << "/0.)";
MATCH(css.str(), s)
("%d overflow(0x%jx)", pass, static_cast<std::intmax_t>(rj));
} else {
const char *p = s.data();
if (*p == '(') {
++p;
}
auto readBack{REAL::Read(p, rounding)};
MATCH(rj, readBack.value.RawBits().ToUInt64())
("%d Read(AsFortran()) 0x%jx %s %g", pass,
static_cast<std::intmax_t>(rj), s.data(), static_cast<double>(fj));
MATCH('_', *p)
("%d Read(AsFortran()) 0x%jx %s %d", pass,
static_cast<std::intmax_t>(rj), s.data(),
static_cast<int>(p - s.data()));
}
}
// dyadic operations
for (UINT k{0}; k < opds; ++k) {
UINT rk{MakeReal(k)};
u.ui = rk;
FLT fk{u.f};
REAL y{typename REAL::Word{std::uint64_t{rk}}};
{
ValueWithRealFlags<REAL> sum{x.Add(y, rounding)};
#ifndef __clang__ // broken and also slow
fpenv.ClearFlags();
#endif
FLT fcheck{fj + fk};
auto actualFlags{FlagsToBits(fpenv.CurrentFlags())};
u.f = fcheck;
UINT rcheck{NormalizeNaN(u.ui)};
UINT check = sum.value.RawBits().ToUInt64();
MATCH(rcheck, check)
("%d 0x%jx + 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
MATCH(actualFlags, FlagsToBits(sum.flags))
("%d 0x%jx + 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
}
{
ValueWithRealFlags<REAL> diff{x.Subtract(y, rounding)};
#ifndef __clang__ // broken and also slow
fpenv.ClearFlags();
#endif
FLT fcheck{fj - fk};
auto actualFlags{FlagsToBits(fpenv.CurrentFlags())};
u.f = fcheck;
UINT rcheck{NormalizeNaN(u.ui)};
UINT check = diff.value.RawBits().ToUInt64();
MATCH(rcheck, check)
("%d 0x%jx - 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
MATCH(actualFlags, FlagsToBits(diff.flags))
("%d 0x%jx - 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
}
{
ValueWithRealFlags<REAL> prod{x.Multiply(y, rounding)};
#ifndef __clang__ // broken and also slow
fpenv.ClearFlags();
#endif
FLT fcheck{fj * fk};
auto actualFlags{FlagsToBits(fpenv.CurrentFlags())};
u.f = fcheck;
UINT rcheck{NormalizeNaN(u.ui)};
UINT check = prod.value.RawBits().ToUInt64();
MATCH(rcheck, check)
("%d 0x%jx * 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
MATCH(actualFlags, FlagsToBits(prod.flags))
("%d 0x%jx * 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
}
{
ValueWithRealFlags<REAL> quot{x.Divide(y, rounding)};
#ifndef __clang__ // broken and also slow
fpenv.ClearFlags();
#endif
FLT fcheck{fj / fk};
auto actualFlags{FlagsToBits(fpenv.CurrentFlags())};
u.f = fcheck;
UINT rcheck{NormalizeNaN(u.ui)};
UINT check = quot.value.RawBits().ToUInt64();
MATCH(rcheck, check)
("%d 0x%jx / 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
MATCH(actualFlags, FlagsToBits(quot.flags))
("%d 0x%jx / 0x%jx", pass, static_cast<std::intmax_t>(rj),
static_cast<std::intmax_t>(rk));
}
}
}
}
void roundTest(int rm, Rounding rounding, std::uint32_t opds) {
basicTests<Real2>(rm, rounding);
basicTests<Real3>(rm, rounding);
basicTests<Real4>(rm, rounding);
basicTests<Real8>(rm, rounding);
basicTests<Real10>(rm, rounding);
basicTests<Real16>(rm, rounding);
ScopedHostFloatingPointEnvironment::SetRounding(rounding);
subsetTests<std::uint32_t, float, Real4>(rm, rounding, opds);
subsetTests<std::uint64_t, double, Real8>(rm, rounding, opds);
}
int main() {
dumpTest();
std::uint32_t opds{512}; // for quick testing by default
if (const char *p{std::getenv("REAL_TEST_OPERANDS")}) {
// Use 8192 or 16384 for more exhaustive testing.
opds = std::atol(p);
}
roundTest(0, Rounding{RoundingMode::TiesToEven}, opds);
roundTest(1, Rounding{RoundingMode::ToZero}, opds);
roundTest(2, Rounding{RoundingMode::Up}, opds);
roundTest(3, Rounding{RoundingMode::Down}, opds);
// TODO: how to test Rounding::TiesAwayFromZero on x86?
return testing::Complete();
}