diff options
author | Sergey Kozub <skozub@nvidia.com> | 2024-10-22 19:15:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 19:15:29 +0200 |
commit | 7b308b18c3946dd0e09c661db52f70eff3fe8104 (patch) | |
tree | 7892869f3476f146698c7929158cb12b34968cab /llvm/unittests/ADT/APFloatTest.cpp | |
parent | 2fdf49db7562eadbe01b18f0d01a955cd41b94ea (diff) | |
download | llvm-7b308b18c3946dd0e09c661db52f70eff3fe8104.zip llvm-7b308b18c3946dd0e09c661db52f70eff3fe8104.tar.gz llvm-7b308b18c3946dd0e09c661db52f70eff3fe8104.tar.bz2 |
Fix bitcasting E8M0 APFloat to APInt (#113298)
Fixes a bug in APFloat handling of E8M0 type (zero mantissa).
Related PRs:
- https://github.com/llvm/llvm-project/pull/107127
- https://github.com/llvm/llvm-project/pull/111028
Diffstat (limited to 'llvm/unittests/ADT/APFloatTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/APFloatTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/APFloatTest.cpp b/llvm/unittests/ADT/APFloatTest.cpp index 665cff9..74aaf66 100644 --- a/llvm/unittests/ADT/APFloatTest.cpp +++ b/llvm/unittests/ADT/APFloatTest.cpp @@ -5985,6 +5985,9 @@ TEST(APFloatTest, Float8E8M0FNUExhaustive) { APFloat test(APFloat::Float8E8M0FNU(), APInt(8, i)); SCOPED_TRACE("i=" + std::to_string(i)); + // bitcastToAPInt + EXPECT_EQ(i, test.bitcastToAPInt()); + // isLargest if (i == 254) { EXPECT_TRUE(test.isLargest()); |