[PATCH 2/6] tests: Test both, SSE and SSE2, sconv in cpu-test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Freitag, den 04.01.2013, 23:05 +0100 schrieb Peter Meerwald:
> From: Peter Meerwald <p.meerwald at bct-electronic.com>
> 
> SSE sconv was not tested before, only SSE2 was

With what processor did you test?

> Signed-off-by: Peter Meerwald <p.meerwald at bct-electronic.com>
> ---
>  src/tests/cpu-test.c |   32 ++++++++++++++++++++++++++++++--
>  1 file changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/src/tests/cpu-test.c b/src/tests/cpu-test.c
> index 8e196e5..205a891 100644
> --- a/src/tests/cpu-test.c
> +++ b/src/tests/cpu-test.c
> @@ -347,7 +347,7 @@ static void run_conv_test_s16_to_float(pa_convert_func_t func, pa_convert_func_t
>  #endif /* defined (__arm__) && defined (__linux__) */
>  
>  #if defined (__i386__) || defined (__amd64__)
> -START_TEST (sconv_sse_test) {
> +START_TEST (sconv_sse2_test) {

Maybe sort it lexicographically? 

>      pa_cpu_x86_flag_t flags = 0;
>      pa_convert_func_t orig_func, sse_func;
>  
> @@ -359,7 +359,34 @@ START_TEST (sconv_sse_test) {
>      }
>  
>      orig_func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE);
> -    pa_convert_func_init_sse(flags);
> +    pa_convert_func_init_sse(PA_CPU_X86_SSE2);
> +    sse_func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE);
> +
> +    pa_log_debug("Checking SSE2 sconv (float -> s16)");
> +    run_conv_test_float_to_s16(sse_func, orig_func, 0, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 1, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 2, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 3, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 4, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 5, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 6, TRUE, FALSE);
> +    run_conv_test_float_to_s16(sse_func, orig_func, 7, TRUE, TRUE);
> +}
> +END_TEST

Am I right, that you change the SSE2 test too? If yes, could you do that
in a separate test?

> +
> +START_TEST (sconv_sse_test) {
> +    pa_cpu_x86_flag_t flags = 0;
> +    pa_convert_func_t orig_func, sse_func;
> +
> +    pa_cpu_get_x86_flags(&flags);
> +
> +    if (!(flags & PA_CPU_X86_SSE)) {
> +        pa_log_info("SSE not supported. Skipping");
> +        return;
> +    }
> +
> +    orig_func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE);
> +    pa_convert_func_init_sse(PA_CPU_X86_SSE);
>      sse_func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE);
>  
>      pa_log_debug("Checking SSE sconv (float -> s16)");
> @@ -450,6 +477,7 @@ int main(int argc, char *argv[]) {
>      /* Converstion tests */
>      tc = tcase_create("sconv");
>  #if defined (__i386__) || defined (__amd64__)
> +    tcase_add_test(tc, sconv_sse2_test);
>      tcase_add_test(tc, sconv_sse_test);
>  #endif
>  #if defined (__arm__) && defined (__linux__)


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20130105/a9594387/attachment.pgp>


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux