APFloat: allow 64-bit of payload
authorJF Bastien <jfbastien@apple.com>
Mon, 10 Dec 2018 19:27:38 +0000 (19:27 +0000)
committerJF Bastien <jfbastien@apple.com>
Mon, 10 Dec 2018 19:27:38 +0000 (19:27 +0000)
commit69f6098e89312b934ed87e4cd3603401a9b436b4
tree58af5357af19893d7f24253b6a419c888be8bf96
parentce2837f880a519d435be9e220b62c10b6361d798
APFloat: allow 64-bit of payload

Summary: The APFloat and Constant APIs taking an APInt allow arbitrary payloads,
and that's great. There's a convenience API which takes an unsigned, and that's
silly because it then directly creates a 64-bit APInt. Just change it to 64-bits
directly.

At the same time, add ConstantFP NaN getters which match the APFloat ones (with
getQNaN / getSNaN and APInt parameters).

Improve the APFloat testing to set more payload bits.

Reviewers: scanon, rjmccall

Subscribers: jkorous, dexonsmith, kristina, llvm-commits

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

llvm-svn: 348791
llvm/include/llvm/ADT/APFloat.h
llvm/include/llvm/IR/Constants.h
llvm/lib/IR/Constants.cpp
llvm/unittests/ADT/APFloatTest.cpp