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

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

Issue 1027783002: Sk2x/Sk4x: add negate(), operator -() (Closed) Base URL: https://skia.googlesource.com/skia@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 | « src/core/Sk2x.h ('k') | tests/Sk2xTest.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 #include "SkNx.h" 5 #include "SkNx.h"
6 6
7 #define SK4X_PREAMBLE 1 7 #define SK4X_PREAMBLE 1
8 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) 8 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD)
9 #include "../opts/Sk4x_sse.h" 9 #include "../opts/Sk4x_sse.h"
10 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD) 10 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 Sk4x operator *(const Sk4x& o) const { return this->multiply(o); } 62 Sk4x operator *(const Sk4x& o) const { return this->multiply(o); }
63 Sk4x operator /(const Sk4x& o) const { return this->divide(o); } 63 Sk4x operator /(const Sk4x& o) const { return this->divide(o); }
64 64
65 Sk4x& operator &=(const Sk4x& o) { return (*this = *this & o); } 65 Sk4x& operator &=(const Sk4x& o) { return (*this = *this & o); }
66 Sk4x& operator |=(const Sk4x& o) { return (*this = *this | o); } 66 Sk4x& operator |=(const Sk4x& o) { return (*this = *this | o); }
67 Sk4x& operator +=(const Sk4x& o) { return (*this = *this + o); } 67 Sk4x& operator +=(const Sk4x& o) { return (*this = *this + o); }
68 Sk4x& operator -=(const Sk4x& o) { return (*this = *this - o); } 68 Sk4x& operator -=(const Sk4x& o) { return (*this = *this - o); }
69 Sk4x& operator *=(const Sk4x& o) { return (*this = *this * o); } 69 Sk4x& operator *=(const Sk4x& o) { return (*this = *this * o); }
70 Sk4x& operator /=(const Sk4x& o) { return (*this = *this / o); } 70 Sk4x& operator /=(const Sk4x& o) { return (*this = *this / o); }
71 71
72 Sk4x negate() const { return Sk4x(0) - *this; }
73 Sk4x operator -() const { return this->negate(); }
74
72 Sk4x rsqrt() const; // Approximate reciprocal sqrt(). 75 Sk4x rsqrt() const; // Approximate reciprocal sqrt().
73 Sk4x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but le ss precise. 76 Sk4x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but le ss precise.
74 77
75 Sk4i equal(const Sk4x&) const; 78 Sk4i equal(const Sk4x&) const;
76 Sk4i notEqual(const Sk4x&) const; 79 Sk4i notEqual(const Sk4x&) const;
77 Sk4i lessThan(const Sk4x&) const; 80 Sk4i lessThan(const Sk4x&) const;
78 Sk4i greaterThan(const Sk4x&) const; 81 Sk4i greaterThan(const Sk4x&) const;
79 Sk4i lessThanEqual(const Sk4x&) const; 82 Sk4i lessThanEqual(const Sk4x&) const;
80 Sk4i greaterThanEqual(const Sk4x&) const; 83 Sk4i greaterThanEqual(const Sk4x&) const;
81 84
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 120
118 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) 121 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD)
119 #include "../opts/Sk4x_sse.h" 122 #include "../opts/Sk4x_sse.h"
120 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD) 123 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD)
121 #include "../opts/Sk4x_neon.h" 124 #include "../opts/Sk4x_neon.h"
122 #else 125 #else
123 #include "../opts/Sk4x_none.h" 126 #include "../opts/Sk4x_none.h"
124 #endif 127 #endif
125 128
126 #endif//Sk4x_DEFINED 129 #endif//Sk4x_DEFINED
OLDNEW
« no previous file with comments | « src/core/Sk2x.h ('k') | tests/Sk2xTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698