//===----------------------------------------------------------------------===//
#include "llvm/Support/ScaledNumber.h"
-
#include "llvm/ADT/APFloat.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::ScaledNumbers;
int Shift = 63 - (NewE - E);
assert(Shift <= LeadingZeros);
assert(Shift == LeadingZeros || NewE == ScaledNumbers::MaxScale);
+ assert(Shift >= 0 && Shift < 64 && "undefined behavior");
D <<= Shift;
E = NewE;
} else if (E > -64) {
Above0 = D >> -E;
Below0 = D << (64 + E);
+ } else if (E == -64) {
+ // Special case: shift by 64 bits is undefined behavior.
+ Below0 = D;
} else if (E > -120) {
Below0 = D >> (-E - 64);
Extra = D << (128 + E);