From 6f37b4a4757ea3eb00c76162cc37f8a56c3b8bdb Mon Sep 17 00:00:00 2001 From: mtklein Date: Mon, 14 Dec 2015 11:25:18 -0800 Subject: Unify some SkNx code - one base case and one N=1 case instead of two each (or three with doubles) - use SkNx_cast instead of FromBytes/toBytes - 4-at-a-time Sk4f::ToBytes becomes a special standalone Sk4f_ToBytes If I did everything right, this'll be perf- and pixel- neutral. https://gold.skia.org/search2?issue=1526523003&unt=true&query=source_type%3Dgm&master=false BUG=skia: CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1526523003 --- bench/Sk4fBench.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bench/Sk4fBench.cpp') diff --git a/bench/Sk4fBench.cpp b/bench/Sk4fBench.cpp index b2f2b4a58e..1daa3f2973 100644 --- a/bench/Sk4fBench.cpp +++ b/bench/Sk4fBench.cpp @@ -33,8 +33,8 @@ struct Sk4fBytesRoundtripBench : public Benchmark { for (int i = 0; i < loops; i++) { uint32_t color = lcg_rand(&seed), back; - auto f = Sk4f::FromBytes((const uint8_t*)&color); - f.toBytes((uint8_t*)&back); + auto f = SkNx_cast(Sk4b::Load((const uint8_t*)&color)); + SkNx_cast(f).store((uint8_t*)&back); junk ^= back; } blackhole ^= junk; @@ -62,7 +62,7 @@ struct Sk4fGradientBench : public Benchmark { c = b + dcdx, d = c + dcdx; for (size_t i = 0; i < SK_ARRAY_COUNT(fDevice); i += 4) { - Sk4f::ToBytes((uint8_t*)(fDevice+i), a, b, c, d); + Sk4f_ToBytes((uint8_t*)(fDevice+i), a, b, c, d); a = a + dcdx4; b = b + dcdx4; c = c + dcdx4; -- cgit v1.2.3