OLD | NEW |
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 SkNx_neon_DEFINED | 8 #ifndef SkNx_neon_DEFINED |
9 #define SkNx_neon_DEFINED | 9 #define SkNx_neon_DEFINED |
10 | 10 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 SkNx operator >(const SkNx& o) const { return vreinterpretq_f32_u32(vcgtq_f3
2(fVec, o.fVec)); } | 180 SkNx operator >(const SkNx& o) const { return vreinterpretq_f32_u32(vcgtq_f3
2(fVec, o.fVec)); } |
181 SkNx operator<=(const SkNx& o) const { return vreinterpretq_f32_u32(vcleq_f3
2(fVec, o.fVec)); } | 181 SkNx operator<=(const SkNx& o) const { return vreinterpretq_f32_u32(vcleq_f3
2(fVec, o.fVec)); } |
182 SkNx operator>=(const SkNx& o) const { return vreinterpretq_f32_u32(vcgeq_f3
2(fVec, o.fVec)); } | 182 SkNx operator>=(const SkNx& o) const { return vreinterpretq_f32_u32(vcgeq_f3
2(fVec, o.fVec)); } |
183 SkNx operator!=(const SkNx& o) const { | 183 SkNx operator!=(const SkNx& o) const { |
184 return vreinterpretq_f32_u32(vmvnq_u32(vceqq_f32(fVec, o.fVec))); | 184 return vreinterpretq_f32_u32(vmvnq_u32(vceqq_f32(fVec, o.fVec))); |
185 } | 185 } |
186 | 186 |
187 static SkNx Min(const SkNx& l, const SkNx& r) { return vminq_f32(l.fVec, r.f
Vec); } | 187 static SkNx Min(const SkNx& l, const SkNx& r) { return vminq_f32(l.fVec, r.f
Vec); } |
188 static SkNx Max(const SkNx& l, const SkNx& r) { return vmaxq_f32(l.fVec, r.f
Vec); } | 188 static SkNx Max(const SkNx& l, const SkNx& r) { return vmaxq_f32(l.fVec, r.f
Vec); } |
189 | 189 |
| 190 SkNx abs() const { return vabsq_f32(fVec); } |
| 191 |
190 SkNx rsqrt0() const { return vrsqrteq_f32(fVec); } | 192 SkNx rsqrt0() const { return vrsqrteq_f32(fVec); } |
191 SkNx rsqrt1() const { | 193 SkNx rsqrt1() const { |
192 float32x4_t est0 = this->rsqrt0().fVec; | 194 float32x4_t est0 = this->rsqrt0().fVec; |
193 return vmulq_f32(vrsqrtsq_f32(fVec, vmulq_f32(est0, est0)), est0); | 195 return vmulq_f32(vrsqrtsq_f32(fVec, vmulq_f32(est0, est0)), est0); |
194 } | 196 } |
195 SkNx rsqrt2() const { | 197 SkNx rsqrt2() const { |
196 float32x4_t est1 = this->rsqrt1().fVec; | 198 float32x4_t est1 = this->rsqrt1().fVec; |
197 return vmulq_f32(vrsqrtsq_f32(fVec, vmulq_f32(est1, est1)), est1); | 199 return vmulq_f32(vrsqrtsq_f32(fVec, vmulq_f32(est1, est1)), est1); |
198 } | 200 } |
199 | 201 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const Sk4f& a, const Sk4f& b, const Sk4f& c, con
st Sk4f& d) { | 347 const Sk4f& a, const Sk4f& b, const Sk4f& c, con
st Sk4f& d) { |
346 vst1q_u8(bytes, vuzpq_u8(vuzpq_u8((uint8x16_t)vcvtq_u32_f32(a.fVec), | 348 vst1q_u8(bytes, vuzpq_u8(vuzpq_u8((uint8x16_t)vcvtq_u32_f32(a.fVec), |
347 (uint8x16_t)vcvtq_u32_f32(b.fVec)).val[0], | 349 (uint8x16_t)vcvtq_u32_f32(b.fVec)).val[0], |
348 vuzpq_u8((uint8x16_t)vcvtq_u32_f32(c.fVec), | 350 vuzpq_u8((uint8x16_t)vcvtq_u32_f32(c.fVec), |
349 (uint8x16_t)vcvtq_u32_f32(d.fVec)).val[0])
.val[0]); | 351 (uint8x16_t)vcvtq_u32_f32(d.fVec)).val[0])
.val[0]); |
350 } | 352 } |
351 | 353 |
352 } // namespace | 354 } // namespace |
353 | 355 |
354 #endif//SkNx_neon_DEFINED | 356 #endif//SkNx_neon_DEFINED |
OLD | NEW |