On 08/04/2016 06:33 PM, Rajalakshmi Srinivasaraghavan wrote:
+ uint64_t perm = 0;
Move the variable inside the loop.
+ VECTOR_FOR_INORDER_I(i, u64) { + perm = 0; + VECTOR_FOR_INORDER_I(j, u16) {
Surely this is more clearly written as for (j = 0; j < 8; ++j) since u16 really has nothing to do with this.
+ int index = VBPERMQ_INDEX(b, (i * 8) + j); + if (index < 64) { + uint64_t mask = (1ull << (63 - (index & 0x3F))); + if (a->u64[VBPERMQ_DW(index)] & mask) { + perm |= (0x80 >> j); + } + } + r->u64[i] = perm; + } + }
The final assignment of perm is done in the wrong loop. r~