summaryrefslogtreecommitdiff
path: root/src/classlibnative
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2018-09-17 09:45:13 -0700
committerTanner Gooding <tagoo@outlook.com>2018-09-20 13:12:46 -0700
commit6498dea67c7148accfea03b28e4168ed67627dff (patch)
treec3043cf58c0acfc9aa46f398baa492a3f2bb21d9 /src/classlibnative
parentad3d6f89ac8270e64c4a5bd15137041ab07225b7 (diff)
downloadcoreclr-6498dea67c7148accfea03b28e4168ed67627dff.tar.gz
coreclr-6498dea67c7148accfea03b28e4168ed67627dff.tar.bz2
coreclr-6498dea67c7148accfea03b28e4168ed67627dff.zip
Removing bcltype/fp.h from native code.
Diffstat (limited to 'src/classlibnative')
-rw-r--r--src/classlibnative/bcltype/fp.h67
-rw-r--r--src/classlibnative/bcltype/number.cpp1
2 files changed, 0 insertions, 68 deletions
diff --git a/src/classlibnative/bcltype/fp.h b/src/classlibnative/bcltype/fp.h
deleted file mode 100644
index 5a704db6e6..0000000000
--- a/src/classlibnative/bcltype/fp.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//
-// File: fp.h
-//
-
-//
-
-#ifndef _FP_H
-#define _FP_H
-
-#include <clrtypes.h>
-
-struct FPSINGLE {
- #if BIGENDIAN
- unsigned int sign: 1;
- unsigned int exp: 8;
- unsigned int mant: 23;
- #else
- unsigned int mant: 23;
- unsigned int exp: 8;
- unsigned int sign: 1;
- #endif
-};
-
-struct FPDOUBLE {
- #if BIGENDIAN
- unsigned int sign: 1;
- unsigned int exp: 11;
- unsigned int mantHi: 20;
- unsigned int mantLo;
- #else
- unsigned int mantLo;
- unsigned int mantHi: 20;
- unsigned int exp: 11;
- unsigned int sign: 1;
- #endif
-};
-
-static void ExtractFractionAndBiasedExponent(double value, UINT64* f, int* e)
-{
- if (((FPDOUBLE*)&value)->exp != 0)
- {
- // For normalized value, according to https://en.wikipedia.org/wiki/Double-precision_floating-point_format
- // value = 1.fraction * 2^(exp - 1023)
- // = (1 + mantissa / 2^52) * 2^(exp - 1023)
- // = (2^52 + mantissa) * 2^(exp - 1023 - 52)
- //
- // So f = (2^52 + mantissa), e = exp - 1075;
- *f = ((UINT64)(((FPDOUBLE*)&value)->mantHi) << 32) | ((FPDOUBLE*)&value)->mantLo + ((UINT64)1 << 52);
- *e = ((FPDOUBLE*)&value)->exp - 1075;
- }
- else
- {
- // For denormalized value, according to https://en.wikipedia.org/wiki/Double-precision_floating-point_format
- // value = 0.fraction * 2^(1 - 1023)
- // = (mantissa / 2^52) * 2^(-1022)
- // = mantissa * 2^(-1022 - 52)
- // = mantissa * 2^(-1074)
- // So f = mantissa, e = -1074
- *f = ((UINT64)(((FPDOUBLE*)&value)->mantHi) << 32) | ((FPDOUBLE*)&value)->mantLo;
- *e = -1074;
- }
-}
-
-#endif // _FP_H \ No newline at end of file
diff --git a/src/classlibnative/bcltype/number.cpp b/src/classlibnative/bcltype/number.cpp
index c1f7d66670..433a9182e4 100644
--- a/src/classlibnative/bcltype/number.cpp
+++ b/src/classlibnative/bcltype/number.cpp
@@ -9,7 +9,6 @@
#include "common.h"
#include "number.h"
-#include "fp.h"
typedef wchar_t wchar;