Mercurial > vec
comparison test/test.cc @ 36:677c03c382b8
Backed out changeset e26874655738
| author | Paper <paper@tflc.us> |
|---|---|
| date | Fri, 25 Apr 2025 17:40:55 -0400 |
| parents | 41dd962abdd1 |
| children | 4b5a557aa64f |
comparison
equal
deleted
inserted
replaced
| 35:99e4539f922f | 36:677c03c382b8 |
|---|---|
| 1 #define VEC_IMPLEMENTATION | |
| 2 #include "vec/vec.h" | |
| 3 | |
| 4 #include <iostream> | |
| 5 | |
| 6 /* this test makes sure that vec can be included under C++ */ | |
| 7 int main(void) | |
| 8 { | |
| 9 int ret = 0; | |
| 10 | |
| 11 VUINT32x8_ALIGNED_ARRAY(varrin); | |
| 12 VUINT32x8_ALIGNED_ARRAY(varrout); | |
| 13 | |
| 14 for (int i = 0; i < 8; i++) | |
| 15 varrin[i] = i; | |
| 16 | |
| 17 vuint32x8 vec = vuint32x8_load_aligned(varrin); | |
| 18 vec = vuint32x8_add(vec, vec); | |
| 19 | |
| 20 vuint32x8_store_aligned(vec, varrout); | |
| 21 | |
| 22 for (int i = 0; i < 8; i++) | |
| 23 if (varrout[i] != (uint32_t)(varrin[i] + varrin[i])) | |
| 24 ret |= 1; | |
| 25 | |
| 26 return ret; | |
| 27 } |
