From 3427ca90b87a12db60bd7bbc012b17d1358413b2 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 16 Nov 2019 00:46:36 -0500 Subject: [PATCH] Update documentation --- ppc_simd.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ppc_simd.h b/ppc_simd.h index 9475a304..c2f7ac1a 100644 --- a/ppc_simd.h +++ b/ppc_simd.h @@ -114,12 +114,18 @@ /// pointer for a byte array. The Power ABI says source arrays /// are non-const, so this define removes the const. XLC++ will /// fail the compile if the source array is const. +/// \details CONST_V8_CAST serves a second purpose. It casts to a +/// byte pointer to avoid undefined behavior due to alignment +/// requirements. Byte pointers have an alignment requirement of 1. #define CONST_V8_CAST(x) ((unsigned char*)(x)) /// \brief Cast array to vector pointer /// \details NCONST_V8_CAST casts an array to a vector /// pointer for a byte array. The Power ABI says source arrays /// are non-const, so this define removes the const. XLC++ will /// fail the compile if the source array is const. +/// \details NCONST_V8_CAST serves a second purpose. It casts to a +/// byte pointer to avoid undefined behavior due to alignment +/// requirements. Byte pointers have an alignment requirement of 1. #define NCONST_V8_CAST(x) ((unsigned char*)(x)) // VecLoad_ALTIVEC and VecStore_ALTIVEC are