]> granicus.if.org Git - llvm/commit
[APFloat] Switch from (PPCDoubleDoubleImpl, IEEEdouble) layout to (IEEEdouble, IEEEdo...
authorTim Shen <timshen91@gmail.com>
Mon, 23 Jan 2017 22:39:35 +0000 (22:39 +0000)
committerTim Shen <timshen91@gmail.com>
Mon, 23 Jan 2017 22:39:35 +0000 (22:39 +0000)
commit207a20dda4d5fa14a07063a97b2e69006f5e367c
treee9b3bce6a0a02858bfca4e5464f5d377e9302b05
parentf3a691f0b081077b13e8d462f841aaaf58d20211
[APFloat] Switch from (PPCDoubleDoubleImpl, IEEEdouble) layout to (IEEEdouble, IEEEdouble)

Summary:
This patch changes the layout of DoubleAPFloat, and adjust all
operations to do either:
1) (IEEEdouble, IEEEdouble) -> (uint64_t, uint64_t) -> PPCDoubleDoubleImpl,
   then run the old algorithm.
2) Do the right thing directly.

1) includes multiply, divide, remainder, mod, fusedMultiplyAdd, roundToIntegral,
   convertFromString, next, convertToInteger, convertFromAPInt,
   convertFromSignExtendedInteger, convertFromZeroExtendedInteger,
   convertToHexString, toString, getExactInverse.
2) includes makeZero, makeLargest, makeSmallest, makeSmallestNormalized,
   compare, bitwiseIsEqual, bitcastToAPInt, isDenormal, isSmallest,
   isLargest, isInteger, ilogb, scalbn, frexp, hash_value, Profile.

I could split this into two patches, e.g. use
1) for all operatoins first, then incrementally change some of them to
2). I didn't do that, because 1) involves code that converts data between
PPCDoubleDoubleImpl and (IEEEdouble, IEEEdouble) back and forth, and may
pessimize the compiler. Instead, I find easy functions and use
approach 2) for them directly.

Next step is to implement move multiply and divide from 1) to 2). I don't
have plans for other functions in 1).

Differential Revision: https://reviews.llvm.org/D27872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292839 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/APFloat.h
lib/Support/APFloat.cpp
test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll
unittests/ADT/APFloatTest.cpp