initial check in

This commit is contained in:
2012-12-06 21:43:03 +04:00
commit 4bc273824d
179 changed files with 29415 additions and 0 deletions

47
Duffs_device.cpp Normal file
View File

@@ -0,0 +1,47 @@
#include <stdlib.h>
#include <iostream>
void send(short *to, const short *from, size_t count)
{
size_t n=(count+7)/8;
switch(count%8){
case 0: do{ *to += *from++;
case 7: *to += *from++;
case 6: *to += *from++;
case 5: *to += *from++;
case 4: *to += *from++;
case 3: *to += *from++;
case 2: *to += *from++;
case 1: *to += *from++;
}while(--n>0);
}
}
void send2(short *to, const short *from, size_t count)
{
int n=(count+7)/8;
switch(count%8){
case 0: while(--n>0){
*to += *from++;
case 7: *to += *from++;
case 6: *to += *from++;
case 5: *to += *from++;
case 4: *to += *from++;
case 3: *to += *from++;
case 2: *to += *from++;
case 1: *to += *from++;
}
}
}
int main ( )
{
short a[256];
short sum = 0;
for ( int i = 0; i < sizeof(a)/sizeof(a[0]); ++i )
a[i] = 1;
send2( &sum, a, 0 );
std::cout << sum << std::endl;
return 0;
}