Mercurial > vec
view test/test.cc @ 21:697b9ba1c1de
impl/ppc/altivec: implement comparison functions
had to prune some up eh, vec_cmple/vec_cmpge is only available in
VSX
author | Paper <paper@tflc.us> |
---|---|
date | Thu, 21 Nov 2024 21:55:20 +0000 |
parents | 41dd962abdd1 |
children |
line wrap: on
line source
#define VEC_IMPLEMENTATION #include "vec/vec.h" #include <iostream> /* this test makes sure that vec can be included under C++ */ int main(void) { int ret = 0; VUINT32x8_ALIGNED_ARRAY(varrin); VUINT32x8_ALIGNED_ARRAY(varrout); for (int i = 0; i < 8; i++) varrin[i] = i; vuint32x8 vec = vuint32x8_load_aligned(varrin); vec = vuint32x8_add(vec, vec); vuint32x8_store_aligned(vec, varrout); for (int i = 0; i < 8; i++) if (varrout[i] != (uint32_t)(varrin[i] + varrin[i])) ret |= 1; return ret; }