diff --git a/aligned_heap_vectorization.cpp b/aligned_heap_vectorization.cpp index 3f145de..7dafc60 100644 --- a/aligned_heap_vectorization.cpp +++ b/aligned_heap_vectorization.cpp @@ -24,8 +24,10 @@ class Vector4d { void operator delete (void* ptr) { ::operator delete(*(reinterpret_cast(ptr) - 1)); } - + + int x; aligned_double4 data; + int y, z; }; Vector4d operator+ (const Vector4d& v1, const Vector4d& v2) { @@ -46,8 +48,10 @@ int main() { Vector4d* input1 = new Vector4d{1, 1, 1, 1}; Vector4d* input2 = new Vector4d{1, 2, 3, 4}; + std::cout << "address of input1.x: " << &input1->x << std::endl; std::cout << "address of input1: " << input1->data << std::endl; - std::cout << "address of input2: " << input2->data << std::endl; + std::cout << "address of input1.y: " << &input1->y << std::endl; + std::cout << "address of input1.z: " << &input1->z << std::endl; Vector4d result = *input1 + *input2;