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

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

Issue 1027753003: Add divide to Sk2x, use native vdiv and vsqrt on ARM 64. (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 | « no previous file | src/opts/Sk2x_neon.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef Sk2x_DEFINED 8 #ifndef Sk2x_DEFINED
9 #define Sk2x_DEFINED 9 #define Sk2x_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Sk2x(const Sk2x& o) { *this = o; } 42 Sk2x(const Sk2x& o) { *this = o; }
43 Sk2x& operator=(const Sk2x&); 43 Sk2x& operator=(const Sk2x&);
44 44
45 // These assume no particular alignment. 45 // These assume no particular alignment.
46 static Sk2x Load(const T[2]); 46 static Sk2x Load(const T[2]);
47 void store(T[2]) const; 47 void store(T[2]) const;
48 48
49 Sk2x add(const Sk2x&) const; 49 Sk2x add(const Sk2x&) const;
50 Sk2x subtract(const Sk2x&) const; 50 Sk2x subtract(const Sk2x&) const;
51 Sk2x multiply(const Sk2x&) const; 51 Sk2x multiply(const Sk2x&) const;
52 Sk2x divide(const Sk2x&) const;
52 53
53 Sk2x operator +(const Sk2x& o) const { return this->add(o); } 54 Sk2x operator +(const Sk2x& o) const { return this->add(o); }
54 Sk2x operator -(const Sk2x& o) const { return this->subtract(o); } 55 Sk2x operator -(const Sk2x& o) const { return this->subtract(o); }
55 Sk2x operator *(const Sk2x& o) const { return this->multiply(o); } 56 Sk2x operator *(const Sk2x& o) const { return this->multiply(o); }
57 Sk2x operator /(const Sk2x& o) const { return this->divide(o); }
56 58
57 Sk2x& operator +=(const Sk2x& o) { return (*this = *this + o); } 59 Sk2x& operator +=(const Sk2x& o) { return (*this = *this + o); }
58 Sk2x& operator -=(const Sk2x& o) { return (*this = *this - o); } 60 Sk2x& operator -=(const Sk2x& o) { return (*this = *this - o); }
59 Sk2x& operator *=(const Sk2x& o) { return (*this = *this * o); } 61 Sk2x& operator *=(const Sk2x& o) { return (*this = *this * o); }
62 Sk2x& operator /=(const Sk2x& o) { return (*this = *this / o); }
60 63
61 Sk2x negate() const { return Sk2x((T)0) - *this; } 64 Sk2x negate() const { return Sk2x((T)0) - *this; }
62 Sk2x operator -() const { return this->negate(); } 65 Sk2x operator -() const { return this->negate(); }
63 66
64 Sk2x rsqrt() const; // Approximate 1/this->sqrt(). 67 Sk2x rsqrt() const; // Approximate 1/this->sqrt().
65 Sk2x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but le ss precise. 68 Sk2x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but le ss precise.
66 69
67 static Sk2x Min(const Sk2x&, const Sk2x&); 70 static Sk2x Min(const Sk2x&, const Sk2x&);
68 static Sk2x Max(const Sk2x&, const Sk2x&); 71 static Sk2x Max(const Sk2x&, const Sk2x&);
69 72
(...skipping 11 matching lines...) Expand all
81 84
82 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) 85 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD)
83 #include "../opts/Sk2x_sse.h" 86 #include "../opts/Sk2x_sse.h"
84 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD) 87 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD)
85 #include "../opts/Sk2x_neon.h" 88 #include "../opts/Sk2x_neon.h"
86 #else 89 #else
87 #include "../opts/Sk2x_none.h" 90 #include "../opts/Sk2x_none.h"
88 #endif 91 #endif
89 92
90 #endif//Sk2x_DEFINED 93 #endif//Sk2x_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/opts/Sk2x_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698