- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#include "stdafx.h"
#include
#include
#include "xmmintrin.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int x[4][4]={1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4}; //source or input
int y[4][4];//destination or output
int b[4] ={5,5,5,5};// constants to be added
int f0,f1,f2,f3;
__asm
{
mov eax,x
mov ecx,b
mov edi,y
//stage one
movq mm0,[eax]
movq mm7,[ecx]
paddw mm0,mm7
movq [f0],mm0
movq mm1,[eax+8]
paddw mm1,mm7
movq [f1],mm1
movq mm2,[eax+16]
paddw mm2,mm7
movq [f2],mm2
movq mm3,[eax+24]
paddw mm3,mm7
movq [f3],mm3
//stage two
movq mm0,[f0]
psraw mm0,6
movq [edi],mm0
movq mm1,[f1]
psraw mm1,6
movq [edi+8],mm1
movq mm2,[f2]
psraw mm2,6
movq [edi+16],mm2
movq mm3,[f3]
psraw mm3,6
movq [edi+24],mm3
}
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
cout << y
cout << endl;
}
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
-Max
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page