[all-commits] [llvm/llvm-project] c162f0: [APFloat] convertToDouble/Float can work on shorte...

Serge Pavlov via All-commits all-commits at lists.llvm.org
Thu May 20 21:39:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c162f086ba632ffaedfe92d63bf21571bc8ae4da
      https://github.com/llvm/llvm-project/commit/c162f086ba632ffaedfe92d63bf21571bc8ae4da
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2021-05-21 (Fri, 21 May 2021)

  Changed paths:
    M llvm/include/llvm/ADT/APFloat.h
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/Core.cpp
    M llvm/lib/Support/APFloat.cpp
    M llvm/unittests/ADT/APFloatTest.cpp

  Log Message:
  -----------
  [APFloat] convertToDouble/Float can work on shorter types

Previously APFloat::convertToDouble may be called only for APFloats that
were built using double semantics. Other semantics like single precision
were not allowed although corresponding numbers could be converted to
double without loss of precision. The similar restriction applied to
APFloat::convertToFloat.

With this change any APFloat that can be precisely represented by double
can be handled with convertToDouble. Behavior of convertToFloat was
updated similarly. It make the conversion operations more convenient and
adds support for formats like half and bfloat.

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




More information about the All-commits mailing list