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

Unified Diff: src/opts/SkNx_neon.h

Issue 2183133002: Fix alignment problems in NEON Sk4b. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkNx_neon.h
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h
index df11de3d5fb13d3240f3e47a327bcbe0528809c8..23567b7c2f18bbb0c804b226765794870b086dcf 100644
--- a/src/opts/SkNx_neon.h
+++ b/src/opts/SkNx_neon.h
@@ -296,6 +296,8 @@ public:
template <>
class SkNx<4, uint8_t> {
public:
+ typedef uint32_t __attribute__((aligned(1))) unaligned_uint32_t;
+
SkNx(const uint8x8_t& vec) : fVec(vec) {}
SkNx() {}
@@ -303,10 +305,10 @@ public:
fVec = (uint8x8_t){a,b,c,d, 0,0,0,0};
}
static SkNx Load(const void* ptr) {
- return (uint8x8_t)vld1_dup_u32((const uint32_t*)ptr);
+ return (uint8x8_t)vld1_dup_u32((const unaligned_uint32_t*)ptr);
}
void store(void* ptr) const {
- return vst1_lane_u32((uint32_t*)ptr, (uint32x2_t)fVec, 0);
+ return vst1_lane_u32((unaligned_uint32_t*)ptr, (uint32x2_t)fVec, 0);
}
uint8_t operator[](int k) const {
SkASSERT(0 <= k && k < 4);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698