Skip to content

Commit 8ae8f50

Browse files
committed
tests: detect x87 via __FLT_EVAL_METHOD__ for s24/s32 tolerances(v3)
1 parent 59ab71b commit 8ae8f50

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

test/test_synth_render_s24.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ int main(void)
129129
TEST_SUCCESS(fluid_synth_write_s24(synth_s24, len, out_s24, 0, 2, out_s24, 1, 2));
130130

131131
/* Tolerances */
132-
#if defined(__i386__) && !defined(__SSE2__)
132+
/* x87/excess-precision detection (prefer this over __SSE2__) */
133+
#if (defined(__i386__) || defined(_M_IX86)) && defined(__FLT_EVAL_METHOD__) && (__FLT_EVAL_METHOD__ != 0)
133134
const int64_t kTol = 256; /* x87 tolerance for s24-in-32 (1 << 8) */
134135
const int kMaxTol = 16; /* allow a few borderline samples */
135136
#else

test/test_synth_render_s32.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ int main(void)
125125
TEST_SUCCESS(fluid_synth_write_s32(synth_s32, len, out_s32, 0, 2, out_s32, 1, 2));
126126

127127
/* Tolerances */
128-
#if defined(__i386__) && !defined(__SSE2__)
128+
/* x87/excess-precision detection (prefer this over __SSE2__) */
129+
#if (defined(__i386__) || defined(_M_IX86)) && defined(__FLT_EVAL_METHOD__) && (__FLT_EVAL_METHOD__ != 0)
129130
const int64_t kTol = 8; /* x87 tolerance for s32 */
130131
const int kMaxTol = 16; /* allow a few borderline samples */
131132
#else

0 commit comments

Comments
 (0)