From: Carl Love Date: Fri, 1 Jun 2018 21:52:25 +0000 (+0000) Subject: altivec-35.c (foo): Add builtin test vec_madds. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3827838d31a149f18fabf8bc5225239a2668b23d;p=gcc.git altivec-35.c (foo): Add builtin test vec_madds. gcc/testsuite/ChangeLog: 2018-06-01 Carl Love * gcc.target/powerpc/altivec-35.c (foo): Add builtin test vec_madds. * gcc.target/powerpc/builtins-6-runnable.c (main): Fix typo for output. Add vec_xst_be for signed and unsigned arguments. From-SVN: r261088 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index af5f62cf6dd..29ea7ed81bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-01 Carl Love + * gcc.target/powerpc/altivec-35.c (foo): Add builtin test vec_madds. + * gcc.target/powerpc/builtins-6-runnable.c (main): Fix typo for output. + Add vec_xst_be for signed and unsigned arguments. + 2018-06-01 Steven G. Kargl PR fortran/85816 diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-35.c b/gcc/testsuite/gcc.target/powerpc/altivec-35.c index 46e8eed7fea..08365285b09 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-35.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-35.c @@ -1,3 +1,4 @@ + /* { dg-do compile } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec -mno-vsx -mno-power8-vector -O0" } */ @@ -19,7 +20,10 @@ void foo (vector signed int *vsir, *vssr++ = vec_madd (vssa, vusb, vusc); *vssr++ = vec_madd (vusa, vssb, vssc); *vusr++ = vec_madd (vusa, vusb, vusc); + + *vssr++ = vec_madds (vssa, vssb, vssc); } /* { dg-final { scan-assembler-times "vaddcuw" 1 } } */ /* { dg-final { scan-assembler-times "vmladduhm" 4 } } */ +/* { dg-final { scan-assembler-times "vmhaddshs" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c index 146f8b73c98..a175890d5a3 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { le } } } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mcpu=power9 -O1" } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c index 5d313124b86..380a11a9a1b 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-6-runnable.c @@ -60,11 +60,11 @@ void print_uc (vector unsigned char vec_expected, { int i; - printf("expected signed char data\n"); + printf("expected unsigned char data\n"); for (i = 0; i < 16; i++) printf(" %d,", vec_expected[i]); - printf("\nactual signed char data\n"); + printf("\nactual unsigned char data\n"); for (i = 0; i < 16; i++) printf(" %d,", vec_actual[i]); printf("\n"); @@ -197,13 +197,11 @@ void print_ull (vector unsigned long long vec_expected, printf("expected unsigned long long data\n"); for (i = 0; i < 2; i++) - // printf(" %llu,", vec_expected[i]); - printf(" 0x%llx,", vec_expected[i]); + printf(" %llu,", vec_expected[i]); printf("\nactual unsigned long long data\n"); for (i = 0; i < 2; i++) - // printf(" %llu,", vec_actual[i]); - printf("0x %llx,", vec_actual[i]); + printf(" %llu,", vec_actual[i]); printf("\n"); } @@ -745,6 +743,56 @@ int main() { #endif } + disp = 8; +#ifdef __BIG_ENDIAN__ + vec_si_expected1 = (vector signed int){ 0, 0, -8, -7 }; +#else + vec_si_expected1 = (vector signed int){ 0, 0, -5, -6 }; +#endif + store_data_si = (vector signed int){ -8, -7, -6, -5 }; + + for (i=0; i<4; i++) + vec_si_result1[i] = 0; + + address_si = &vec_si_result1[0]; + + vec_xst_be (store_data_si, disp, address_si); + + if (result_wrong_si (vec_si_expected1, vec_si_result1)) + { +#ifdef DEBUG + printf("Error: vec_xst_be, si disp = %d, result does not match expected result\n", disp); + print_si (vec_si_expected1, vec_si_result1); +#else + abort(); +#endif + } + + disp = 0; +#ifdef __BIG_ENDIAN__ + vec_ui_expected1 = (vector unsigned int){ 0, 1, 2, 3 }; +#else + vec_ui_expected1 = (vector unsigned int){ 3, 2, 1, 0 }; +#endif + store_data_ui = (vector unsigned int){ 0, 1, 2, 3 }; + + for (i=0; i<4; i++) + vec_ui_result1[i] = 0; + + address_ui = &vec_ui_result1[0]; + + vec_xst_be (store_data_ui, disp, address_ui); + + if (result_wrong_ui (vec_ui_expected1, vec_ui_result1)) + { +#ifdef DEBUG + printf("Error: vec_xst_be, ui disp = 0, result does not match expected result\n"); + print_ui (vec_ui_expected1, vec_ui_result1); +#else + abort(); +#endif + } + disp = 0; #ifdef __BIG_ENDIAN__ vec_ss_expected1 = (vector signed short int){ -4, -3, -2, -1, 0, 1, 2, 3 }; @@ -972,7 +1020,6 @@ int main() { #endif } -#if 0 disp = 0; #ifdef __BIG_ENDIAN__ vec_f_expected1 = (vector float){ 0.0, 1.2, 2.3, 3.4 }; @@ -997,5 +1044,4 @@ int main() { abort(); #endif } -#endif }