Use 1-step range reduction in NEONFMA Sigmoid micro-kernels
- Parametrize F32 Sigmoid micro-kernels by the number of range reduction steps
- Use 1-step range reduction in NEONFMA implementations (~5% performance
improvement on Pixel 2 & 3a, ~6% on Mi A2 Lite)
PiperOrigin-RevId: 288364064
diff --git a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x12.c b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x12.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x12.c
rename to src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x12.c
index 0c2e92f..37f1ebc 100644
--- a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x12.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x12(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x12(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x16.c b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x16.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x16.c
rename to src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x16.c
index 3934158..4bd1d70 100644
--- a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x16.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x16(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x16(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x20.c b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x20.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x20.c
rename to src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x20.c
index 8ee75d4..037d427 100644
--- a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x20.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x20(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x20(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x24.c b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x24.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x24.c
rename to src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x24.c
index 222c7de..e86d427 100644
--- a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x24.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x24(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x24(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x4.c b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x4.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x4.c
rename to src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x4.c
index 8cffff4..e09ba6a 100644
--- a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x4.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x4(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x4(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x8.c b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x8.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x8.c
rename to src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x8.c
index 4bcb84b..2d4b806 100644
--- a/src/f32-sigmoid/gen/neon-lut2048-p1-nr2recps-x8.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut2048-p1-nr2recps-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x8(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x8(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x12.c b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x12.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x12.c
rename to src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x12.c
index 353a311..d13a71b 100644
--- a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x12.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x12(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x12(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x16.c b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x16.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x16.c
rename to src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x16.c
index 95746ab..8a6a123 100644
--- a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x16.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x16(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x16(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x20.c b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x20.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x20.c
rename to src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x20.c
index 0ac1db3..66dfc49 100644
--- a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x20.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x20(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x20(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x24.c b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x24.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x24.c
rename to src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x24.c
index e213092..35ad66d 100644
--- a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x24.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x24(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x24(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x4.c b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x4.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x4.c
rename to src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x4.c
index 47cadac..b44a8ec 100644
--- a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x4.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x4(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x4(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x8.c b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x8.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x8.c
rename to src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x8.c
index 5e44a50..237653d 100644
--- a/src/f32-sigmoid/gen/neon-lut64-p2-nr2recps-x8.c
+++ b/src/f32-sigmoid/gen/neon-rr2-lut64-p2-nr2recps-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x8(
+void xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x8(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-p5-nr2recps-x12.c b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x12.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-p5-nr2recps-x12.c
rename to src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x12.c
index cb2b088..2ce290e 100644
--- a/src/f32-sigmoid/gen/neon-p5-nr2recps-x12.c
+++ b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x12.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x12(
+void xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x12(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-p5-nr2recps-x16.c b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x16.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-p5-nr2recps-x16.c
rename to src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x16.c
index d8f531a..fca1f71 100644
--- a/src/f32-sigmoid/gen/neon-p5-nr2recps-x16.c
+++ b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x16.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x16(
+void xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x16(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-p5-nr2recps-x20.c b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x20.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-p5-nr2recps-x20.c
rename to src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x20.c
index 0b8b469..1ed3b21 100644
--- a/src/f32-sigmoid/gen/neon-p5-nr2recps-x20.c
+++ b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x20.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x20(
+void xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x20(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-p5-nr2recps-x24.c b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x24.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-p5-nr2recps-x24.c
rename to src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x24.c
index 3ae42ec..3bcfe06 100644
--- a/src/f32-sigmoid/gen/neon-p5-nr2recps-x24.c
+++ b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x24.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x24(
+void xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x24(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-p5-nr2recps-x4.c b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x4.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-p5-nr2recps-x4.c
rename to src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x4.c
index ec0ccbc..0f75f46 100644
--- a/src/f32-sigmoid/gen/neon-p5-nr2recps-x4.c
+++ b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x4.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x4(
+void xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x4(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neon-p5-nr2recps-x8.c b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x8.c
similarity index 99%
rename from src/f32-sigmoid/gen/neon-p5-nr2recps-x8.c
rename to src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x8.c
index 2f59e76..24928b1 100644
--- a/src/f32-sigmoid/gen/neon-p5-nr2recps-x8.c
+++ b/src/f32-sigmoid/gen/neon-rr2-p5-nr2recps-x8.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x8(
+void xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x8(
size_t n,
const float* x,
float* y,
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x12.c
index c3cd2dd..6b1a5a9 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -219,9 +213,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -298,9 +290,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x16.c
index 7621cd0..2b51db2 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -243,9 +236,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -322,9 +313,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x20.c
similarity index 93%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x20.c
index 0ded1e0..35d8bc9 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -267,9 +259,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -346,9 +336,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x24.c
similarity index 93%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x24.c
index 8f116f9..dcf4b58 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -291,9 +282,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -370,9 +359,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x4.c
index 114100b..94b7a84 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -166,9 +163,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x8.c
index 26ef0ab..3f59798 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-div-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-div-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -195,9 +190,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -274,9 +267,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x12.c
index c25ae2f..0907b72 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -234,9 +228,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -322,9 +314,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x16.c
index dbb1cb6..bb645b0 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -261,9 +254,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -349,9 +340,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x20.c
index 526bbd9..2affd74 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -288,9 +280,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -376,9 +366,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x24.c
index 18588a8..1350f67 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -315,9 +306,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -403,9 +392,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x4.c
index efccf4e..0002c8b 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -175,9 +172,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x8.c
index 8c96519..5d68d52 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr1recps1fma-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr1recps1fma-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -207,9 +202,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -295,9 +288,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x12.c
index 56cc409..edb2583 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -234,9 +228,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -322,9 +314,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x16.c
index e72ded7..75cb673 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -261,9 +254,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -349,9 +340,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x20.c
index 95bd49d..1d3046f 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -288,9 +280,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -376,9 +366,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x24.c
index 521d8e9..5b98d40 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -315,9 +306,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -403,9 +392,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x4.c
index 2af9ee5..6ee0bc3 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -175,9 +172,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x8.c
index cf30ace..558dab4 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2fma-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2fma-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -207,9 +202,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -295,9 +288,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x12.c
index 9b36feb..0bf04c3 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -234,9 +228,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -322,9 +314,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x16.c
index e544536..ada121c 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -261,9 +254,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -349,9 +340,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x20.c
index 37121ad..c4d3818 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -288,9 +280,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -376,9 +366,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x24.c
index fdacea7..616e5f4 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o2048_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o2048_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o2048_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o2048);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o2048);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o2048);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -315,9 +306,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -403,9 +392,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x4.c
index 6e4d45a..9a3e971 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -175,9 +172,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x8.c
index e952674..7dcc6f0 100644
--- a/src/f32-sigmoid/gen/neonfma-lut2048-p1-nr2recps-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut2048-p1-nr2recps-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o2048_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o2048_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o2048);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -207,9 +202,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -295,9 +288,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048_hi);
- vt = vfmaq_f32(vt, vn, vln2_o2048_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o2048);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-div-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x12.c
index 892bc6c..c64803c 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -224,9 +218,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -305,9 +297,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-div-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x16.c
index 705d6bf..6c006db 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -249,9 +242,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -330,9 +321,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-div-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x20.c
index 937043b..274e877 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -274,9 +266,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -355,9 +345,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-div-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x24.c
index 20dd7ea..45e6bf6 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -299,9 +290,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -380,9 +369,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-div-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x4.c
index 6dd71f4..c286630 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -168,9 +165,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-div-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x8.c
index 54b7890..bbf97d2 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-div-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-div-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -199,9 +194,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -280,9 +273,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x12.c
index b56772b..bb07682 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -239,9 +233,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -329,9 +321,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x16.c
index db5f4e8..9ccecf0 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -267,9 +260,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -357,9 +348,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x20.c
index 24521f3..0e78b1e 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -295,9 +287,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -385,9 +375,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x24.c
index e6a1974..f635bf5 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -323,9 +314,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -413,9 +402,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x4.c
index bd75e4c..931388b 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -177,9 +174,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x8.c
index 867ad49..b9fd3ac 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr1recps1fma-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr1recps1fma-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -211,9 +206,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -301,9 +294,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x12.c
index e78b320..4844fe6 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -239,9 +233,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -329,9 +321,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x16.c
index b4c7e24..1035ff1 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -267,9 +260,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -357,9 +348,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x20.c
index 1af5104..4884990 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -295,9 +287,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -385,9 +375,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x24.c
index c517767..eeb7fb6 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -323,9 +314,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -413,9 +402,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x4.c
index 2556fb4..37776e9 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -177,9 +174,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x8.c
index b6900c9..310e3f6 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2fma-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2fma-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -211,9 +206,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -301,9 +294,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x12.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x12.c
index 09c05bf..8fd794c 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x12.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x12(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -118,14 +117,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -239,9 +233,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -329,9 +321,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x16.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x16.c
index fcad036..148aa38 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x16.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x16(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -132,16 +131,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -267,9 +260,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -357,9 +348,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x20.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x20.c
index 586f0da..1f95069 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x20.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x20(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -146,18 +145,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -295,9 +287,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -385,9 +375,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x24.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x24.c
index 56f2824..15dbd6d 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x24.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x24(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -160,20 +159,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_o64_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_o64_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_o64_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_o64);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_o64);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_o64);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -323,9 +314,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -413,9 +402,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x4.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x4.c
index c481706..333d59d 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x4.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x4(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -87,9 +86,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -177,9 +174,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x8.c
similarity index 94%
rename from src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x8.c
index 48221d6..8c4167e 100644
--- a/src/f32-sigmoid/gen/neonfma-lut64-p2-nr2recps-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-lut64-p2-nr2recps-x8.c
@@ -17,7 +17,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x8(
size_t n,
const float* x,
float* y,
@@ -30,8 +30,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -104,12 +103,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_o64_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_o64_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_o64);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -211,9 +206,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -301,9 +294,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64_hi);
- vt = vfmaq_f32(vt, vn, vln2_o64_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2_o64);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/gen/neonfma-p5-div-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x12.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-div-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-div-x12.c
index cd43f82..663baa9 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-div-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x12.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_div_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x12(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -76,14 +75,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -171,9 +165,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -232,9 +224,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-div-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x16.c
similarity index 91%
rename from src/f32-sigmoid/gen/neonfma-p5-div-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-div-x16.c
index c524a47..1c6ae3d 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-div-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x16.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_div_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x16(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -81,16 +80,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -190,9 +183,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -251,9 +242,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-div-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x20.c
similarity index 91%
rename from src/f32-sigmoid/gen/neonfma-p5-div-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-div-x20.c
index 983a4d4..4aea404 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-div-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x20.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_div_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x20(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -86,18 +85,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -209,9 +201,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -270,9 +260,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-div-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x24.c
similarity index 91%
rename from src/f32-sigmoid/gen/neonfma-p5-div-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-div-x24.c
index 89b5d06..66f4d1c 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-div-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x24.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_div_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x24(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -91,20 +90,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -228,9 +219,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -289,9 +278,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-div-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x4.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-div-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-div-x4.c
index b197fc8..808c004 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-div-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x4.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_div_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x4(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -66,9 +65,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -127,9 +124,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-div-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x8.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-div-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-div-x8.c
index 3fd3629..2a57c4b 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-div-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-div-x8.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_div_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x8(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -71,12 +70,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -152,9 +147,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -213,9 +206,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x12.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x12.c
index f4a11c6..8e40dc1 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x12.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x12(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -76,14 +75,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -186,9 +180,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -256,9 +248,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x16.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x16.c
index dfb9151..885291f 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x16.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x16(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -81,16 +80,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -208,9 +201,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -278,9 +269,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x20.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x20.c
index 4e85372..b9723fd 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x20.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x20(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -86,18 +85,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -230,9 +222,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -300,9 +290,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x24.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x24.c
index baf08fa..5f08e1b 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x24.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x24(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -91,20 +90,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -252,9 +243,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -322,9 +311,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x4.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x4.c
index 26d6c2c..139ac1e 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x4.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x4(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -66,9 +65,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -136,9 +133,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x8.c
similarity index 93%
rename from src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x8.c
index 69d05dc..9894f89 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr1recps1fma-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr1recps1fma-x8.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x8(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -71,12 +70,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -164,9 +159,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -234,9 +227,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x12.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2fma-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x12.c
index f6d0143..a82556e 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x12.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x12(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -76,14 +75,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -186,9 +180,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -256,9 +248,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x16.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2fma-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x16.c
index 9782f1f..bb76e3d 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x16.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x16(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -81,16 +80,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -208,9 +201,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -278,9 +269,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x20.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2fma-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x20.c
index 40e5cb7..2a07c66 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x20.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x20(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -86,18 +85,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -230,9 +222,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -300,9 +290,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x24.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2fma-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x24.c
index 175b3f8..65f764f 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x24.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x24(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -91,20 +90,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -252,9 +243,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -322,9 +311,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x4.c
similarity index 93%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2fma-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x4.c
index f4a8d4c..58b7ff6 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x4.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x4(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -66,9 +65,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -136,9 +133,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x8.c
similarity index 93%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2fma-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x8.c
index f7802e1..cf47e98 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2fma-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2fma-x8.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x8(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -71,12 +70,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -164,9 +159,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -234,9 +227,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x12.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x12.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2recps-x12.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x12.c
index bf0dc12..97dff69 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x12.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x12.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x12(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x12(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -76,14 +75,9 @@
vn89AB = vsubq_f32(vn89AB, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -186,9 +180,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -256,9 +248,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x16.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x16.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2recps-x16.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x16.c
index 6bf74d9..698d771 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x16.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x16.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x16(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x16(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -81,16 +80,10 @@
vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -208,9 +201,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -278,9 +269,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x20.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x20.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2recps-x20.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x20.c
index 69b9211..546abd1 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x20.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x20.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x20(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x20(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -86,18 +85,11 @@
vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -230,9 +222,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -300,9 +290,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x24.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x24.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2recps-x24.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x24.c
index 8af8a9b..3e95f7d 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x24.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x24.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x24(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x24(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -91,20 +90,12 @@
vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
- float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2_hi);
- float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2_hi);
- float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2_hi);
- float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
- vt89AB = vfmaq_f32(vt89AB, vn89AB, vln2_lo);
- vtCDEF = vfmaq_f32(vtCDEF, vnCDEF, vln2_lo);
- vtGHIJ = vfmaq_f32(vtGHIJ, vnGHIJ, vln2_lo);
- vtKLMN = vfmaq_f32(vtKLMN, vnKLMN, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
+ float32x4_t vt89AB = vfmaq_f32(vz89AB, vn89AB, vln2);
+ float32x4_t vtCDEF = vfmaq_f32(vzCDEF, vnCDEF, vln2);
+ float32x4_t vtGHIJ = vfmaq_f32(vzGHIJ, vnGHIJ, vln2);
+ float32x4_t vtKLMN = vfmaq_f32(vzKLMN, vnKLMN, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -252,9 +243,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -322,9 +311,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x4.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x4.c
similarity index 92%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2recps-x4.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x4.c
index b19b444..10d33ba 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x4.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x4.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x4(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x4(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -66,9 +65,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -136,9 +133,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x8.c b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x8.c
similarity index 93%
rename from src/f32-sigmoid/gen/neonfma-p5-nr2recps-x8.c
rename to src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x8.c
index 5033b9d..5345025 100644
--- a/src/f32-sigmoid/gen/neonfma-p5-nr2recps-x8.c
+++ b/src/f32-sigmoid/gen/neonfma-rr1-p5-nr2recps-x8.c
@@ -15,7 +15,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x8(
+void xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x8(
size_t n,
const float* x,
float* y,
@@ -28,8 +28,7 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -71,12 +70,8 @@
vn4567 = vsubq_f32(vn4567, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2_hi);
- float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2_hi);
-
- vt0123 = vfmaq_f32(vt0123, vn0123, vln2_lo);
- vt4567 = vfmaq_f32(vt4567, vn4567, vln2_lo);
+ float32x4_t vt0123 = vfmaq_f32(vz0123, vn0123, vln2);
+ float32x4_t vt4567 = vfmaq_f32(vz4567, vn4567, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp0123 = vfmaq_f32(vc4, vc5, vt0123);
@@ -164,9 +159,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
@@ -234,9 +227,7 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = vfmaq_f32(vz, vn, vln2_hi);
- vt = vfmaq_f32(vt, vn, vln2_lo);
+ float32x4_t vt = vfmaq_f32(vz, vn, vln2);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = vfmaq_f32(vc4, vc5, vt);
diff --git a/src/f32-sigmoid/neon-lut2048-p1.c.in b/src/f32-sigmoid/neon-lut2048-p1.c.in
index 58afd54..9e97960 100644
--- a/src/f32-sigmoid/neon-lut2048-p1.c.in
+++ b/src/f32-sigmoid/neon-lut2048-p1.c.in
@@ -5,6 +5,7 @@
$assert BATCH_TILE % 4 == 0
$assert BATCH_TILE >= 4
+$assert RR_STEPS in [1, 2]
$assert DIV_ALGO in ["div", "nr2fma", "nr2recps", "nr1recps1fma"]
$ABC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$VMULADDQ_F32 = "vfmaq_f32" if FMA else "vmlaq_f32"
@@ -18,7 +19,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_2048[2048];
-void xnn_f32_sigmoid_ukernel__${"neonfma" if FMA else "neon"}_lut2048_p1_${DIV_ALGO}_x${BATCH_TILE}(
+void xnn_f32_sigmoid_ukernel__${"neonfma" if FMA else "neon"}_rr${RR_STEPS}_lut2048_p1_${DIV_ALGO}_x${BATCH_TILE}(
size_t n,
const float* x,
float* y,
@@ -31,13 +32,16 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x2048 = vmovq_n_f32(-0x1.715476p11f);
- $if FMA:
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ $if RR_STEPS == 1:
+ const float32x4_t vln2_o2048 = vmovq_n_f32(0x1.62E43p-12f);
$else:
- // Last 18 bits are zeroes
- const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.600000p-12f);
- const float32x4_t vln2_o2048_lo = vmovq_n_f32(0x1.7217F8p-19f);
+ $if FMA:
+ const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.62E43p-12f);
+ const float32x4_t vln2_o2048_lo = vmovq_n_f32(-0x1.05C61p-40f);
+ $else:
+ // Last 18 bits are zeroes
+ const float32x4_t vln2_o2048_hi = vmovq_n_f32(0x1.600000p-12f);
+ const float32x4_t vln2_o2048_lo = vmovq_n_f32(0x1.7217F8p-19f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFFEp-1f);
@@ -106,12 +110,16 @@
vn${ABC[N:N+4]} = vsubq_f32(vn${ABC[N:N+4]}, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- $for N in range(0, BATCH_TILE, 4):
- float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o2048_hi);
+ $if RR_STEPS == 1:
+ $for N in range(0, BATCH_TILE, 4):
+ float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o2048);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
+ $for N in range(0, BATCH_TILE, 4):
+ float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o2048_hi);
- $for N in range(0, BATCH_TILE, 4):
- vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vt${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o2048_lo);
+ $for N in range(0, BATCH_TILE, 4):
+ vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vt${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o2048_lo);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -222,9 +230,12 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o2048_hi);
- vt = ${VMULADDQ_F32}(vt, vn, vln2_o2048_lo);
+ $if RR_STEPS == 1:
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o2048);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o2048_hi);
+ vt = ${VMULADDQ_F32}(vt, vn, vln2_o2048_lo);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
@@ -320,9 +331,12 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 2048). Note that -t = -z - n * log(2) / 2048.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
- float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o2048_hi);
- vt = ${VMULADDQ_F32}(vt, vn, vln2_o2048_lo);
+ $if RR_STEPS == 1:
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o2048);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2) / 2048) to improve accuracy.
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o2048_hi);
+ vt = ${VMULADDQ_F32}(vt, vn, vln2_o2048_lo);
// Compute degree-1 polynomial approximation for exp(-t) on [-log(2)/2048, log(2)/2048]:
// P1(t) = 1 + t * c1
diff --git a/src/f32-sigmoid/neon-lut64-p2.c.in b/src/f32-sigmoid/neon-lut64-p2.c.in
index 64575a2..9d8707e 100644
--- a/src/f32-sigmoid/neon-lut64-p2.c.in
+++ b/src/f32-sigmoid/neon-lut64-p2.c.in
@@ -5,6 +5,7 @@
$assert BATCH_TILE % 4 == 0
$assert BATCH_TILE >= 4
+$assert RR_STEPS in [1, 2]
$assert DIV_ALGO in ["div", "nr2fma", "nr2recps", "nr1recps1fma"]
$ABC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$VMULADDQ_F32 = "vfmaq_f32" if FMA else "vmlaq_f32"
@@ -19,7 +20,7 @@
extern XNN_INTERNAL const float xnn_table_exp2_k_over_64[64];
-void xnn_f32_sigmoid_ukernel__${"neonfma" if FMA else "neon"}_lut64_p2_${DIV_ALGO}_x${BATCH_TILE}(
+void xnn_f32_sigmoid_ukernel__${"neonfma" if FMA else "neon"}_rr${RR_STEPS}_lut64_p2_${DIV_ALGO}_x${BATCH_TILE}(
size_t n,
const float* x,
float* y,
@@ -32,13 +33,16 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e_x64 = vmovq_n_f32(-0x1.715476p6f);
- $if FMA:
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ $if RR_STEPS == 1:
+ const float32x4_t vln2_o64 = vmovq_n_f32(0x1.62E43p-7f);
$else:
- // Last 13 bits are zeroes
- const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.630000p-7f);
- const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.BD0106p-19f);
+ $if FMA:
+ const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.62E43p-7f);
+ const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.05C61p-35f);
+ $else:
+ // Last 13 bits are zeroes
+ const float32x4_t vln2_o64_hi = vmovq_n_f32(0x1.630000p-7f);
+ const float32x4_t vln2_o64_lo = vmovq_n_f32(-0x1.BD0106p-19f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc2 = vmovq_n_f32(0x1.FFFF0Ap-2f);
@@ -107,12 +111,16 @@
vn${ABC[N:N+4]} = vsubq_f32(vn${ABC[N:N+4]}, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- $for N in range(0, BATCH_TILE, 4):
- float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o64_hi);
+ $if RR_STEPS == 1:
+ $for N in range(0, BATCH_TILE, 4):
+ float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o64);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
+ $for N in range(0, BATCH_TILE, 4):
+ float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o64_hi);
- $for N in range(0, BATCH_TILE, 4):
- vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vt${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o64_lo);
+ $for N in range(0, BATCH_TILE, 4):
+ vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vt${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_o64_lo);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -227,9 +235,12 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o64_hi);
- vt = ${VMULADDQ_F32}(vt, vn, vln2_o64_lo);
+ $if RR_STEPS == 1:
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o64);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o64_hi);
+ vt = ${VMULADDQ_F32}(vt, vn, vln2_o64_lo);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
@@ -327,9 +338,12 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument t := (z + n * log(2) / 64). Note that -t = -z - n * log(2) / 64.
- // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
- float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o64_hi);
- vt = ${VMULADDQ_F32}(vt, vn, vln2_o64_lo);
+ $if RR_STEPS == 1:
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o64);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2) / 64) to improve accuracy.
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_o64_hi);
+ vt = ${VMULADDQ_F32}(vt, vn, vln2_o64_lo);
// Compute degree-2 polynomial approxiatmion for exp(-t) on [-log(2)/128, log(2)/128].
// P1(t) = 1 + t * (-1 + t * c2)
diff --git a/src/f32-sigmoid/neon-p5.c.in b/src/f32-sigmoid/neon-p5.c.in
index 5373463..efd181d 100644
--- a/src/f32-sigmoid/neon-p5.c.in
+++ b/src/f32-sigmoid/neon-p5.c.in
@@ -5,6 +5,7 @@
$assert BATCH_TILE % 4 == 0
$assert BATCH_TILE >= 4
+$assert RR_STEPS in [1, 2]
$assert DIV_ALGO in ["div", "nr2fma", "nr2recps", "nr1recps1fma"]
$ABC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$VMULADDQ_F32 = "vfmaq_f32" if FMA else "vmlaq_f32"
@@ -16,7 +17,7 @@
#include <xnnpack/vunary.h>
-void xnn_f32_sigmoid_ukernel__${"neonfma" if FMA else "neon"}_p5_${DIV_ALGO}_x${BATCH_TILE}(
+void xnn_f32_sigmoid_ukernel__${"neonfma" if FMA else "neon"}_rr${RR_STEPS}_p5_${DIV_ALGO}_x${BATCH_TILE}(
size_t n,
const float* x,
float* y,
@@ -29,13 +30,16 @@
// This number is also the largest z for which expf(-z) is normalized.
const float32x4_t vdenorm_cutoff = vmovq_n_f32(0x1.5D589Ep+6f);
const float32x4_t vminus_log2e = vmovq_n_f32(-0x1.715476p+0f);
- $if FMA:
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ $if RR_STEPS == 1:
+ const float32x4_t vln2 = vmovq_n_f32(0x1.62E43p-1f);
$else:
- // Last 7 bits are zeroes
- const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E400p-1f);
- const float32x4_t vln2_lo = vmovq_n_f32(0x1.7F7D1Cp-20f);
+ $if FMA:
+ const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E43p-1f);
+ const float32x4_t vln2_lo = vmovq_n_f32(-0x1.05C61p-29f);
+ $else:
+ // Last 7 bits are zeroes
+ const float32x4_t vln2_hi = vmovq_n_f32(0x1.62E400p-1f);
+ const float32x4_t vln2_lo = vmovq_n_f32(0x1.7F7D1Cp-20f);
const float32x4_t vone = vmovq_n_f32(1.0f);
const float32x4_t vc1 = vmovq_n_f32(-0x1.FFFFF6p-1f);
@@ -78,12 +82,16 @@
vn${ABC[N:N+4]} = vsubq_f32(vn${ABC[N:N+4]}, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- $for N in range(0, BATCH_TILE, 4):
- float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_hi);
+ $if RR_STEPS == 1:
+ $for N in range(0, BATCH_TILE, 4):
+ float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
+ $for N in range(0, BATCH_TILE, 4):
+ float32x4_t vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vz${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_hi);
- $for N in range(0, BATCH_TILE, 4):
- vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vt${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_lo);
+ $for N in range(0, BATCH_TILE, 4):
+ vt${ABC[N:N+4]} = ${VMULADDQ_F32}(vt${ABC[N:N+4]}, vn${ABC[N:N+4]}, vln2_lo);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
$for N in range(0, BATCH_TILE, 4):
@@ -184,9 +192,12 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_hi);
- vt = ${VMULADDQ_F32}(vt, vn, vln2_lo);
+ $if RR_STEPS == 1:
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_hi);
+ vt = ${VMULADDQ_F32}(vt, vn, vln2_lo);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = ${VMULADDQ_F32}(vc4, vc5, vt);
@@ -264,9 +275,12 @@
vn = vsubq_f32(vn, vmagic_bias);
// Compute reduced argument -t := -z - n * log(2) = -(z + n * log(2)).
- // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
- float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_hi);
- vt = ${VMULADDQ_F32}(vt, vn, vln2_lo);
+ $if RR_STEPS == 1:
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2);
+ $else:
+ // Use Cody-Waite range reduction method (note two constants to represent log(2)) to improve accuracy.
+ float32x4_t vt = ${VMULADDQ_F32}(vz, vn, vln2_hi);
+ vt = ${VMULADDQ_F32}(vt, vn, vln2_lo);
// Compute degree-5 polynomial approxiatmion for exp(-t) on [-log(2)/2, log(2)/2].
float32x4_t vp = ${VMULADDQ_F32}(vc4, vc5, vt);
diff --git a/src/init.c b/src/init.c
index 85872be..f0bf70f 100644
--- a/src/init.c
+++ b/src/init.c
@@ -242,7 +242,7 @@
};
xnn_params.f32.clamp = (xnn_univector_ukernel_function) xnn_f32_clamp_ukernel__neon;
xnn_params.f32.hswish = (xnn_univector_ukernel_function) xnn_f32_hswish_ukernel__neon_x8;
- xnn_params.f32.sigmoid = (xnn_univector_ukernel_function) xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x8;
+ xnn_params.f32.sigmoid = (xnn_univector_ukernel_function) xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x8;
xnn_params.f32.prelu = (struct prelu_parameters) {
.ukernel = (xnn_prelu_ukernel_function) xnn_f32_prelu_ukernel__neon_2x8,
.row_tile = 2,
@@ -546,7 +546,7 @@
};
xnn_params.f32.clamp = (xnn_univector_ukernel_function) xnn_f32_clamp_ukernel__neon;
xnn_params.f32.hswish = (xnn_univector_ukernel_function) xnn_f32_hswish_ukernel__neonfma_x8;
- xnn_params.f32.sigmoid = (xnn_univector_ukernel_function) xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x16;
+ xnn_params.f32.sigmoid = (xnn_univector_ukernel_function) xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x16;
xnn_params.f32.prelu = (struct prelu_parameters) {
.ukernel = (xnn_prelu_ukernel_function) xnn_f32_prelu_ukernel__neon_2x8,
.row_tile = 2,
diff --git a/src/xnnpack/vunary.h b/src/xnnpack/vunary.h
index 7e578b8..ddbfb6a 100644
--- a/src/xnnpack/vunary.h
+++ b/src/xnnpack/vunary.h
@@ -17,116 +17,116 @@
#define DECLARE_F32_VUNARY_UKERNEL_FUNCTION(fn_name) \
- XNN_INTERNAL void fn_name( \
- size_t n, \
- const float* x, \
- float* y, \
+ XNN_INTERNAL void fn_name( \
+ size_t n, \
+ const float* x, \
+ float* y, \
const void* params);
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_div_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_div_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_div_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_div_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_div_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_div_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_div_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2fma_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2fma_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr1recps1fma_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr1recps1fma_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_p5_nr2recps_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_p5_nr2recps_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_p5_nr2recps_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_p5_nr2recps_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_div_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_div_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2fma_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2fma_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr1recps1fma_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr1recps1fma_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut64_p2_nr2recps_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut64_p2_nr2recps_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut64_p2_nr2recps_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut64_p2_nr2recps_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_div_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_div_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2fma_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2fma_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr1recps1fma_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr1recps1fma_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_lut2048_p1_nr2recps_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neonfma_rr1_lut2048_p1_nr2recps_x24)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x4)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x8)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x12)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x16)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x20)
-DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_lut2048_p1_nr2recps_x24)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x4)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x8)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x12)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x16)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x20)
+DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_rr2_lut2048_p1_nr2recps_x24)
DECLARE_F32_VUNARY_UKERNEL_FUNCTION(xnn_f32_sigmoid_ukernel__neon_frac_p9_p10_nr1recps_x16)