2237 sve_and(vtmp, T, min_jlong);
2238 sve_orr(vtmp, T, jlong_cast(1.0));
2239 break;
2240 default:
2241 assert(false, "unsupported");
2242 ShouldNotReachHere();
2243 }
2244 sve_sel(dst, T, pgtmp, vtmp, src); // Select either from src or vtmp based on the predicate register pgtmp
2245 // Result in dst
2246 }
2247
2248 bool C2_MacroAssembler::in_scratch_emit_size() {
2249 if (ciEnv::current()->task() != nullptr) {
2250 PhaseOutput* phase_output = Compile::current()->output();
2251 if (phase_output != nullptr && phase_output->in_scratch_emit_size()) {
2252 return true;
2253 }
2254 }
2255 return MacroAssembler::in_scratch_emit_size();
2256 }
|
2237 sve_and(vtmp, T, min_jlong);
2238 sve_orr(vtmp, T, jlong_cast(1.0));
2239 break;
2240 default:
2241 assert(false, "unsupported");
2242 ShouldNotReachHere();
2243 }
2244 sve_sel(dst, T, pgtmp, vtmp, src); // Select either from src or vtmp based on the predicate register pgtmp
2245 // Result in dst
2246 }
2247
2248 bool C2_MacroAssembler::in_scratch_emit_size() {
2249 if (ciEnv::current()->task() != nullptr) {
2250 PhaseOutput* phase_output = Compile::current()->output();
2251 if (phase_output != nullptr && phase_output->in_scratch_emit_size()) {
2252 return true;
2253 }
2254 }
2255 return MacroAssembler::in_scratch_emit_size();
2256 }
2257
2258 void C2_MacroAssembler::load_nklass_compact(Register dst, Register obj, Register index, int scale, int disp) {
2259 C2LoadNKlassStub* stub = new (Compile::current()->comp_arena()) C2LoadNKlassStub(dst);
2260 Compile::current()->output()->add_stub(stub);
2261
2262 // Note: Don't clobber obj anywhere in that method!
2263
2264 // The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
2265 // obj-start, so that we can load from the object's mark-word instead. Usually the address
2266 // comes as obj-start in obj and klass_offset_in_bytes in disp. However, sometimes C2
2267 // emits code that pre-computes obj-start + klass_offset_in_bytes into a register, and
2268 // then passes that register as obj and 0 in disp. The following code extracts the base
2269 // and offset to load the mark-word.
2270 int offset = oopDesc::mark_offset_in_bytes() + disp - oopDesc::klass_offset_in_bytes();
2271 if (index == noreg) {
2272 ldr(dst, Address(obj, offset));
2273 } else {
2274 lea(dst, Address(obj, index, Address::lsl(scale)));
2275 ldr(dst, Address(dst, offset));
2276 }
2277 // NOTE: We can't use tbnz here, because the target is sometimes too far away
2278 // and cannot be encoded.
2279 tst(dst, markWord::monitor_value);
2280 br(Assembler::NE, stub->entry());
2281 bind(stub->continuation());
2282 lsr(dst, dst, markWord::klass_shift);
2283 }
|