diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-01-04 15:21:23 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-01-04 15:21:23 -0500 |
commit | 1435a8b9e6203911d2ebe9e3ba217f8eb20e3140 (patch) | |
tree | 158c5dcd824aca1d01f0f119849458739d3f451e /indra/llmath | |
parent | d285f78e91dd18b0dfa2608faf45738af1e637bd (diff) |
SH-2789 WIP - stricter calling of memcpyNonAliased16
Diffstat (limited to 'indra/llmath')
-rwxr-xr-x | indra/llmath/llvector4a.cpp | 3 | ||||
-rwxr-xr-x | indra/llmath/llvector4a.h | 1 | ||||
-rwxr-xr-x | indra/llmath/tests/alignment_test.cpp | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index 480ccf4ed9..6edeb0fefe 100755 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -41,8 +41,6 @@ extern const LLVector4a LL_V4A_EPSILON = reinterpret_cast<const LLVector4a&> ( F /*static */void LLVector4a::memcpyNonAliased16(F32* __restrict dst, const F32* __restrict src, size_t bytes) { -// memcpy((void*)dst,(const void*)src,bytes); -#if 1 assert(src != NULL); assert(dst != NULL); assert(bytes > 0); @@ -92,7 +90,6 @@ extern const LLVector4a LL_V4A_EPSILON = reinterpret_cast<const LLVector4a&> ( F dst += 4; src += 4; } -#endif } void LLVector4a::setRotated( const LLRotation& rot, const LLVector4a& vec ) diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 9de0e66774..0526793d3a 100755 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -84,6 +84,7 @@ public: } // Copy words 16-byte blocks from src to dst. Source and destination must not overlap. + // Source and dest must be 16-byte aligned and size must be multiple of 16. static void memcpyNonAliased16(F32* __restrict dst, const F32* __restrict src, size_t bytes); //////////////////////////////////// diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index 51a7051e69..dc9b41957d 100755 --- a/indra/llmath/tests/alignment_test.cpp +++ b/indra/llmath/tests/alignment_test.cpp @@ -72,6 +72,10 @@ void alignment_test_object_t::test<1>() {
align_ptr = ll_aligned_malloc_16(sizeof(MyVector4a));
ensure("ll_aligned_malloc_16 failed", is_aligned(align_ptr,16));
+
+ align_ptr = ll_aligned_realloc_16(2*sizeof(MyVector4a));
+ ensure("ll_aligned_realloc_16 failed", is_aligned(align_ptr,16));
+
ll_aligned_free_16(align_ptr);
align_ptr = ll_aligned_malloc_32(sizeof(MyVector4a));
@@ -84,8 +88,6 @@ void alignment_test_object_t::test<1>() template<> template<>
void alignment_test_object_t::test<2>()
{
- ensure("LLAlignment reality is broken: ", (1==1));
-
MyVector4a vec1;
ensure("LLAlignment vec1 unaligned", is_aligned(&vec1,16));
|