rdamoise wrote:
for(int i=0; i<16;i++){
fpgaTxBuffer[i] &= 0x0FFFF;
linkTxBuffer[i] |= 0x10000;
}
for(int i=16;i<48;i++){
fpgaTxBuffer[i] |= 0x30000;
linkTxBuffer[i] |= 0x10000;
}
If nobody comes up with a faster algorithm/technique, then the least you could do is code the loops more efficiently, i.e. use pointers instead of indexing into arrays.
Code:
struct foo fpgaTxBuffer, *p, *z;
struct bar linkTxBuffer, *q;
p = fpgaTxBuffer;
z = fpgaTxBuffer + 16;
q = linkTxBuffer;
do {
*p++ = *p & 0x0FFFF;
*q++ = *q | 0x10000;
} while (p < z);
z = fpgaTxBuffer + 48;
do {
*p++ = *p | 0x30000;
*q++ = *q | 0x10000;
} while (p < z);
Regards