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]);
-/* { 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" } */
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
printf("expected_uint128[0] = %llx ", expected_uint128[0] >> 64);
printf(" %llx\n", expected_uint128[0] & 0xFFFFFFFFFFFFFFFF);
#else
- abort();
+ abort();
#endif
}
printf("expected_int128[0] = %llx ", expected_int128[0] >> 64);
printf(" %llx\n", expected_int128[0] & 0xFFFFFFFFFFFFFFFF);
#else
- abort();
+ abort();
#endif
}
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 */
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
}
}