Skip to content

Commit f45d5e7

Browse files
committed
[APFloat] Set size of PPCDoubleDouble to 128
566690b 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
1 parent 573531f commit f45d5e7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

llvm/lib/Support/APFloat.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace llvm {
9292
Note: we need to make the value different from semBogus as otherwise
9393
an unsafe optimization may collapse both values to a single address,
9494
and we heavily rely on them having distinct addresses. */
95-
static const fltSemantics semPPCDoubleDouble = {-1, 0, 0, 0};
95+
static const fltSemantics semPPCDoubleDouble = {-1, 0, 0, 128};
9696

9797
/* These are legacy semantics for the fallback, inaccrurate implementation of
9898
IBM double-double, if the accurate semPPCDoubleDouble doesn't handle the

llvm/test/Transforms/InstCombine/bitcast-store.ll

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ entry:
4747
ret void
4848
}
4949

50+
; CHECK-LABEL: @ppcf128_ones_store
51+
; CHECK: store ppc_fp128 0xMFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, ppc_fp128* %dest, align 16
52+
define void @ppcf128_ones_store(ppc_fp128* %dest) {
53+
entry:
54+
%int = or i128 0, 340282366920938463463374607431768211455 ; 128 ones
55+
%val = bitcast i128 %int to ppc_fp128
56+
store ppc_fp128 %val, ppc_fp128* %dest, align 16
57+
ret void
58+
}
59+
5060
!0 = !{!1}
5161
!1 = !{!1, !2}
5262
!2 = !{!2}

0 commit comments

Comments
 (0)