Chromium Code Reviews| Index: runtime/lib/double.cc |
| diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc |
| index 4173c1403d034ad917f12dea13d7f23cd2fc1f4b..e6f8596c022781352b1490979253e83c6097d0b6 100644 |
| --- a/runtime/lib/double.cc |
| +++ b/runtime/lib/double.cc |
| @@ -300,6 +300,16 @@ DEFINE_NATIVE_ENTRY(Double_getIsNegative, 1) { |
| return Bool::Get(signbit(dval) && !isnan(dval)).raw(); |
| } |
| + |
| +DEFINE_NATIVE_ENTRY(Double_flipSignBit, 1) { |
| + const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0)); |
| + const double in_val = arg.value(); |
| + const int64_t bits = |
| + *(reinterpret_cast<const int64_t*>(&in_val)) ^ kSignBitDouble; |
| + const double out_val = *(reinterpret_cast<const double*>(&bits)); |
| + return Double::New(out_val); |
|
Anders Johnsen
2015/06/03 06:37:36
I may have missed out here, but my experience tell
koda
2015/06/03 17:28:11
Even if the C++ standard would mandate the behavio
|
| +} |
| + |
| // Add here only functions using/referring to old-style casts. |
| } // namespace dart |