On 9/11/19 2:25 AM, liuzhiwei wrote: > + for (i = 0; i < vlmax; i++) { > + if (i < env->vfp.vstart) { > + continue; > + } else if (i < vl) { > + tmp = ~vector_mask_reg(env, rs1, width, lmul, i) & > + vector_mask_reg(env, rs2, width, lmul, i); > + vector_mask_result(env, rd, width, lmul, i, tmp); > + } else { > + vector_mask_result(env, rd, width, lmul, i, 0); > + } > + }
These can be processed in uint64_t units, with a mask based on width: 8: 0xffffffffffffffff 16: 0x5555555555555555 32: 0x1111111111111111 64: 0x0101010101010101 dest = ~in1 & in2 & mask; with an additional final mask to handle vl not being a multiple of 64. Again, I urge you not to bother with impossible vstart -- instructions like this cannot be interrupted, and the spec allows you to not handle values of vstart that cannot be produced by the implementation. r~