Commit 6a287b3c authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Merge branch 'pulsar_1pol_unpacker' into 'devel'

fixed bit shifting in EDDPolnMerge10to8.cpp

See merge request !7
parents 3cc2c188 e63de246
Pipeline #93101 passed with stages
in 6 minutes and 41 seconds
...@@ -22,58 +22,58 @@ uint64_t *unpack5(uint64_t *qword, uint8_t *out) ...@@ -22,58 +22,58 @@ uint64_t *unpack5(uint64_t *qword, uint8_t *out)
val = be64toh(*qword); val = be64toh(*qword);
//printf("0x%016lX\n",val); //printf("0x%016lX\n",val);
qword++; qword++;
out[0] = ((int64_t)(( 0xFFC0000000000000 & val) << 0) >> 54) & 0xFF; out[0] = (int8_t)(((int64_t)(( 0xFFC0000000000000 & val) << 0) >> 54) >> 2);
out[1] = ((int64_t)(( 0x003FF00000000000 & val) << 10) >> 54) & 0xFF; out[1] = (int8_t)(((int64_t)(( 0x003FF00000000000 & val) << 10) >> 54) >> 2);
out[2] = ((int64_t)(( 0x00000FFC00000000 & val) << 20) >> 54) & 0xFF; out[2] = (int8_t)(((int64_t)(( 0x00000FFC00000000 & val) << 20) >> 54) >> 2);
out[3] = ((int64_t)(( 0x00000003FF000000 & val) << 30) >> 54) & 0xFF; out[3] = (int8_t)(((int64_t)(( 0x00000003FF000000 & val) << 30) >> 54) >> 2);
out[4] = ((int64_t)(( 0x0000000000FFC000 & val) << 40) >> 54) & 0xFF; out[4] = (int8_t)(((int64_t)(( 0x0000000000FFC000 & val) << 40) >> 54) >> 2);
out[5] = ((int64_t)(( 0x0000000000003FF0 & val) << 50) >> 54) & 0xFF; out[5] = (int8_t)(((int64_t)(( 0x0000000000003FF0 & val) << 50) >> 54) >> 2);
rest = ( 0x000000000000000F & val) << 60; // 4 bits rest. rest = ( 0x000000000000000F & val) << 60; // 4 bits rest.
// 2nd: // 2nd:
val = be64toh(*qword); val = be64toh(*qword);
//printf("0x%016lX\n",val); //printf("0x%016lX\n",val);
qword++; qword++;
out[6] = ((int64_t)(((0xFC00000000000000 & val) >> 4) | rest) >> 54) & 0xFF; out[6] = (int8_t)(((int64_t)(((0xFC00000000000000 & val) >> 4) | rest) >> 54) >> 2);
out[7] = ((int64_t)(( 0x03FF000000000000 & val) << 6) >> 54) & 0xFF; out[7] = (int8_t)(((int64_t)(( 0x03FF000000000000 & val) << 6) >> 54) >> 2);
out[8] = ((int64_t)(( 0x0000FFC000000000 & val) << 16) >> 54) & 0xFF; out[8] = (int8_t)(((int64_t)(( 0x0000FFC000000000 & val) << 16) >> 54) >> 2);
out[9] = ((int64_t)(( 0x0000003FF0000000 & val) << 26) >> 54) & 0xFF; out[9] = (int8_t)(((int64_t)(( 0x0000003FF0000000 & val) << 26) >> 54) >> 2);
out[10] = ((int64_t)(( 0x000000000FFC0000 & val) << 36) >> 54) & 0xFF; out[10] = (int8_t)(((int64_t)(( 0x000000000FFC0000 & val) << 36) >> 54) >> 2);
out[11] = ((int64_t)(( 0x000000000003FF00 & val) << 46) >> 54) & 0xFF; out[11] = (int8_t)(((int64_t)(( 0x000000000003FF00 & val) << 46) >> 54) >> 2);
rest = ( 0x00000000000000FF & val) << 56; // 8 bits rest. rest = ( 0x00000000000000FF & val) << 56; // 8 bits rest.
// 3rd: // 3rd:
val = be64toh(*qword); val = be64toh(*qword);
//printf("0x%016lX\n",val); //printf("0x%016lX\n",val);
qword++; qword++;
out[12] = ((int64_t)(((0xC000000000000000 & val) >> 8) | rest) >> 54) & 0xFF; out[12] = (int8_t)(((int64_t)(((0xC000000000000000 & val) >> 8) | rest) >> 54) >> 2);
out[13] = ((int64_t)(( 0x3FF0000000000000 & val) << 2) >> 54) & 0xFF; out[13] = (int8_t)(((int64_t)(( 0x3FF0000000000000 & val) << 2) >> 54) >> 2);
out[14] = ((int64_t)(( 0x000FFC0000000000 & val) << 12) >> 54) & 0xFF; out[14] = (int8_t)(((int64_t)(( 0x000FFC0000000000 & val) << 12) >> 54) >> 2);
out[15] = ((int64_t)(( 0x000003FF00000000 & val) << 22) >> 54) & 0xFF; out[15] = (int8_t)(((int64_t)(( 0x000003FF00000000 & val) << 22) >> 54) >> 2);
out[16] = ((int64_t)(( 0x00000000FFC00000 & val) << 32) >> 54) & 0xFF; out[16] = (int8_t)(((int64_t)(( 0x00000000FFC00000 & val) << 32) >> 54) >> 2);
out[17] = ((int64_t)(( 0x00000000003FF000 & val) << 42) >> 54) & 0xFF; out[17] = (int8_t)(((int64_t)(( 0x00000000003FF000 & val) << 42) >> 54) >> 2);
out[18] = ((int64_t)(( 0x0000000000000FFC & val) << 52) >> 54) & 0xFF; out[18] = (int8_t)(((int64_t)(( 0x0000000000000FFC & val) << 52) >> 54) >> 2);
rest = ( 0x0000000000000003 & val) << 62; // 2 bits rest. rest = ( 0x0000000000000003 & val) << 62; // 2 bits rest.
// 4th: // 4th:
val = be64toh(*qword); val = be64toh(*qword);
//printf("0x%016lX\n",val); //printf("0x%016lX\n",val);
qword++; qword++;
out[19] = ((int64_t)(((0xFF00000000000000 & val) >> 2) | rest) >> 54) & 0xFF; out[19] = (int8_t)(((int64_t)(((0xFF00000000000000 & val) >> 2) | rest) >> 54) >> 2);
out[20] = ((int64_t)(( 0x00FFC00000000000 & val) << 8) >> 54) & 0xFF; out[20] = (int8_t)(((int64_t)(( 0x00FFC00000000000 & val) << 8) >> 54) >> 2);
out[21] = ((int64_t)(( 0x00003FF000000000 & val) << 18) >> 54) & 0xFF; out[21] = (int8_t)(((int64_t)(( 0x00003FF000000000 & val) << 18) >> 54) >> 2);
out[22] = ((int64_t)(( 0x0000000FFC000000 & val) << 28) >> 54) & 0xFF; out[22] = (int8_t)(((int64_t)(( 0x0000000FFC000000 & val) << 28) >> 54) >> 2);
out[23] = ((int64_t)(( 0x0000000003FF0000 & val) << 38) >> 54) & 0xFF; out[23] = (int8_t)(((int64_t)(( 0x0000000003FF0000 & val) << 38) >> 54) >> 2);
out[24] = ((int64_t)(( 0x000000000000FFC0 & val) << 48) >> 54) & 0xFF; out[24] = (int8_t)(((int64_t)(( 0x000000000000FFC0 & val) << 48) >> 54) >> 2);
rest = ( 0x000000000000003F & val) << 58; // 6 bits rest. rest = ( 0x000000000000003F & val) << 58; // 6 bits rest.
// 5th: // 5th:
val = be64toh(*qword); val = be64toh(*qword);
//printf("0x%016lX\n",val); //printf("0x%016lX\n",val);
qword++; qword++;
out[25] = ((int64_t)(((0xF000000000000000 & val) >> 6) | rest) >> 54) & 0xFF; out[25] = (int8_t)(((int64_t)(((0xF000000000000000 & val) >> 6) | rest) >> 54) >> 2);
out[26] = ((int64_t)(( 0x0FFC000000000000 & val) << 4) >> 54) & 0xFF; out[26] = (int8_t)(((int64_t)(( 0x0FFC000000000000 & val) << 4) >> 54) >> 2);
out[27] = ((int64_t)(( 0x0003FF0000000000 & val) << 14) >> 54) & 0xFF; out[27] = (int8_t)(((int64_t)(( 0x0003FF0000000000 & val) << 14) >> 54) >> 2);
out[28] = ((int64_t)(( 0x000000FFC0000000 & val) << 24) >> 54) & 0xFF; out[28] = (int8_t)(((int64_t)(( 0x000000FFC0000000 & val) << 24) >> 54) >> 2);
out[29] = ((int64_t)(( 0x000000003FF00000 & val) << 34) >> 54) & 0xFF; out[29] = (int8_t)(((int64_t)(( 0x000000003FF00000 & val) << 34) >> 54) >> 2);
out[30] = ((int64_t)(( 0x00000000000FFC00 & val) << 44) >> 54) & 0xFF; out[30] = (int8_t)(((int64_t)(( 0x00000000000FFC00 & val) << 44) >> 54) >> 2);
out[31] = ((int64_t)(( 0x00000000000003FF & val) << 54) >> 54) & 0xFF; out[31] = (int8_t)(((int64_t)(( 0x00000000000003FF & val) << 54) >> 54) >> 2);
rest = 0; // No rest. rest = 0; // No rest.
return qword; return qword;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment