15#define SK_OPTS_NS RPOptsTest
18#pragma clang diagnostic push
19#pragma clang diagnostic ignored "-Wunused-function"
20#elif defined(__GNUC__)
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wunused-function"
23#pragma GCC diagnostic ignored "-Wunused-variable"
29#pragma clang diagnostic pop
30#elif defined(__GNUC__)
31#pragma GCC diagnostic pop
41 std::array<int32_t, N> masks;
42 for (
size_t idx = 0; idx <
N; ++idx) {
43 masks[idx] = (
bits & 1) ? ~0 : 0;
51 static constexpr size_t N =
sizeof(
I32) /
sizeof(int32_t);
55 std::array<int32_t, N> masks = make_masks<N>(
value);
56 I32 i = sk_unaligned_load<I32>(masks.data());
60 [](int32_t
m) { return m != 0; }));
65 static constexpr size_t N =
sizeof(
I32) /
sizeof(int32_t);
69 std::array<int32_t, N> masks = make_masks<N>(
value);
70 I32 i = sk_unaligned_load<I32>(masks.data());
74 [](int32_t
m) { return m != 0; }));
81 for (
float rad = -5*Pi; rad <= 5*Pi; rad += 0.1f) {
83 F expected =
F_(std::sin(rad));
93 for (
float rad = -5*Pi; rad <= 5*Pi; rad += 0.1f) {
95 F expected =
F_(std::cos(rad));
110 for (
float period : {0.0f, -3*Pi, 3*Pi}) {
113 F expected =
F_(std::tan(rad));
123 for (
float x = -1;
x <= 1;
x += 1.0f/64) {
125 F expected =
F_(asinf(
x));
134 for (
float x = -1;
x <= 1;
x += 1.0f/64) {
136 F expected =
F_(acosf(
x));
145 for (
float x = -10.0f;
x <= 10.0f;
x += 0.1f) {
147 F expected =
F_(atanf(
x));
156 for (
float y = -3.0f;
y <= 3.0f;
y += 0.1f) {
157 for (
float x = -3.0f;
x <= 3.0f;
x += 0.1f) {
159 F expected =
F_(std::atan2(
y,
x));
169 for (
float value : {0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f}) {
180 for (
float value : {-80, -5, -2, -1, 0, 1, 2, 3, 5}) {
182 F expected =
F_(std::pow(2.0,
value));
static constexpr float kTolerance
static constexpr double kEpsilon
DEF_TEST(SkRasterPipelineOpts_Any, r)
static std::array< int32_t, N > make_masks(int bits)
#define REPORTER_ASSERT(r, cond,...)
SI constexpr F F_(float x)