Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: src/core/Sk4x.h

Issue 1001453006: Add Load2/store2 to Sk4x (dumb impl for now) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/Sk4xTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef Sk4x_DEFINED 1 #ifndef Sk4x_DEFINED
2 #define Sk4x_DEFINED 2 #define Sk4x_DEFINED
3 3
4 #include "SkTypes.h" 4 #include "SkTypes.h"
5 5
6 #define SK4X_PREAMBLE 1 6 #define SK4X_PREAMBLE 1
7 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 7 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
8 #include "Sk4x_sse.h" 8 #include "Sk4x_sse.h"
9 #elif defined(SK_ARM_HAS_NEON) 9 #elif defined(SK_ARM_HAS_NEON)
10 #include "Sk4x_neon.h" 10 #include "Sk4x_neon.h"
(...skipping 19 matching lines...) Expand all
30 30
31 Sk4x(const Sk4x&); 31 Sk4x(const Sk4x&);
32 Sk4x& operator=(const Sk4x&); 32 Sk4x& operator=(const Sk4x&);
33 33
34 static Sk4x Load (const T[4]); 34 static Sk4x Load (const T[4]);
35 static Sk4x LoadAligned(const T[4]); 35 static Sk4x LoadAligned(const T[4]);
36 36
37 void store (T[4]) const; 37 void store (T[4]) const;
38 void storeAligned(T[4]) const; 38 void storeAligned(T[4]) const;
39 39
40 // Experimental!
41 static Sk4x Load2(const T src[2]) {
42 const T padded[4] = { src[0], src[1], 0, 0 };
43 return Load(padded);
44 }
45 void store2(T dst[2]) const {
46 T padded[4];
47 this->store(padded);
48 dst[0] = padded[0];
49 dst[1] = padded[1];
50 }
51
40 template <typename Dst> Dst reinterpret() const; 52 template <typename Dst> Dst reinterpret() const;
41 template <typename Dst> Dst cast() const; 53 template <typename Dst> Dst cast() const;
42 54
43 bool allTrue() const; 55 bool allTrue() const;
44 bool anyTrue() const; 56 bool anyTrue() const;
45 57
46 Sk4x bitNot() const; 58 Sk4x bitNot() const;
47 Sk4x bitAnd(const Sk4x&) const; 59 Sk4x bitAnd(const Sk4x&) const;
48 Sk4x bitOr(const Sk4x&) const; 60 Sk4x bitOr(const Sk4x&) const;
49 // TODO: Sk4x bitAndNot(const Sk4x&) const; is efficient in SSE. 61 // TODO: Sk4x bitAndNot(const Sk4x&) const; is efficient in SSE.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 105
94 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 106 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
95 #include "Sk4x_sse.h" 107 #include "Sk4x_sse.h"
96 #elif defined(SK_ARM_HAS_NEON) 108 #elif defined(SK_ARM_HAS_NEON)
97 #include "Sk4x_neon.h" 109 #include "Sk4x_neon.h"
98 #else 110 #else
99 #include "Sk4x_portable.h" 111 #include "Sk4x_portable.h"
100 #endif 112 #endif
101 113
102 #endif//Sk4x_DEFINED 114 #endif//Sk4x_DEFINED
OLDNEW
« no previous file with comments | « no previous file | tests/Sk4xTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698