Skip to content

Commit

Permalink
[APFloat] Set size of PPCDoubleDouble to 128
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ecnelises committed Oct 9, 2021
1 parent 573531f commit f45d5e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Support/APFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace llvm {
Note: we need to make the value different 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
Expand Down
10 changes: 10 additions & 0 deletions llvm/test/Transforms/InstCombine/bitcast-store.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit f45d5e7

Please sign in to comment.