From 17636f266251d9d6bcc79f3b64cd275f63867a9a Mon Sep 17 00:00:00 2001 From: Carl Love Date: Tue, 14 Nov 2017 17:23:08 +0000 Subject: [PATCH] rs6000.c (swap_endian_selector_for_mode): Remove le_ and be_ prefixes to swap* variables. gcc/ChangeLog: 2017-11-14 Carl Love * config/rs6000/rs6000.c (swap_endian_selector_for_mode): Remove le_ and be_ prefixes to swap* variables. Remove if (VECTOR_ELT_ORDER_BIG) statement. Remove E_V16QImode case statements. gcc/testsuite/ChangeLog: 2017-11-14 Carl Love * builtins-revb-runnable.c (dg-do run): Add lp64 directive. Fix indentation of printf and abort statements. * p9-xxbr-1.c (dg-do compile): Add lp64 && p9vector_h directives. From-SVN: r254732 --- gcc/ChangeLog | 7 ++ gcc/config/rs6000/rs6000.c | 81 ++++++------------- gcc/testsuite/ChangeLog | 6 ++ .../powerpc/builtins-revb-runnable.c | 68 ++++++++-------- gcc/testsuite/gcc.target/powerpc/p9-xxbr-1.c | 11 ++- 5 files changed, 75 insertions(+), 98 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 199ac5c30cb..b80a4211c75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-11-14 Carl Love + + * config/rs6000/rs6000.c (swap_endian_selector_for_mode): Remove + le_ and be_ prefixes to swap* variables. Remove + if (VECTOR_ELT_ORDER_BIG) statement. Remove E_V16QImode case + statements. + 2017-11-14 Jason Merrill Support GTY((cache)) on hash_map. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2c80a2f2bd6..05c0c8b2919 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -14304,66 +14304,33 @@ swap_selector_for_mode (machine_mode mode) rtx swap_endian_selector_for_mode (machine_mode mode) { - unsigned int le_swap1[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - unsigned int le_swap2[16] = {7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8}; - unsigned int le_swap4[16] = {3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12}; - unsigned int le_swap8[16] = {1,0,3,2,5,4,7,6,9,8,11,10,13,12,15,14}; - unsigned int le_swap16[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - - unsigned int be_swap1[16] = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; - unsigned int be_swap2[16] = {7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8}; - unsigned int be_swap4[16] = {3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12}; - unsigned int be_swap8[16] = {1,0,3,2,5,4,7,6,9,8,11,10,13,12,15,14}; - unsigned int be_swap16[16] = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; + unsigned int swap1[16] = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; + unsigned int swap2[16] = {7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8}; + unsigned int swap4[16] = {3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12}; + unsigned int swap8[16] = {1,0,3,2,5,4,7,6,9,8,11,10,13,12,15,14}; + unsigned int *swaparray, i; rtx perm[16]; - if (VECTOR_ELT_ORDER_BIG) - switch (mode) - { - case E_V1TImode: - swaparray = le_swap1; - break; - case E_V2DFmode: - case E_V2DImode: - swaparray = le_swap2; - break; - case E_V4SFmode: - case E_V4SImode: - swaparray = le_swap4; - break; - case E_V8HImode: - swaparray = le_swap8; - break; - case E_V16QImode: - swaparray = le_swap16; - break; - default: - gcc_unreachable (); - } - else - switch (mode) - { - case E_V1TImode: - swaparray = be_swap1; - break; - case E_V2DFmode: - case E_V2DImode: - swaparray = be_swap2; - break; - case E_V4SFmode: - case E_V4SImode: - swaparray = be_swap4; - break; - case E_V8HImode: - swaparray = be_swap8; - break; - case E_V16QImode: - swaparray = be_swap16; - break; - default: - gcc_unreachable (); - } + switch (mode) + { + case E_V1TImode: + swaparray = swap1; + break; + case E_V2DFmode: + case E_V2DImode: + swaparray = swap2; + break; + case E_V4SFmode: + case E_V4SImode: + swaparray = swap4; + break; + case E_V8HImode: + swaparray = swap8; + break; + default: + gcc_unreachable (); + } for (i = 0; i < 16; ++i) perm[i] = GEN_INT (swaparray[i]); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 825623e9892..40f788061c0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-11-14 Carl Love + + * builtins-revb-runnable.c (dg-do run): Add lp64 directive. Fix + indentation of printf and abort statements. + * p9-xxbr-1.c (dg-do compile): Add lp64 && p9vector_h directives. + 2017-11-14 James Greenhalgh * gcc.target/aarch64/bsl-idiom.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c index 25bd4a2f729..b6ffa238221 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-revb-runnable.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { powerpc*-*-* && p8vector_hw } } } */ +/* { dg-do run { target { powerpc*-*-* && { lp64 && p8vector_hw } } } } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ /* { dg-options "-mcpu=power8 -O3" } */ @@ -52,10 +52,10 @@ main() for (i = 0; i < 16; i++) { if (result_bc[i] != expected_bc[i]) #ifdef DEBUG - printf("arg_bc[%d] = 0x%x, result_bc[%d] = 0x%x, expected_bc[%d] = 0x%x\n", - i, arg_bc[i], i, result_bc[i], i, expected_bc[i]); + printf("arg_bc[%d] = 0x%x, result_bc[%d] = 0x%x, expected_bc[%d] = 0x%x\n", + i, arg_bc[i], i, result_bc[i], i, expected_bc[i]); #else - abort(); + abort(); #endif } @@ -70,10 +70,10 @@ main() for (i = 0; i < 16; i++) { if (result_uc[i] != expected_uc[i]) #ifdef DEBUG - printf("arg_uc[%d] = 0x%x, result_uc[%d] = 0x%x, expected_uc[%d] = 0x%x\n", - i, arg_uc[i], i, result_uc[i], i, expected_uc[i]); + printf("arg_uc[%d] = 0x%x, result_uc[%d] = 0x%x, expected_uc[%d] = 0x%x\n", + i, arg_uc[i], i, result_uc[i], i, expected_uc[i]); #else - abort(); + abort(); #endif } @@ -88,10 +88,10 @@ main() for (i = 0; i < 16; i++) { if (result_sc[i] != expected_sc[i]) #ifdef DEBUG - printf("arg_sc[%d] = 0x%x, result_sc[%d] = 0x%x, expected_sc[%d] = 0x%x\n", + printf("arg_sc[%d] = 0x%x, result_sc[%d] = 0x%x, expected_sc[%d] = 0x%x\n", i, arg_sc[i], i, result_sc[i], i, expected_sc[i]); #else - abort(); + abort(); #endif } @@ -106,10 +106,10 @@ main() for (i = 0; i < 8; i++) { if (result_bsi[i] != expected_bsi[i]) #ifdef DEBUG - printf("arg_bsi[%d] = 0x%x, result_bsi[%d] = 0x%x, expected_bsi[%d] = 0x%x\n", + printf("arg_bsi[%d] = 0x%x, result_bsi[%d] = 0x%x, expected_bsi[%d] = 0x%x\n", i, arg_bsi[i], i, result_bsi[i], i, expected_bsi[i]); #else - abort(); + abort(); #endif } @@ -123,10 +123,10 @@ main() for (i = 0; i < 8; i++) { if (result_usi[i] != expected_usi[i]) #ifdef DEBUG - printf("arg_usi[%d] = 0x%x, result_usi[%d] = 0x%x, expected_usi[%d] = 0x%x\n", + printf("arg_usi[%d] = 0x%x, result_usi[%d] = 0x%x, expected_usi[%d] = 0x%x\n", i, arg_usi[i], i, result_usi[i], i, expected_usi[i]); #else - abort(); + abort(); #endif } @@ -140,10 +140,10 @@ main() for (i = 0; i < 8; i++) { if (result_si[i] != expected_si[i]) #ifdef DEBUG - printf("arg_si[%d] = 0x%x, result_si[%d] = 0x%x, expected_si[%d] = 0x%x\n", - i, arg_si[i], i, result_si[i], i, expected_si[i]); + printf("arg_si[%d] = 0x%x, result_si[%d] = 0x%x, expected_si[%d] = 0x%x\n", + i, arg_si[i], i, result_si[i], i, expected_si[i]); #else - abort(); + abort(); #endif } @@ -157,10 +157,10 @@ main() for (i = 0; i < 4; i++) { if (result_bi[i] != expected_bi[i]) #ifdef DEBUG - printf("arg_bi[%d] = 0x%x, result_bi[%d] = 0x%x, expected_bi[%d] = 0x%x\n", + printf("arg_bi[%d] = 0x%x, result_bi[%d] = 0x%x, expected_bi[%d] = 0x%x\n", i, arg_bi[i], i, result_bi[i], i, expected_bi[i]); #else - abort(); + abort(); #endif } @@ -174,10 +174,10 @@ main() for (i = 0; i < 4; i++) { if (result_ui[i] != expected_ui[i]) #ifdef DEBUG - printf("arg_ui[%d] = 0x%x, result_ui[%d] = 0x%x, expected_ui[%d] = 0x%x\n", + printf("arg_ui[%d] = 0x%x, result_ui[%d] = 0x%x, expected_ui[%d] = 0x%x\n", i, arg_ui[i], i, result_ui[i], i, expected_ui[i]); #else - abort(); + abort(); #endif } @@ -189,10 +189,10 @@ main() for (i = 0; i < 4; i++) { if (result_int[i] != expected_int[i]) #ifdef DEBUG - printf("arg_int[%d] = 0x%x, result_int[%d] = 0x%x, expected_int[%d] = 0x%x\n", + printf("arg_int[%d] = 0x%x, result_int[%d] = 0x%x, expected_int[%d] = 0x%x\n", i, arg_int[i], i, result_int[i], i, expected_int[i]); #else - abort(); + abort(); #endif } @@ -207,10 +207,10 @@ main() for (i = 0; i < 2; i++) { if (result_blli[i] != expected_blli[i]) #ifdef DEBUG - printf("arg_blli[%d] = 0x%x, result_blli[%d] = 0x%llx, expected_blli[%d] = 0x%llx\n", + printf("arg_blli[%d] = 0x%x, result_blli[%d] = 0x%llx, expected_blli[%d] = 0x%llx\n", i, arg_blli[i], i, result_blli[i], i, expected_blli[i]); #else - abort(); + abort(); #endif } @@ -224,10 +224,10 @@ main() for (i = 0; i < 2; i++) { if (result_ulli[i] != expected_ulli[i]) #ifdef DEBUG - printf("arg_ulli[%d] = 0x%x, result_ulli[%d] = 0x%llx, expected_ulli[%d] = 0x%llx\n", + printf("arg_ulli[%d] = 0x%x, result_ulli[%d] = 0x%llx, expected_ulli[%d] = 0x%llx\n", i, arg_ulli[i], i, result_ulli[i], i, expected_ulli[i]); #else - abort(); + abort(); #endif } @@ -240,10 +240,10 @@ main() for (i = 0; i < 2; i++) { if (result_lli[i] != expected_lli[i]) #ifdef DEBUG - printf("arg_lli[%d] = 0x%x, result_lli[%d] = 0x%llx, expected_lli[%d] = 0x%llx\n", + printf("arg_lli[%d] = 0x%x, result_lli[%d] = 0x%llx, expected_lli[%d] = 0x%llx\n", i, arg_lli[i], i, result_lli[i], i, expected_lli[i]); #else - abort(); + abort(); #endif } @@ -270,7 +270,7 @@ main() printf("expected_uint128[0] = %llx ", expected_uint128[0] >> 64); printf(" %llx\n", expected_uint128[0] & 0xFFFFFFFFFFFFFFFF); #else - abort(); + abort(); #endif } @@ -296,7 +296,7 @@ main() printf("expected_int128[0] = %llx ", expected_int128[0] >> 64); printf(" %llx\n", expected_int128[0] & 0xFFFFFFFFFFFFFFFF); #else - abort(); + abort(); #endif } @@ -313,14 +313,12 @@ main() for (i = 0; i < 4; i++) { if (result_f[i] != expected_f[i]) - { #ifdef DEBUG printf(" arg_f[%d] = %f, result_f[%d] = %f, expected_f[%d] = %f\n", - i, arg_f[i], i, result_f[i], i, expected_f[i]); + i, arg_f[i], i, result_f[i], i, expected_f[i]); #else abort(); #endif - } } /* 64-bit floats */ @@ -335,10 +333,10 @@ main() for (i = 0; i < 2; i++) { if (result_d[i] != expected_d[i]) #ifdef DEBUG - printf("arg_d[%d] = %f, result_d[%d] = %f, expected_d[%d] = %f\n", + printf("arg_d[%d] = %f, result_d[%d] = %f, expected_d[%d] = %f\n", i, arg_d[i], i, result_d[i], i, expected_d[i]); #else - abort(); + abort(); #endif } } diff --git a/gcc/testsuite/gcc.target/powerpc/p9-xxbr-1.c b/gcc/testsuite/gcc.target/powerpc/p9-xxbr-1.c index 164f11f6ea3..7a07d0f8f2a 100644 --- a/gcc/testsuite/gcc.target/powerpc/p9-xxbr-1.c +++ b/gcc/testsuite/gcc.target/powerpc/p9-xxbr-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { powerpc64*-*-* } } } */ +/* { dg-do compile { target { powerpc*-*-* && { lp64 && p9vector_hw } } } } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mcpu=power9 -O3" } */ @@ -10,25 +10,25 @@ vector char rev_char (vector char a) { - return vec_revb (a); /* XXBRQ. */ + return vec_revb (a); /* Is a NOP, maps to move inst */ } vector bool char rev_bool_char (vector bool char a) { - return vec_revb (a); /* XXBRQ. */ + return vec_revb (a); /* Is a NOP, maps to move inst */ } vector signed char rev_schar (vector signed char a) { - return vec_revb (a); /* XXBRQ. */ + return vec_revb (a); /* Is a NOP, maps to move inst */ } vector unsigned char rev_uchar (vector unsigned char a) { - return vec_revb (a); /* XXBRQ. */ + return vec_revb (a); /* Is a NOP, maps to move inst */ } vector short @@ -81,5 +81,4 @@ rev_double (vector double a) /* { dg-final { scan-assembler-times "xxbrd" 1 } } */ /* { dg-final { scan-assembler-times "xxbrh" 3 } } */ -/* { dg-final { scan-assembler-times "xxbrq" 4 } } */ /* { dg-final { scan-assembler-times "xxbrw" 4 } } */ -- 2.30.2