diff --git a/fp16.c b/fp16.c index 0e4c651..b270d10 100644 --- a/fp16.c +++ b/fp16.c @@ -416,6 +416,7 @@ FP16 approx_float_to_half(FP32 f) return o; } +#ifndef NEON_OPTS // round-half-up (same as ISPC) __m128i float_to_half_SSE2(__m128 f) { @@ -547,6 +548,7 @@ __m128i approx_float_to_half_SSE2(__m128 f) #undef CONSTF } +#endif // from fox toolkit float->half code (which "approx" variants match) static uint basetable[512]; diff --git a/fp16.h b/fp16.h index dc7fea8..c7a2704 100644 --- a/fp16.h +++ b/fp16.h @@ -106,7 +106,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#ifndef NEON_OPTS #include +#endif typedef unsigned int uint; @@ -144,9 +146,11 @@ FP16 float_to_half_fast2(FP32 f); FP16 float_to_half_fast3(FP32 f); FP16 float_to_half_fast3_rtne(FP32 f); FP16 approx_float_to_half(FP32 f); +#ifndef NEON_OPTS __m128i float_to_half_SSE2(__m128 f); __m128i float_to_half_rtne_SSE2(__m128 f); __m128i approx_float_to_half_SSE2(__m128 f); +#endif void fp16_generatetables(); uint float_to_half_foxtk(uint f); FP32 half_to_float(FP16 h);