Skip to content

Commit c16f19c

Browse files
committed
Flip #if logic for unaligned access
Assume only x86 can correctly/efficiently handle unaligned access.
1 parent 8701888 commit c16f19c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/misc/pv/byteBuffer.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,17 @@ struct swap<8> {
150150
#undef _PVA_swap64
151151

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

160-
#if defined(_ARCH_PPC) || defined(__arm__) || defined(_M_ARM)
163+
#if !(defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86))
161164

162165
template<typename T>
163166
union alignu {

0 commit comments

Comments
 (0)