Revert "Update aosp/master libcxx rebase to r263688"

The world is burning.

This reverts commit c004fd909c, reversing
changes made to 1418e4163d.
This commit is contained in:
Dan Albert
2016-05-25 22:36:09 -07:00
parent c004fd909c
commit 1d4a1edbc7
1396 changed files with 11495 additions and 38952 deletions

View File

@@ -15,6 +15,7 @@
#ifndef HEXFLOAT_H
#define HEXFLOAT_H
#include <algorithm>
#include <cmath>
#include <climits>
@@ -22,26 +23,13 @@ template <class T>
class hexfloat
{
T value_;
static int CountLeadingZeros(unsigned long long n) {
const std::size_t Digits = sizeof(unsigned long long) * CHAR_BIT;
const unsigned long long TopBit = 1ull << (Digits - 1);
if (n == 0) return Digits;
int LeadingZeros = 0;
while ((n & TopBit) == 0) {
++LeadingZeros;
n <<= 1;
}
return LeadingZeros;
}
public:
hexfloat(long long m1, unsigned long long m0, int exp)
{
const std::size_t Digits = sizeof(unsigned long long) * CHAR_BIT;
const std::size_t n = sizeof(unsigned long long) * CHAR_BIT;
int s = m1 < 0 ? -1 : 1;
int exp2 = -static_cast<int>(Digits - CountLeadingZeros(m0)/4*4);
value_ = std::ldexp(m1 + s * std::ldexp(T(m0), exp2), exp);
value_ = std::ldexp(m1 + s * std::ldexp(T(m0), -static_cast<int>(n -
std::__clz(m0)/4*4)), exp);
}
operator T() const {return value_;}