@@ -797,3 +797,23 @@ static_assert(__builtin_reduce_xor((vector4int){(int)0x11111111, (int)0x22222222
797797static_assert (__builtin_reduce_xor((vector4long){(long long )0x1111111111111111L , (long long )0x2222222222222222L , (long long )0x4444444444444444L , (long long )0x8888888888888888L }) == (long long )0xFFFFFFFFFFFFFFFFL );
798798static_assert (__builtin_reduce_xor((vector4uint){0x11111111U , 0x22222222U , 0x44444444U , 0x88888888U }) == 0xFFFFFFFFU );
799799static_assert (__builtin_reduce_xor((vector4ulong){0x1111111111111111UL , 0x2222222222222222UL , 0x4444444444444444UL , 0x8888888888888888UL }) == 0xFFFFFFFFFFFFFFFFUL );
800+
801+ static_assert (__builtin_bit_cast(unsigned , __builtin_elementwise_popcount((vector4char){1 , 2 , 3 , 4 })) == (LITTLE_END ? 0x01020101 : 0x01010201 ));
802+ static_assert (__builtin_bit_cast(unsigned long long , __builtin_elementwise_popcount((vector4short){0 , 0x0F0F , ~0 , ~0x0F0F })) == (LITTLE_END ? 0x0008001000080000 : 0x0000000800100008 ));
803+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4int){1 , 2 , 3 , 4 })) == 5 );
804+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4int){0 , 0xF0F0 , ~0 , ~0xF0F0 })) == 16 * sizeof (int ));
805+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4long){1L , 2L , 3L , 4L })) == 5L );
806+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4long){0L , 0xF0F0L , ~0L , ~0xF0F0L })) == 16 * sizeof (long long ));
807+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4uint){1U , 2U , 3U , 4U })) == 5U );
808+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4uint){0U , 0xF0F0U , ~0U , ~0xF0F0U })) == 16 * sizeof (int ));
809+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4ulong){1UL , 2UL , 3UL , 4UL })) == 5UL );
810+ static_assert (__builtin_reduce_add(__builtin_elementwise_popcount((vector4ulong){0ULL , 0xF0F0ULL , ~0ULL , ~0xF0F0ULL })) == 16 * sizeof (unsigned long long ));
811+ static_assert (__builtin_elementwise_popcount(0 ) == 0 );
812+ static_assert (__builtin_elementwise_popcount(0xF0F0 ) == 8 );
813+ static_assert (__builtin_elementwise_popcount(~0 ) == 8 * sizeof (int ));
814+ static_assert (__builtin_elementwise_popcount(0U ) == 0 );
815+ static_assert (__builtin_elementwise_popcount(0xF0F0U ) == 8 );
816+ static_assert (__builtin_elementwise_popcount(~0U ) == 8 * sizeof (int ));
817+ static_assert (__builtin_elementwise_popcount(0L ) == 0 );
818+ static_assert (__builtin_elementwise_popcount(0xF0F0L ) == 8 );
819+ static_assert (__builtin_elementwise_popcount(~0LL ) == 8 * sizeof (long long ));
0 commit comments