diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 17:21:13 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:36:02 +0200 |
commit | 6f051b2e20bafefe9b5c9c0a6811fb2ad54f768f (patch) | |
tree | f0fc5c296278f7a54685f930c1bc14c4bb2153fa /tests/test_core.py | |
parent | 37cfd33068ad6ae43fc644a6f620856d63ba68b7 (diff) |
Use do_run_from_file() for test_simd2
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 787a240d..9b8cce5a 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4557,49 +4557,10 @@ return malloc(size); def test_simd2(self): if Settings.ASM_JS: Settings.ASM_JS = 2 # does not validate - self.do_run(r''' - #include <stdio.h> - - typedef float __m128 __attribute__ ((__vector_size__ (16))); - - static inline __m128 __attribute__((always_inline)) - _mm_set_ps(const float __Z, const float __Y, const float __X, const float __W) - { - return (__m128){ __W, __X, __Y, __Z }; - } - - static inline void __attribute__((always_inline)) - _mm_store_ps(float *__P, __m128 __A) - { - *(__m128 *)__P = __A; - } - - static inline __m128 __attribute__((always_inline)) - _mm_add_ps(__m128 __A, __m128 __B) - { - return __A + __B; - } + test_path = path_from_root('tests', 'core', 'test_simd2') + src, output = (test_path + s for s in ('.in', '.out')) - using namespace std; - - int main(int argc, char ** argv) { - float __attribute__((__aligned__(16))) ar[4]; - __m128 v1 = _mm_set_ps(9.0, 4.0, 0, -9.0); - __m128 v2 = _mm_set_ps(7.0, 3.0, 2.5, 1.0); - __m128 v3 = _mm_add_ps(v1, v2); - _mm_store_ps(ar, v3); - - for (int i = 0; i < 4; i++) { - printf("%f\n", ar[i]); - } - - return 0; - } - ''', '''-8.000000 -2.500000 -7.000000 -16.000000 -''') + self.do_run_from_file(src, output) def test_simd3(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('needs ta2') |