< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

6477   // Perform above steps with lane comparison expression as INDEX >= 48 && INDEX < 64
6478   // and broadcasting third 128 bit lane.
6479   evpcmpb(ktmp, k0, shuffle,  xtmp1, Assembler::nlt, true, vlen_enc);
6480   vpsllq(xtmp2, xtmp2, 0x1, vlen_enc);
6481   evpcmpb(ktmp, ktmp, shuffle,  xtmp2, Assembler::lt, true, vlen_enc);
6482   evshufi64x2(xtmp3, src, src, 0xFF, vlen_enc);
6483   evpshufb(dst, ktmp, xtmp3, shuffle, true, vlen_enc);
6484 }
6485 
6486 void C2_MacroAssembler::vector_rearrange_int_float(BasicType bt, XMMRegister dst,
6487                                                    XMMRegister shuffle, XMMRegister src, int vlen_enc) {
6488   if (vlen_enc == AVX_128bit) {
6489     vpermilps(dst, src, shuffle, vlen_enc);
6490   } else if (bt == T_INT) {
6491     vpermd(dst, shuffle, src, vlen_enc);
6492   } else {
6493     assert(bt == T_FLOAT, "");
6494     vpermps(dst, shuffle, src, vlen_enc);
6495   }
6496 }























6477   // Perform above steps with lane comparison expression as INDEX >= 48 && INDEX < 64
6478   // and broadcasting third 128 bit lane.
6479   evpcmpb(ktmp, k0, shuffle,  xtmp1, Assembler::nlt, true, vlen_enc);
6480   vpsllq(xtmp2, xtmp2, 0x1, vlen_enc);
6481   evpcmpb(ktmp, ktmp, shuffle,  xtmp2, Assembler::lt, true, vlen_enc);
6482   evshufi64x2(xtmp3, src, src, 0xFF, vlen_enc);
6483   evpshufb(dst, ktmp, xtmp3, shuffle, true, vlen_enc);
6484 }
6485 
6486 void C2_MacroAssembler::vector_rearrange_int_float(BasicType bt, XMMRegister dst,
6487                                                    XMMRegister shuffle, XMMRegister src, int vlen_enc) {
6488   if (vlen_enc == AVX_128bit) {
6489     vpermilps(dst, src, shuffle, vlen_enc);
6490   } else if (bt == T_INT) {
6491     vpermd(dst, shuffle, src, vlen_enc);
6492   } else {
6493     assert(bt == T_FLOAT, "");
6494     vpermps(dst, shuffle, src, vlen_enc);
6495   }
6496 }
6497 
6498 #ifdef _LP64
6499 void C2_MacroAssembler::load_nklass_compact_c2(Register dst, Register obj, Register index, Address::ScaleFactor scale, int disp) {
6500   C2LoadNKlassStub* stub = new (Compile::current()->comp_arena()) C2LoadNKlassStub(dst);
6501   Compile::current()->output()->add_stub(stub);
6502 
6503   // Note: Don't clobber obj anywhere in that method!
6504 
6505   // The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
6506   // obj-start, so that we can load from the object's mark-word instead. Usually the address
6507   // comes as obj-start in obj and klass_offset_in_bytes in disp. However, sometimes C2
6508   // emits code that pre-computes obj-start + klass_offset_in_bytes into a register, and
6509   // then passes that register as obj and 0 in disp. The following code extracts the base
6510   // and offset to load the mark-word.
6511   int offset = oopDesc::mark_offset_in_bytes() + disp - oopDesc::klass_offset_in_bytes();
6512   movq(dst, Address(obj, index, scale, offset));
6513   testb(dst, markWord::monitor_value);
6514   jcc(Assembler::notZero, stub->entry());
6515   bind(stub->continuation());
6516   shrq(dst, markWord::klass_shift);
6517 }
6518 #endif
< prev index next >