Lines Matching refs:r
14 static void test_Nf(skiatest::Reporter* r) { in test_Nf() argument
23 REPORTER_ASSERT(r, ok); in test_Nf()
27 REPORTER_ASSERT(r, ok); in test_Nf()
64 REPORTER_ASSERT(r, (a == b).allTrue()); in test_Nf()
65 REPORTER_ASSERT(r, (a+b == a*b-b).anyTrue()); in test_Nf()
66 REPORTER_ASSERT(r, !(a+b == a*b-b).allTrue()); in test_Nf()
67 REPORTER_ASSERT(r, !(a+b == a*b).anyTrue()); in test_Nf()
68 REPORTER_ASSERT(r, !(a != b).anyTrue()); in test_Nf()
69 REPORTER_ASSERT(r, (a < fours).anyTrue()); in test_Nf()
70 REPORTER_ASSERT(r, (a <= fours).anyTrue()); in test_Nf()
71 REPORTER_ASSERT(r, !(a > fours).allTrue()); in test_Nf()
72 REPORTER_ASSERT(r, !(a >= fours).allTrue()); in test_Nf()
75 DEF_TEST(SkNf, r) { in DEF_TEST() argument
76 test_Nf<2>(r); in DEF_TEST()
77 test_Nf<4>(r); in DEF_TEST()
81 void test_Ni(skiatest::Reporter* r) { in test_Ni() argument
87 case 8: REPORTER_ASSERT(r, vals[4] == e && vals[5] == f && vals[6] == g && vals[7] == h); in test_Ni()
88 case 4: REPORTER_ASSERT(r, vals[2] == c && vals[3] == d); in test_Ni()
89 case 2: REPORTER_ASSERT(r, vals[0] == a && vals[1] == b); in test_Ni()
92 case 8: REPORTER_ASSERT(r, v[4] == e && v[5] == f && in test_Ni()
94 case 4: REPORTER_ASSERT(r, v[2] == c && v[3] == d); in test_Ni()
95 case 2: REPORTER_ASSERT(r, v[0] == a && v[1] == b); in test_Ni()
118 REPORTER_ASSERT(r, a[1] == 2); in test_Ni()
121 DEF_TEST(SkNx, r) { in DEF_TEST() argument
122 test_Ni<2, uint16_t>(r); in DEF_TEST()
123 test_Ni<4, uint16_t>(r); in DEF_TEST()
124 test_Ni<8, uint16_t>(r); in DEF_TEST()
126 test_Ni<2, int>(r); in DEF_TEST()
127 test_Ni<4, int>(r); in DEF_TEST()
128 test_Ni<8, int>(r); in DEF_TEST()
131 DEF_TEST(SkNi_min_lt, r) { in DEF_TEST() argument
136 REPORTER_ASSERT(r, Sk16b::Min(aw, bw)[0] == SkTMin(a, b)); in DEF_TEST()
137 REPORTER_ASSERT(r, !(aw < bw)[0] == !(a < b)); in DEF_TEST()
146 REPORTER_ASSERT(r, Sk16h::Min(Sk16h(a), Sk16h(b))[0] == SkTMin(a, b)); in DEF_TEST()
151 REPORTER_ASSERT(r, Sk16h::Min(Sk16h(a), Sk16h(b))[0] == SkTMin(a, b)); in DEF_TEST()
156 DEF_TEST(SkNi_saturatedAdd, r) { in DEF_TEST() argument
163 REPORTER_ASSERT(r, Sk16b(a).saturatedAdd(Sk16b(b))[0] == exact); in DEF_TEST()
168 DEF_TEST(SkNi_mulHi, r) { in DEF_TEST() argument
176 REPORTER_ASSERT(r, c[0] == q[0]); in DEF_TEST()
177 REPORTER_ASSERT(r, c[1] == q[1]); in DEF_TEST()
178 REPORTER_ASSERT(r, c[2] == q[2]); in DEF_TEST()
179 REPORTER_ASSERT(r, c[3] == q[3]); in DEF_TEST()
182 DEF_TEST(Sk4px_muldiv255round, r) { in DEF_TEST() argument
193 REPORTER_ASSERT(r, correct == exact); in DEF_TEST()
197 REPORTER_ASSERT(r, fast-exact >= -1 && fast-exact <= 1); in DEF_TEST()
199 REPORTER_ASSERT(r, fast == exact); in DEF_TEST()
205 DEF_TEST(SkNx_abs, r) { in DEF_TEST() argument
207 REPORTER_ASSERT(r, fs[0] == 0.0f); in DEF_TEST()
208 REPORTER_ASSERT(r, fs[1] == 0.0f); in DEF_TEST()
209 REPORTER_ASSERT(r, fs[2] == 2.0f); in DEF_TEST()
210 REPORTER_ASSERT(r, fs[3] == 4.0f); in DEF_TEST()
213 REPORTER_ASSERT(r, fshi[0] == 0.0f); in DEF_TEST()
214 REPORTER_ASSERT(r, fshi[1] == 0.0f); in DEF_TEST()
215 REPORTER_ASSERT(r, fslo[0] == 2.0f); in DEF_TEST()
216 REPORTER_ASSERT(r, fslo[1] == 4.0f); in DEF_TEST()
219 DEF_TEST(Sk4i_abs, r) { in DEF_TEST() argument
221 REPORTER_ASSERT(r, is[0] == 0); in DEF_TEST()
222 REPORTER_ASSERT(r, is[1] == 1); in DEF_TEST()
223 REPORTER_ASSERT(r, is[2] == 2); in DEF_TEST()
224 REPORTER_ASSERT(r, is[3] == 2147483647); in DEF_TEST()
227 DEF_TEST(Sk4i_minmax, r) { in DEF_TEST() argument
233 REPORTER_ASSERT(r, min[i] == SkTMin(a[i], b[i])); in DEF_TEST()
234 REPORTER_ASSERT(r, max[i] == SkTMax(a[i], b[i])); in DEF_TEST()
238 DEF_TEST(SkNx_floor, r) { in DEF_TEST() argument
240 REPORTER_ASSERT(r, fs[0] == 0.0f); in DEF_TEST()
241 REPORTER_ASSERT(r, fs[1] == -1.0f); in DEF_TEST()
242 REPORTER_ASSERT(r, fs[2] == 0.0f); in DEF_TEST()
243 REPORTER_ASSERT(r, fs[3] == -1.0f); in DEF_TEST()
246 REPORTER_ASSERT(r, fs2[0] == 0.0f); in DEF_TEST()
247 REPORTER_ASSERT(r, fs2[1] == -1.0f); in DEF_TEST()
250 REPORTER_ASSERT(r, fs3[0] == 0.0f); in DEF_TEST()
251 REPORTER_ASSERT(r, fs3[1] == -1.0f); in DEF_TEST()
254 DEF_TEST(SkNx_shuffle, r) { in DEF_TEST() argument
258 REPORTER_ASSERT(r, f2[0] == 20); in DEF_TEST()
259 REPORTER_ASSERT(r, f2[1] == 10); in DEF_TEST()
262 REPORTER_ASSERT(r, f4[0] == 20); in DEF_TEST()
263 REPORTER_ASSERT(r, f4[1] == 10); in DEF_TEST()
264 REPORTER_ASSERT(r, f4[2] == 10); in DEF_TEST()
265 REPORTER_ASSERT(r, f4[3] == 20); in DEF_TEST()
268 DEF_TEST(SkNx_int_float, r) { in DEF_TEST() argument
272 REPORTER_ASSERT(r, i[0] == -2); in DEF_TEST()
273 REPORTER_ASSERT(r, i[1] == 1); in DEF_TEST()
274 REPORTER_ASSERT(r, i[2] == 0); in DEF_TEST()
275 REPORTER_ASSERT(r, i[3] == 0); in DEF_TEST()
278 REPORTER_ASSERT(r, f[0] == -2.0f); in DEF_TEST()
279 REPORTER_ASSERT(r, f[1] == 1.0f); in DEF_TEST()
280 REPORTER_ASSERT(r, f[2] == 0.0f); in DEF_TEST()
281 REPORTER_ASSERT(r, f[3] == 0.0f); in DEF_TEST()
286 DEF_TEST(SkNx_u16_float, r) { in DEF_TEST() argument
291 REPORTER_ASSERT(r, f4[0] == 15.0f); in DEF_TEST()
292 REPORTER_ASSERT(r, f4[1] == 17.0f); in DEF_TEST()
293 REPORTER_ASSERT(r, f4[2] == 257.0f); in DEF_TEST()
294 REPORTER_ASSERT(r, f4[3] == 65535.0f); in DEF_TEST()
300 REPORTER_ASSERT(r, h4[0] == 15); in DEF_TEST()
301 REPORTER_ASSERT(r, h4[1] == 17); in DEF_TEST()
302 REPORTER_ASSERT(r, h4[2] == 257); in DEF_TEST()
303 REPORTER_ASSERT(r, h4[3] == 65535); in DEF_TEST()
319 REPORTER_ASSERT(r, !memcmp(s16, d16, sizeof(s16))); in DEF_TEST()
324 DEF_TEST(SkNx_int_u16, r) { in DEF_TEST() argument
330 REPORTER_ASSERT(r, expected == actual); in DEF_TEST()
338 REPORTER_ASSERT(r, expected == actual); in DEF_TEST()
342 DEF_TEST(SkNx_4fLoad4Store4, r) { in DEF_TEST() argument
352 REPORTER_ASSERT(r, 0.0f == a[0]); in DEF_TEST()
353 REPORTER_ASSERT(r, 4.0f == a[1]); in DEF_TEST()
354 REPORTER_ASSERT(r, 8.0f == a[2]); in DEF_TEST()
355 REPORTER_ASSERT(r, 12.0f == a[3]); in DEF_TEST()
356 REPORTER_ASSERT(r, 1.0f == b[0]); in DEF_TEST()
357 REPORTER_ASSERT(r, 5.0f == b[1]); in DEF_TEST()
358 REPORTER_ASSERT(r, 9.0f == b[2]); in DEF_TEST()
359 REPORTER_ASSERT(r, 13.0f == b[3]); in DEF_TEST()
360 REPORTER_ASSERT(r, 2.0f == c[0]); in DEF_TEST()
361 REPORTER_ASSERT(r, 6.0f == c[1]); in DEF_TEST()
362 REPORTER_ASSERT(r, 10.0f == c[2]); in DEF_TEST()
363 REPORTER_ASSERT(r, 14.0f == c[3]); in DEF_TEST()
364 REPORTER_ASSERT(r, 3.0f == d[0]); in DEF_TEST()
365 REPORTER_ASSERT(r, 7.0f == d[1]); in DEF_TEST()
366 REPORTER_ASSERT(r, 11.0f == d[2]); in DEF_TEST()
367 REPORTER_ASSERT(r, 15.0f == d[3]); in DEF_TEST()
371 REPORTER_ASSERT(r, 0 == memcmp(dst, src, 16 * sizeof(float))); in DEF_TEST()
374 DEF_TEST(SkNx_neg, r) { in DEF_TEST() argument
376 REPORTER_ASSERT(r, fs[0] == 0.0f); in DEF_TEST()
377 REPORTER_ASSERT(r, fs[1] == 0.0f); in DEF_TEST()
378 REPORTER_ASSERT(r, fs[2] == -2.0f); in DEF_TEST()
379 REPORTER_ASSERT(r, fs[3] == 4.0f); in DEF_TEST()
382 REPORTER_ASSERT(r, fshi[0] == 0.0f); in DEF_TEST()
383 REPORTER_ASSERT(r, fshi[1] == 0.0f); in DEF_TEST()
384 REPORTER_ASSERT(r, fslo[0] == -2.0f); in DEF_TEST()
385 REPORTER_ASSERT(r, fslo[1] == 4.0f); in DEF_TEST()
388 DEF_TEST(SkNx_thenElse, r) { in DEF_TEST() argument
390 REPORTER_ASSERT(r, fs[0] == 1); in DEF_TEST()
391 REPORTER_ASSERT(r, fs[1] == 1); in DEF_TEST()
392 REPORTER_ASSERT(r, fs[2] == 1); in DEF_TEST()
393 REPORTER_ASSERT(r, fs[3] == -1); in DEF_TEST()
396 REPORTER_ASSERT(r, fshi[0] == 1); in DEF_TEST()
397 REPORTER_ASSERT(r, fshi[1] == 1); in DEF_TEST()
398 REPORTER_ASSERT(r, fslo[0] == 1); in DEF_TEST()
399 REPORTER_ASSERT(r, fslo[1] == -1); in DEF_TEST()
402 DEF_TEST(Sk4f_Load2, r) { in DEF_TEST() argument
408 REPORTER_ASSERT(r, x[0] == 0); in DEF_TEST()
409 REPORTER_ASSERT(r, x[1] == 2); in DEF_TEST()
410 REPORTER_ASSERT(r, x[2] == 4); in DEF_TEST()
411 REPORTER_ASSERT(r, x[3] == 6); in DEF_TEST()
413 REPORTER_ASSERT(r, y[0] == 1); in DEF_TEST()
414 REPORTER_ASSERT(r, y[1] == 3); in DEF_TEST()
415 REPORTER_ASSERT(r, y[2] == 5); in DEF_TEST()
416 REPORTER_ASSERT(r, y[3] == 7); in DEF_TEST()
419 DEF_TEST(Sk2f_Load2, r) { in DEF_TEST() argument
425 REPORTER_ASSERT(r, x[0] == 0); in DEF_TEST()
426 REPORTER_ASSERT(r, x[1] == 2); in DEF_TEST()
428 REPORTER_ASSERT(r, y[0] == 1); in DEF_TEST()
429 REPORTER_ASSERT(r, y[1] == 3); in DEF_TEST()
432 DEF_TEST(Sk2f_Store2, r) { in DEF_TEST() argument
437 REPORTER_ASSERT(r, dst[0] == 0); in DEF_TEST()
438 REPORTER_ASSERT(r, dst[1] == 1); in DEF_TEST()
439 REPORTER_ASSERT(r, dst[2] == 2); in DEF_TEST()
440 REPORTER_ASSERT(r, dst[3] == 3); in DEF_TEST()
443 DEF_TEST(Sk2f_Store3, r) { in DEF_TEST() argument
449 REPORTER_ASSERT(r, dst[0] == 0); in DEF_TEST()
450 REPORTER_ASSERT(r, dst[1] == 1); in DEF_TEST()
451 REPORTER_ASSERT(r, dst[2] == 2); in DEF_TEST()
452 REPORTER_ASSERT(r, dst[3] == 3); in DEF_TEST()
453 REPORTER_ASSERT(r, dst[4] == 4); in DEF_TEST()
454 REPORTER_ASSERT(r, dst[5] == 5); in DEF_TEST()
457 DEF_TEST(Sk2f_Store4, r) { in DEF_TEST() argument
465 REPORTER_ASSERT(r, dst[0] == 0); in DEF_TEST()
466 REPORTER_ASSERT(r, dst[1] == 1); in DEF_TEST()
467 REPORTER_ASSERT(r, dst[2] == 2); in DEF_TEST()
468 REPORTER_ASSERT(r, dst[3] == 3); in DEF_TEST()
469 REPORTER_ASSERT(r, dst[4] == 4); in DEF_TEST()
470 REPORTER_ASSERT(r, dst[5] == 5); in DEF_TEST()
471 REPORTER_ASSERT(r, dst[6] == 6); in DEF_TEST()
472 REPORTER_ASSERT(r, dst[7] == 7); in DEF_TEST()
477 REPORTER_ASSERT(r, dst4f[0][0] == 0); in DEF_TEST()
478 REPORTER_ASSERT(r, dst4f[0][1] == 1); in DEF_TEST()
479 REPORTER_ASSERT(r, dst4f[0][2] == 2); in DEF_TEST()
480 REPORTER_ASSERT(r, dst4f[0][3] == 3); in DEF_TEST()
481 REPORTER_ASSERT(r, dst4f[1][0] == 4); in DEF_TEST()
482 REPORTER_ASSERT(r, dst4f[1][1] == 5); in DEF_TEST()
483 REPORTER_ASSERT(r, dst4f[1][2] == 6); in DEF_TEST()
484 REPORTER_ASSERT(r, dst4f[1][3] == 7); in DEF_TEST()
488 DEF_TEST(Sk4f_minmax, r) { in DEF_TEST() argument
489 REPORTER_ASSERT(r, 3 == Sk4f(0,1,2,3).max()); in DEF_TEST()
490 REPORTER_ASSERT(r, 2 == Sk4f(1,-5,2,-1).max()); in DEF_TEST()
491 REPORTER_ASSERT(r, -1 == Sk4f(-2,-1,-6,-3).max()); in DEF_TEST()
492 REPORTER_ASSERT(r, 3 == Sk4f(3,2,1,0).max()); in DEF_TEST()
494 REPORTER_ASSERT(r, 0 == Sk4f(0,1,2,3).min()); in DEF_TEST()
495 REPORTER_ASSERT(r, -5 == Sk4f(1,-5,2,-1).min()); in DEF_TEST()
496 REPORTER_ASSERT(r, -6 == Sk4f(-2,-1,-6,-3).min()); in DEF_TEST()
497 REPORTER_ASSERT(r, 0 == Sk4f(3,2,1,0).min()); in DEF_TEST()
500 DEF_TEST(SkNf_anyTrue_allTrue, r) { in DEF_TEST() argument
501 REPORTER_ASSERT(r, (Sk2f{1,2} < Sk2f{3,4}).anyTrue()); in DEF_TEST()
502 REPORTER_ASSERT(r, (Sk2f{1,2} < Sk2f{3,4}).allTrue()); in DEF_TEST()
503 REPORTER_ASSERT(r, (Sk2f{3,2} < Sk2f{1,4}).anyTrue()); in DEF_TEST()
504 REPORTER_ASSERT(r, !(Sk2f{3,2} < Sk2f{1,4}).allTrue()); in DEF_TEST()
505 REPORTER_ASSERT(r, !(Sk2f{3,4} < Sk2f{1,2}).anyTrue()); in DEF_TEST()
507 REPORTER_ASSERT(r, (Sk4f{1,2,3,4} < Sk4f{3,4,5,6}).anyTrue()); in DEF_TEST()
508 REPORTER_ASSERT(r, (Sk4f{1,2,3,4} < Sk4f{3,4,5,6}).allTrue()); in DEF_TEST()
509 REPORTER_ASSERT(r, (Sk4f{1,2,3,4} < Sk4f{1,4,1,1}).anyTrue()); in DEF_TEST()
510 REPORTER_ASSERT(r, !(Sk4f{1,2,3,4} < Sk4f{1,4,1,1}).allTrue()); in DEF_TEST()
511 REPORTER_ASSERT(r, !(Sk4f{3,4,5,6} < Sk4f{1,2,3,4}).anyTrue()); in DEF_TEST()