< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

6162   // Perform above steps with lane comparison expression as INDEX >= 48 && INDEX < 64
6163   // and broadcasting third 128 bit lane.
6164   evpcmpb(ktmp, k0, shuffle,  xtmp1, Assembler::nlt, true, vlen_enc);
6165   vpsllq(xtmp2, xtmp2, 0x1, vlen_enc);
6166   evpcmpb(ktmp, ktmp, shuffle,  xtmp2, Assembler::lt, true, vlen_enc);
6167   evshufi64x2(xtmp3, src, src, 0xFF, vlen_enc);
6168   evpshufb(dst, ktmp, xtmp3, shuffle, true, vlen_enc);
6169 }
6170 
6171 void C2_MacroAssembler::vector_rearrange_int_float(BasicType bt, XMMRegister dst,
6172                                                    XMMRegister shuffle, XMMRegister src, int vlen_enc) {
6173   if (vlen_enc == AVX_128bit) {
6174     vpermilps(dst, src, shuffle, vlen_enc);
6175   } else if (bt == T_INT) {
6176     vpermd(dst, shuffle, src, vlen_enc);
6177   } else {
6178     assert(bt == T_FLOAT, "");
6179     vpermps(dst, shuffle, src, vlen_enc);
6180   }
6181 }























6162   // Perform above steps with lane comparison expression as INDEX >= 48 && INDEX < 64
6163   // and broadcasting third 128 bit lane.
6164   evpcmpb(ktmp, k0, shuffle,  xtmp1, Assembler::nlt, true, vlen_enc);
6165   vpsllq(xtmp2, xtmp2, 0x1, vlen_enc);
6166   evpcmpb(ktmp, ktmp, shuffle,  xtmp2, Assembler::lt, true, vlen_enc);
6167   evshufi64x2(xtmp3, src, src, 0xFF, vlen_enc);
6168   evpshufb(dst, ktmp, xtmp3, shuffle, true, vlen_enc);
6169 }
6170 
6171 void C2_MacroAssembler::vector_rearrange_int_float(BasicType bt, XMMRegister dst,
6172                                                    XMMRegister shuffle, XMMRegister src, int vlen_enc) {
6173   if (vlen_enc == AVX_128bit) {
6174     vpermilps(dst, src, shuffle, vlen_enc);
6175   } else if (bt == T_INT) {
6176     vpermd(dst, shuffle, src, vlen_enc);
6177   } else {
6178     assert(bt == T_FLOAT, "");
6179     vpermps(dst, shuffle, src, vlen_enc);
6180   }
6181 }
6182 
6183 #ifdef _LP64
6184 void C2_MacroAssembler::load_nklass_compact_c2(Register dst, Register obj, Register index, Address::ScaleFactor scale, int disp) {
6185   C2LoadNKlassStub* stub = new (Compile::current()->comp_arena()) C2LoadNKlassStub(dst);
6186   Compile::current()->output()->add_stub(stub);
6187 
6188   // Note: Don't clobber obj anywhere in that method!
6189 
6190   // The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
6191   // obj-start, so that we can load from the object's mark-word instead. Usually the address
6192   // comes as obj-start in obj and klass_offset_in_bytes in disp. However, sometimes C2
6193   // emits code that pre-computes obj-start + klass_offset_in_bytes into a register, and
6194   // then passes that register as obj and 0 in disp. The following code extracts the base
6195   // and offset to load the mark-word.
6196   int offset = oopDesc::mark_offset_in_bytes() + disp - oopDesc::klass_offset_in_bytes();
6197   movq(dst, Address(obj, index, scale, offset));
6198   testb(dst, markWord::monitor_value);
6199   jcc(Assembler::notZero, stub->entry());
6200   bind(stub->continuation());
6201   shrq(dst, markWord::klass_shift);
6202 }
6203 #endif
< prev index next >