[llvm] f45d5e7 - [APFloat] Set size of PPCDoubleDouble to 128

Qiu Chaofan via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 19:13:53 PDT 2021


Author: Qiu Chaofan
Date: 2021-10-09T10:12:10+08:00
New Revision: f45d5e71d3e1ef9d565815850681719418a99d19

URL: https://github.com/llvm/llvm-project/commit/f45d5e71d3e1ef9d565815850681719418a99d19
DIFF: https://github.com/llvm/llvm-project/commit/f45d5e71d3e1ef9d565815850681719418a99d19.diff

LOG: [APFloat] Set size of PPCDoubleDouble to 128

566690b0 uses size information in float semantics, but PPCDoubleDouble
left them empty.

As follow-up, we can consider remove PPCDoubleDoubleLegacy and fill
other fields in the future.

Reviewed By: foad

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

Added: 
    

Modified: 
    llvm/lib/Support/APFloat.cpp
    llvm/test/Transforms/InstCombine/bitcast-store.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index c456a5c86bada..4b75c9db85263 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -92,7 +92,7 @@ namespace llvm {
      Note: we need to make the value 
diff erent from semBogus as otherwise
      an unsafe optimization may collapse both values to a single address,
      and we heavily rely on them having distinct addresses.             */
-  static const fltSemantics semPPCDoubleDouble = {-1, 0, 0, 0};
+  static const fltSemantics semPPCDoubleDouble = {-1, 0, 0, 128};
 
   /* These are legacy semantics for the fallback, inaccrurate implementation of
      IBM double-double, if the accurate semPPCDoubleDouble doesn't handle the

diff  --git a/llvm/test/Transforms/InstCombine/bitcast-store.ll b/llvm/test/Transforms/InstCombine/bitcast-store.ll
index bad4d9e19a353..27a6c177a2733 100644
--- a/llvm/test/Transforms/InstCombine/bitcast-store.ll
+++ b/llvm/test/Transforms/InstCombine/bitcast-store.ll
@@ -47,6 +47,16 @@ entry:
   ret void
 }
 
+; CHECK-LABEL: @ppcf128_ones_store
+; CHECK: store ppc_fp128 0xMFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, ppc_fp128* %dest, align 16
+define void @ppcf128_ones_store(ppc_fp128* %dest) {
+entry:
+  %int = or i128 0, 340282366920938463463374607431768211455 ; 128 ones
+  %val = bitcast i128 %int to ppc_fp128
+  store ppc_fp128 %val, ppc_fp128* %dest, align 16
+  ret void
+}
+
 !0 = !{!1}
 !1 = !{!1, !2}
 !2 = !{!2}


        


More information about the llvm-commits mailing list