Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions aligned_heap_vectorization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class Vector4d {
void operator delete (void* ptr) {
::operator delete(*(reinterpret_cast<void**>(ptr) - 1));
}


int x;
aligned_double4 data;
int y, z;
};

Vector4d operator+ (const Vector4d& v1, const Vector4d& v2) {
Expand All @@ -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;

Expand Down