From 3449a167708e62ad341e298924687a030ab1dfcb Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 18 Jan 2022 01:20:30 -0500 Subject: [PATCH] Make INV_2PI a tuple Without this, the compiler cannot assume that the range reduction is idempotent to make use of the new fast constprop code path. In the future this could potentially be an ImmutableArray, but since this is relatively small, a tuple is probably fine. --- base/special/rem_pio2.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/special/rem_pio2.jl b/base/special/rem_pio2.jl index 7242eb8f17b69a..4ec9945885e7e1 100644 --- a/base/special/rem_pio2.jl +++ b/base/special/rem_pio2.jl @@ -23,7 +23,7 @@ # @printf "0x%016x,\n" k # I -= k # end -const INV_2PI = UInt64[ +const INV_2PI = ( 0x28be_60db_9391_054a, 0x7f09_d5f4_7d4d_3770, 0x36d8_a566_4f10_e410, @@ -42,7 +42,7 @@ const INV_2PI = UInt64[ 0x5d49_eeb1_faf9_7c5e, 0xcf41_ce7d_e294_a4ba, 0x9afe_d7ec_47e3_5742, - 0x1580_cc11_bf1e_daea] + 0x1580_cc11_bf1e_daea) @inline function cody_waite_2c_pio2(x::Float64, fn, n) pio2_1 = 1.57079632673412561417e+00