Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1.
- static float4 operator+(const float4& A, const float4& B)
- {
- float4 C;
- auto a = _mm_load_ps(&A.x);
- auto b = _mm_load_ps(&B.x);
- _mm_store_ps(&C.x, _mm_add_ps(a, b));
- return C;
- }
- //2.
- static void summ(const float4* A, const float4* B, float4* C)
- {
- __asm
- {
- lea eax, A;
- lea ebx, B;
- mov eax, [eax];
- mov ebx, [ebx];
- movaps xmm0, [eax];
- movaps xmm1, [ebx];
- addps xmm0, xmm1;
- movaps[edx], xmm0;
- mov C, edx;
- }
- }
- //3.
- static void ssumm(const float4* A, const float4* B, float4* C)
- {
- C->x = A->x + B->x;
- C->y = A->y + B->y;
- C->z = A->z + B->z;
- C->w = A->w + B->w;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement