Skip to content

Commit

Permalink
Flip #if logic for unaligned access
Browse files Browse the repository at this point in the history
Assume only x86 can correctly/efficiently handle unaligned access.
  • Loading branch information
mdavidsaver committed May 25, 2023
1 parent 8701888 commit c16f19c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/misc/pv/byteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,17 @@ struct swap<8> {
#undef _PVA_swap64

/* PVD serialization doesn't pay attention to alignement,
* which some targets really care about and treat unaligned
* which some targets (ARM and powerpc) really care about and treat unaligned
* access as a fault, or with a heavy penalty (~= to a syscall).
*
* For those targets,, we will have to live with the increase
* in execution time and/or object code size of byte-wise copy.
*
* Treat x86 32/64 as an outlier, and assume all other targets
* need, or greatly benefit, from aligned access.
*/

#if defined(_ARCH_PPC) || defined(__arm__) || defined(_M_ARM)
#if !(defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86))

template<typename T>
union alignu {
Expand Down

0 comments on commit c16f19c

Please sign in to comment.