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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 476 } |
477 | 477 |
478 template<> inline Sk4h SkNx_cast<uint16_t, int>(const Sk4i& src) { | 478 template<> inline Sk4h SkNx_cast<uint16_t, int>(const Sk4i& src) { |
479 return vmovn_u32(vreinterpretq_u32_s32(src.fVec)); | 479 return vmovn_u32(vreinterpretq_u32_s32(src.fVec)); |
480 } | 480 } |
481 | 481 |
482 static inline Sk4i Sk4f_round(const Sk4f& x) { | 482 static inline Sk4i Sk4f_round(const Sk4f& x) { |
483 return vcvtq_s32_f32((x + 0.5f).fVec); | 483 return vcvtq_s32_f32((x + 0.5f).fVec); |
484 } | 484 } |
485 | 485 |
| 486 static inline void Sk4h_store4(void* dst, const Sk4h& r, const Sk4h& g, const Sk
4h& b, |
| 487 const Sk4h& a) { |
| 488 uint16x4x4_t rgba = {{ |
| 489 r.fVec, |
| 490 g.fVec, |
| 491 b.fVec, |
| 492 a.fVec, |
| 493 }}; |
| 494 vst4_u16((uint16_t*) dst, rgba); |
| 495 } |
| 496 |
486 #endif//SkNx_neon_DEFINED | 497 #endif//SkNx_neon_DEFINED |
OLD | NEW |