Skip to content
Permalink
Browse files
8267370: [Vector API] Fix several crashes after JDK-8256973
Co-authored-by: Jatin Bhateja <jbhateja@openjdk.org>
Reviewed-by: neliasso, kvn
  • Loading branch information
DamonFool and Jatin Bhateja committed May 20, 2021
1 parent 83b3607 commit 7a63ff70c8eed6c5bfad5655f0f4fa2281b4e104
@@ -4123,9 +4123,10 @@ void Assembler::pmovmskb(Register dst, XMMRegister src) {
emit_int16((unsigned char)0xD7, (0xC0 | encode));
}

void Assembler::vpmovmskb(Register dst, XMMRegister src) {
assert(VM_Version::supports_avx2(), "");
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
void Assembler::vpmovmskb(Register dst, XMMRegister src, int vec_enc) {
assert((VM_Version::supports_avx() && vec_enc == AVX_128bit) ||
(VM_Version::supports_avx2() && vec_enc == AVX_256bit), "");
InstructionAttr attributes(vec_enc, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
emit_int16((unsigned char)0xD7, (0xC0 | encode));
}
@@ -1746,7 +1746,7 @@ class Assembler : public AbstractAssembler {
void vpcmpgtq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len);

void pmovmskb(Register dst, XMMRegister src);
void vpmovmskb(Register dst, XMMRegister src);
void vpmovmskb(Register dst, XMMRegister src, int vec_enc);

// SSE 4.1 extract
void pextrd(Register dst, XMMRegister src, int imm8);
@@ -3782,7 +3782,7 @@ void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister
assert(VM_Version::supports_avx(), "");
vpxor(xtmp, xtmp, xtmp, vec_enc);
vpsubb(xtmp, xtmp, mask, vec_enc);
vpmovmskb(tmp, xtmp);
vpmovmskb(tmp, xtmp, vec_enc);
switch(opc) {
case Op_VectorMaskTrueCount:
popcntq(dst, tmp);
@@ -3216,9 +3216,9 @@ void MacroAssembler::vpmovzxbw(XMMRegister dst, Address src, int vector_len) {
Assembler::vpmovzxbw(dst, src, vector_len);
}

void MacroAssembler::vpmovmskb(Register dst, XMMRegister src) {
void MacroAssembler::vpmovmskb(Register dst, XMMRegister src, int vector_len) {
assert((src->encoding() < 16),"XMM register should be 0-15");
Assembler::vpmovmskb(dst, src);
Assembler::vpmovmskb(dst, src, vector_len);
}

void MacroAssembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
@@ -1303,7 +1303,7 @@ class MacroAssembler: public Assembler {
void vpmovzxbw(XMMRegister dst, Address src, int vector_len);
void vpmovzxbw(XMMRegister dst, XMMRegister src, int vector_len) { Assembler::vpmovzxbw(dst, src, vector_len); }

void vpmovmskb(Register dst, XMMRegister src);
void vpmovmskb(Register dst, XMMRegister src, int vector_len = Assembler::AVX_256bit);

void vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len);
void vpmullw(XMMRegister dst, XMMRegister nds, Address src, int vector_len);

0 comments on commit 7a63ff7

Please sign in to comment.