8199421: Add support for vector popcount

Reviewed-by: kvn
This commit is contained in:
Razvan Lupusoru 2018-03-13 10:22:15 -07:00
parent 147488cbce
commit 343cf9910d
13 changed files with 209 additions and 6 deletions

View file

@ -8709,6 +8709,15 @@ void Assembler::popcntq(Register dst, Register src) {
emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vpopcntd(XMMRegister dst, XMMRegister src, int vector_len) {
assert(VM_Version::supports_vpopcntdq(), "must support vpopcntdq feature");
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true);
attributes.set_is_evex_instruction();
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
emit_int8(0x55);
emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::popq(Address dst) {
InstructionMark im(this);
prefixq(dst);