cpu_vsx3.cpp 432 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#if defined(__VSX__)
    #if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
        #include <altivec.h>
    #else
        #error "OpenCV only supports little-endian mode"
    #endif
#else
    #error "VSX3 is not supported"
#endif

int main()
{
    __vector unsigned char a = vec_splats((unsigned char)1);
    __vector unsigned char b = vec_splats((unsigned char)2);
    __vector unsigned char r = vec_absd(a, b);
    return 0;
}