@@ -25,9 +25,8 @@ use std::arch::x86_64::{
2525} ;
2626#[ cfg( target_arch = "x86_64" ) ]
2727use std:: arch:: x86_64:: {
28- __m512, _mm512_add_epi32, _mm512_add_ps, _mm512_castsi512_ps, _mm512_cvtepi32_ps,
29- _mm512_cvtps_epi32, _mm512_div_ps, _mm512_fmadd_ps, _mm512_loadu_ps, _mm512_max_ps,
30- _mm512_min_ps, _mm512_mul_ps, _mm512_scalef_ps, _mm512_set1_epi32, _mm512_set1_ps,
28+ __m512, _mm512_add_ps, _mm512_cvtepi32_ps, _mm512_cvtps_epi32, _mm512_div_ps, _mm512_fmadd_ps,
29+ _mm512_loadu_ps, _mm512_max_ps, _mm512_min_ps, _mm512_mul_ps, _mm512_scalef_ps, _mm512_set1_ps,
3130 _mm512_storeu_ps, _mm512_sub_ps,
3231} ;
3332
@@ -292,22 +291,6 @@ pub(crate) unsafe fn fast_exp_sigmoid_avx(x: __m256) -> __m256 {
292291// AVX-512 fast-exp helper (16-wide)
293292// ===========================================================================
294293
295- /// Schraudolph 1999 bit-trick exp for AVX-512.
296- #[ cfg( target_arch = "x86_64" ) ]
297- #[ allow( unsafe_code) ]
298- #[ allow( unsafe_op_in_unsafe_fn) ]
299- #[ target_feature( enable = "avx512f" ) ]
300- #[ inline]
301- pub ( crate ) unsafe fn fast_exp_bittrick_avx512 ( x : __m512 ) -> __m512 {
302- let scale = _mm512_set1_ps ( 12102203.0 ) ;
303- let offset = _mm512_set1_epi32 ( 1065353216 ) ;
304- let clamp_lo = _mm512_set1_ps ( -87.0 ) ;
305- let clamp_hi = _mm512_set1_ps ( 88.0 ) ;
306- let x_clamped = _mm512_max_ps ( _mm512_min_ps ( x, clamp_hi) , clamp_lo) ;
307- let val = _mm512_cvtps_epi32 ( _mm512_mul_ps ( x_clamped, scale) ) ;
308- _mm512_castsi512_ps ( _mm512_add_epi32 ( val, offset) )
309- }
310-
311294/// Polynomial exp for AVX-512: same range reduction and coefficients as AVX.
312295#[ cfg( target_arch = "x86_64" ) ]
313296#[ allow( unsafe_code) ]
0 commit comments