[all-commits] [llvm/llvm-project] 0ff322: [flang] Fix float-number representation bug

PeixinQiao via All-commits all-commits at lists.llvm.org
Thu Apr 14 06:29:08 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ff322246bcd5c20fdda5e6d1215ee961db2abdc
      https://github.com/llvm/llvm-project/commit/0ff322246bcd5c20fdda5e6d1215ee961db2abdc
  Author: PeixinQiao <qiaopeixin at huawei.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M flang/lib/Evaluate/real.cpp
    A flang/test/Lower/Intrinsics/real.f90
    M flang/unittests/Evaluate/real.cpp

  Log Message:
  -----------
  [flang] Fix float-number representation bug

The float number is represented as (-1)^s * 1.f * 2^(-127) for 32-bit,
where s is the signed flag, f is the mantissa. When the exponent bits
are all zeros, the float number is represented as (-1)^s * 0.f *2^(-126)
for 32-bit, in which case, the intPart is '0'.

Reviewed By: Jean Perier

https://reviews.llvm.org/D123673




More information about the All-commits mailing list