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

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

Issue 964603002: Add sqrt() and rsqrt() to Sk4f. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/Sk4x_portable.h ('k') | 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 // It is important _not_ to put header guards here. 1 // It is important _not_ to put header guards here.
2 // This file will be intentionally included three times. 2 // This file will be intentionally included three times.
3 3
4 // Useful reading: 4 // Useful reading:
5 // https://software.intel.com/sites/landingpage/IntrinsicsGuide/ 5 // https://software.intel.com/sites/landingpage/IntrinsicsGuide/
6 6
7 #if defined(SK4X_PREAMBLE) 7 #if defined(SK4X_PREAMBLE)
8 // Code in this file may assume SSE and SSE2. 8 // Code in this file may assume SSE and SSE2.
9 #include <emmintrin.h> 9 #include <emmintrin.h>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // We're going to try a little experiment here and skip allTrue(), anyTrue(), an d bit-manipulators 93 // We're going to try a little experiment here and skip allTrue(), anyTrue(), an d bit-manipulators
94 // for Sk4f. Code that calls them probably does so accidentally. 94 // for Sk4f. Code that calls them probably does so accidentally.
95 // Ask mtklein to fill these in if you really need them. 95 // Ask mtklein to fill these in if you really need them.
96 96
97 M(Sk4f) add (const Sk4f& o) const { return _mm_add_ps(fVec, o.fVec); } 97 M(Sk4f) add (const Sk4f& o) const { return _mm_add_ps(fVec, o.fVec); }
98 M(Sk4f) subtract(const Sk4f& o) const { return _mm_sub_ps(fVec, o.fVec); } 98 M(Sk4f) subtract(const Sk4f& o) const { return _mm_sub_ps(fVec, o.fVec); }
99 M(Sk4f) multiply(const Sk4f& o) const { return _mm_mul_ps(fVec, o.fVec); } 99 M(Sk4f) multiply(const Sk4f& o) const { return _mm_mul_ps(fVec, o.fVec); }
100 M(Sk4f) divide (const Sk4f& o) const { return _mm_div_ps(fVec, o.fVec); } 100 M(Sk4f) divide (const Sk4f& o) const { return _mm_div_ps(fVec, o.fVec); }
101 101
102 M(Sk4f) rsqrt() const { return _mm_rsqrt_ps(fVec); }
103 M(Sk4f) sqrt() const { return _mm_sqrt_ps( fVec); }
104
102 M(Sk4i) equal (const Sk4f& o) const { return _mm_cmpeq_ps (fVec, o.fVe c); } 105 M(Sk4i) equal (const Sk4f& o) const { return _mm_cmpeq_ps (fVec, o.fVe c); }
103 M(Sk4i) notEqual (const Sk4f& o) const { return _mm_cmpneq_ps(fVec, o.fVe c); } 106 M(Sk4i) notEqual (const Sk4f& o) const { return _mm_cmpneq_ps(fVec, o.fVe c); }
104 M(Sk4i) lessThan (const Sk4f& o) const { return _mm_cmplt_ps (fVec, o.fVe c); } 107 M(Sk4i) lessThan (const Sk4f& o) const { return _mm_cmplt_ps (fVec, o.fVe c); }
105 M(Sk4i) greaterThan (const Sk4f& o) const { return _mm_cmpgt_ps (fVec, o.fVe c); } 108 M(Sk4i) greaterThan (const Sk4f& o) const { return _mm_cmpgt_ps (fVec, o.fVe c); }
106 M(Sk4i) lessThanEqual (const Sk4f& o) const { return _mm_cmple_ps (fVec, o.fVe c); } 109 M(Sk4i) lessThanEqual (const Sk4f& o) const { return _mm_cmple_ps (fVec, o.fVe c); }
107 M(Sk4i) greaterThanEqual(const Sk4f& o) const { return _mm_cmpge_ps (fVec, o.fVe c); } 110 M(Sk4i) greaterThanEqual(const Sk4f& o) const { return _mm_cmpge_ps (fVec, o.fVe c); }
108 111
109 M(Sk4f) Min(const Sk4f& a, const Sk4f& b) { return _mm_min_ps(a.fVec, b.fVec); } 112 M(Sk4f) Min(const Sk4f& a, const Sk4f& b) { return _mm_min_ps(a.fVec, b.fVec); }
110 M(Sk4f) Max(const Sk4f& a, const Sk4f& b) { return _mm_max_ps(a.fVec, b.fVec); } 113 M(Sk4f) Max(const Sk4f& a, const Sk4f& b) { return _mm_max_ps(a.fVec, b.fVec); }
111 114
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 173 }
171 M(Sk4i) Max(const Sk4i& a, const Sk4i& b) { 174 M(Sk4i) Max(const Sk4i& a, const Sk4i& b) {
172 Sk4i less = a.lessThan(b); 175 Sk4i less = a.lessThan(b);
173 return b.bitAnd(less).bitOr(a.andNot(less)); 176 return b.bitAnd(less).bitOr(a.andNot(less));
174 } 177 }
175 #endif 178 #endif
176 179
177 #undef M 180 #undef M
178 181
179 #endif//Method definitions. 182 #endif//Method definitions.
OLDNEW
« no previous file with comments | « src/core/Sk4x_portable.h ('k') | tests/Sk4xTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698