open-power-sdk / pveclib

Power Vector Library
Apache License 2.0
29 stars 8 forks source link

Handling vec_cmpne and vec_popcnt #194

Closed munroesj52 closed 4 months ago

munroesj52 commented 4 months ago

The Power vector intrinsic reference specifies type generic vec_cmpne and vec_popcnt. Older compilers may not implement vec_cmpne but do implement vec_cmpeq which can be combined with vec_not or vec_andc/vec_orc to get the some effect. Older GCC compilers supporting power8 will provide vec_vpopcntb/vec_vpopcnth but may not provide the generic vec_popcnt for byte/halfword. Newer GCC compilers still support vec_vpopcntb/vec_vpopcnth and the generic vec_popcnt Clang compilers that support power8 and vpopcntb/h instructions only support the generic vec_popcnt . PVECLIB's vec_char_ppc.h implementations must work around this while not depending on the vec_int16_ppc.h implementation (circular dependency).