aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/platform.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h
index 0b0fce182..df9594507 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -217,6 +217,7 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
217 * a lvalue. This makes it more likely to not swap them by mistake 217 * a lvalue. This makes it more likely to not swap them by mistake
218 */ 218 */
219#if defined(i386) || defined(__x86_64__) || defined(__powerpc__) 219#if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
220# define BB_UNALIGNED_MEMACCESS_OK 1
220# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) 221# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
221# define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp)) 222# define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp))
222# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) 223# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
@@ -225,6 +226,7 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
225# define move_to_unaligned32(u32p, v) (*(bb__aliased_uint32_t*)(u32p) = (v)) 226# define move_to_unaligned32(u32p, v) (*(bb__aliased_uint32_t*)(u32p) = (v))
226/* #elif ... - add your favorite arch today! */ 227/* #elif ... - add your favorite arch today! */
227#else 228#else
229# define BB_UNALIGNED_MEMACCESS_OK 0
228/* performs reasonably well (gcc usually inlines memcpy here) */ 230/* performs reasonably well (gcc usually inlines memcpy here) */
229# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) 231# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int)))
230# define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long))) 232# define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long)))