Skip to content

Commit

Permalink
ppc64le: patch to avoid missing issignaling
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Nov 26, 2021
1 parent 55c0639 commit fdede9b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then
exit 1
;;
esac

EXTRA_ARGS="--cross-compiling --dest-os=$DEST_OS --dest-cpu=$DEST_ARCH"
fi

Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ source:
- 0001-Forward-ceilf-floorf.patch # [not win]
- 0001-Force-include-handler-outside-simulator.patch # [osx and arm64]
- test-dep-shared-openssl.patch # [not win]
- ppc-issignaling.patch # [ppc64le]

build:
number: 0
Expand Down
24 changes: 24 additions & 0 deletions recipe/ppc-issignaling.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/deps/v8/src/execution/ppc/simulator-ppc.cc b/deps/v8/src/execution/ppc/simulator-ppc.cc
index 97e47bc0..3ac0cff8 100644
--- a/deps/v8/src/execution/ppc/simulator-ppc.cc
+++ b/deps/v8/src/execution/ppc/simulator-ppc.cc
@@ -4751,7 +4751,8 @@ void Simulator::ExecuteGeneric(Instruction* instr) {
bit_cast<float, uint32_t>(static_cast<uint32_t>(double_bits >> 32));
double_bits = bit_cast<uint64_t, double>(static_cast<double>(f));
// Preserve snan.
- if (issignaling(f)) {
+ float snan = std::numeric_limits<float>::signaling_NaN();
+ if (std::memcmp(&snan, &f, sizeof(float)) == 0) {
double_bits &= 0xFFF7FFFFFFFFFFFFU; // Clear bit 51.
}
set_d_register(t, double_bits);
@@ -4764,7 +4765,8 @@ void Simulator::ExecuteGeneric(Instruction* instr) {
uint64_t float_bits = static_cast<uint64_t>(
bit_cast<uint32_t, float>(static_cast<float>(b_val)));
// Preserve snan.
- if (issignaling(b_val)) {
+ double snan = std::numeric_limits<double>::signaling_NaN();
+ if (std::memcmp(&snan, &b_val, sizeof(double)) == 0) {
float_bits &= 0xFFBFFFFFU; // Clear bit 22.
}
// fp result is placed in both 32bit halfs of the dst.

0 comments on commit fdede9b

Please sign in to comment.