On 08/09/2016 03:42 PM, Rajalakshmi Srinivasaraghavan wrote:
+void helper_vbpermd(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + int i, j; + uint64_t perm = 0; + + VECTOR_FOR_INORDER_I(i, u64) { + perm = 0; + for (j = 0; j < 8; j++) { + 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; + }
You need to care for overlap between R vs {A,B}. r~