Lines Matching +full:no +full:- +full:unaligned +full:- +full:direct +full:- +full:access
5 * This source code is licensed under both the BSD-style license (found in the
8 * You may select, at your option, one of the above-listed licenses.
18 /*-****************************************
27 /*-****************************************
44 /*-**************************************************************
65 # error "this implementation requires char to be exactly 8-bit type"
71 # error "this implementation requires short to be exactly 16-bit type"
76 # error "this implementation requires int to be exactly 32-bit type"
80 /* note : there are no limits defined for long long type in C90.
87 /*-**************************************************************
95 /*=== Native unaligned read/write ===*/
105 /*=== Little endian unaligned read/write ===*/
118 /*=== Big endian unaligned read/write ===*/
133 /*-**************************************************************
137 * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable.
138 * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal.
139 * The below switch allow to select different access method for improved performance.
143 * Method 2 : direct access. This method is portable but violate C standard.
146 * See http://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details.
181 Only use if no other choice to achieve best performance on target platform */
209 MEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; }
210 MEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; } in MEM_read32()
211 MEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; } in MEM_read64()
212 MEM_STATIC size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; } in MEM_readST()
214 MEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; } in MEM_write16()
215 MEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; } in MEM_write32()
216 MEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; } in MEM_write64()