File: simd_tests.cpp

package info (click to toggle)
supercollider-sc3-plugins 3.13.0~repack-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,104 kB
  • sloc: cpp: 303,352; lisp: 9,589; ansic: 3,547; sh: 96; makefile: 87; haskell: 21
file content (35 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#define BOOST_TEST_MAIN
#include <boost/test/included/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>

#include <cmath>

#ifdef __SSE__
#include "../simd_utils.hpp"

using namespace nova;
using namespace std;


void test_register(__m128 arg, float f)
{
    float data[4];
    _mm_storeu_ps(data, arg);
    for (int i = 0; i != 4; ++ i)
        BOOST_REQUIRE_EQUAL(data[i], f);
}


BOOST_AUTO_TEST_CASE( utils_test )
{
    test_register(detail::gen_one(), 1.f);
    test_register(detail::gen_05(), 0.5f);
    test_register(detail::gen_025(), 0.25f);
}

#endif

BOOST_AUTO_TEST_CASE( dummy_test )
{
}