mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	tests: Use single-line #ifdef for ARM NEON code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
		
							parent
							
								
									4ca3216ee3
								
							
						
					
					
						commit
						9576ba2d9e
					
				
					 2 changed files with 10 additions and 22 deletions
				
			
		| 
						 | 
					@ -32,8 +32,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Only ARM NEON has mix tests, so disable the related functions for other
 | 
					/* Only ARM NEON has mix tests, so disable the related functions for other
 | 
				
			||||||
 * architectures for now to avoid compiler warnings about unused functions. */
 | 
					 * architectures for now to avoid compiler warnings about unused functions. */
 | 
				
			||||||
#if defined (__arm__) && defined (__linux__)
 | 
					#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
 | 
				
			||||||
#ifdef HAVE_NEON
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SAMPLES 1028
 | 
					#define SAMPLES 1028
 | 
				
			||||||
#define TIMES 1000
 | 
					#define TIMES 1000
 | 
				
			||||||
| 
						 | 
					@ -150,11 +149,9 @@ static void run_mix_test(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_mempool_free(pool);
 | 
					    pa_mempool_free(pool);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif /* HAVE_NEON */
 | 
					#endif /* defined (__arm__) && defined (__linux__) && defined (HAVE_NEON) */
 | 
				
			||||||
#endif /* defined (__arm__) && defined (__linux__) */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined (__arm__) && defined (__linux__)
 | 
					#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
 | 
				
			||||||
#ifdef HAVE_NEON
 | 
					 | 
				
			||||||
START_TEST (mix_neon_test) {
 | 
					START_TEST (mix_neon_test) {
 | 
				
			||||||
    pa_do_mix_func_t orig_func, neon_func;
 | 
					    pa_do_mix_func_t orig_func, neon_func;
 | 
				
			||||||
    pa_cpu_arm_flag_t flags = 0;
 | 
					    pa_cpu_arm_flag_t flags = 0;
 | 
				
			||||||
| 
						 | 
					@ -174,8 +171,7 @@ START_TEST (mix_neon_test) {
 | 
				
			||||||
    run_mix_test(neon_func, orig_func, 7, 2, true, true);
 | 
					    run_mix_test(neon_func, orig_func, 7, 2, true, true);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
END_TEST
 | 
					END_TEST
 | 
				
			||||||
#endif /* HAVE_NEON */
 | 
					#endif /* defined (__arm__) && defined (__linux__) && defined (HAVE_NEON) */
 | 
				
			||||||
#endif /* defined (__arm__) && defined (__linux__) */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int argc, char *argv[]) {
 | 
					int main(int argc, char *argv[]) {
 | 
				
			||||||
    int failed = 0;
 | 
					    int failed = 0;
 | 
				
			||||||
| 
						 | 
					@ -189,10 +185,8 @@ int main(int argc, char *argv[]) {
 | 
				
			||||||
    s = suite_create("CPU");
 | 
					    s = suite_create("CPU");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tc = tcase_create("mix");
 | 
					    tc = tcase_create("mix");
 | 
				
			||||||
#if defined (__arm__) && defined (__linux__)
 | 
					#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
 | 
				
			||||||
#if HAVE_NEON
 | 
					 | 
				
			||||||
    tcase_add_test(tc, mix_neon_test);
 | 
					    tcase_add_test(tc, mix_neon_test);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    tcase_set_timeout(tc, 120);
 | 
					    tcase_set_timeout(tc, 120);
 | 
				
			||||||
    suite_add_tcase(s, tc);
 | 
					    suite_add_tcase(s, tc);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,8 +86,7 @@ static void run_conv_test_float_to_s16(
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This test is currently only run under NEON */
 | 
					/* This test is currently only run under NEON */
 | 
				
			||||||
#if defined (__arm__) && defined (__linux__)
 | 
					#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
 | 
				
			||||||
#ifdef HAVE_NEON
 | 
					 | 
				
			||||||
static void run_conv_test_s16_to_float(
 | 
					static void run_conv_test_s16_to_float(
 | 
				
			||||||
        pa_convert_func_t func,
 | 
					        pa_convert_func_t func,
 | 
				
			||||||
        pa_convert_func_t orig_func,
 | 
					        pa_convert_func_t orig_func,
 | 
				
			||||||
| 
						 | 
					@ -135,8 +134,7 @@ static void run_conv_test_s16_to_float(
 | 
				
			||||||
        } PA_RUNTIME_TEST_RUN_STOP
 | 
					        } PA_RUNTIME_TEST_RUN_STOP
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif /* HAVE_NEON */
 | 
					#endif /* defined (__arm__) && defined (__linux__) && defined (HAVE_NEON) */
 | 
				
			||||||
#endif /* defined (__arm__) && defined (__linux__) */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined (__i386__) || defined (__amd64__)
 | 
					#if defined (__i386__) || defined (__amd64__)
 | 
				
			||||||
START_TEST (sconv_sse2_test) {
 | 
					START_TEST (sconv_sse2_test) {
 | 
				
			||||||
| 
						 | 
					@ -194,8 +192,7 @@ START_TEST (sconv_sse_test) {
 | 
				
			||||||
END_TEST
 | 
					END_TEST
 | 
				
			||||||
#endif /* defined (__i386__) || defined (__amd64__) */
 | 
					#endif /* defined (__i386__) || defined (__amd64__) */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined (__arm__) && defined (__linux__)
 | 
					#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
 | 
				
			||||||
#ifdef HAVE_NEON
 | 
					 | 
				
			||||||
START_TEST (sconv_neon_test) {
 | 
					START_TEST (sconv_neon_test) {
 | 
				
			||||||
    pa_cpu_arm_flag_t flags = 0;
 | 
					    pa_cpu_arm_flag_t flags = 0;
 | 
				
			||||||
    pa_convert_func_t orig_from_func, neon_from_func;
 | 
					    pa_convert_func_t orig_from_func, neon_from_func;
 | 
				
			||||||
| 
						 | 
					@ -235,8 +232,7 @@ START_TEST (sconv_neon_test) {
 | 
				
			||||||
    run_conv_test_s16_to_float(neon_to_func, orig_to_func, 7, true, true);
 | 
					    run_conv_test_s16_to_float(neon_to_func, orig_to_func, 7, true, true);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
END_TEST
 | 
					END_TEST
 | 
				
			||||||
#endif /* HAVE_NEON */
 | 
					#endif /* defined (__arm__) && defined (__linux__) && defined (HAVE_NEON) */
 | 
				
			||||||
#endif /* defined (__arm__) && defined (__linux__) */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int argc, char *argv[]) {
 | 
					int main(int argc, char *argv[]) {
 | 
				
			||||||
    int failed = 0;
 | 
					    int failed = 0;
 | 
				
			||||||
| 
						 | 
					@ -254,10 +250,8 @@ int main(int argc, char *argv[]) {
 | 
				
			||||||
    tcase_add_test(tc, sconv_sse2_test);
 | 
					    tcase_add_test(tc, sconv_sse2_test);
 | 
				
			||||||
    tcase_add_test(tc, sconv_sse_test);
 | 
					    tcase_add_test(tc, sconv_sse_test);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#if defined (__arm__) && defined (__linux__)
 | 
					#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
 | 
				
			||||||
#if HAVE_NEON
 | 
					 | 
				
			||||||
    tcase_add_test(tc, sconv_neon_test);
 | 
					    tcase_add_test(tc, sconv_neon_test);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    tcase_set_timeout(tc, 120);
 | 
					    tcase_set_timeout(tc, 120);
 | 
				
			||||||
    suite_add_tcase(s, tc);
 | 
					    suite_add_tcase(s, tc);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue