1.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp Thu Sep 22 13:16:27 2016 -0700 1.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp Thu May 24 17:06:56 2018 +0800 1.3 @@ -22,6 +22,12 @@ 1.4 * 1.5 */ 1.6 1.7 +/* 1.8 + * This file has been modified by Loongson Technology in 2015. These 1.9 + * modifications are Copyright (c) 2015 Loongson Technology, and are made 1.10 + * available on the same license terms set forth above. 1.11 + */ 1.12 + 1.13 #include "precompiled.hpp" 1.14 #include "c1/c1_Defs.hpp" 1.15 #include "c1/c1_Compilation.hpp" 1.16 @@ -305,6 +311,14 @@ 1.17 1.18 void LIRGenerator::init() { 1.19 _bs = Universe::heap()->barrier_set(); 1.20 +#ifdef MIPS64 1.21 + assert(_bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind"); 1.22 + CardTableModRefBS* ct = (CardTableModRefBS*)_bs; 1.23 + assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); 1.24 + //_card_table_base = new LIR_Const((intptr_t)ct->byte_map_base); 1.25 + // //FIXME, untested in 32bit. by aoqi 1.26 + _card_table_base = new LIR_Const(ct->byte_map_base); 1.27 +#endif 1.28 } 1.29 1.30 1.31 @@ -482,13 +496,27 @@ 1.32 CodeEmitInfo* null_check_info, CodeEmitInfo* range_check_info) { 1.33 CodeStub* stub = new RangeCheckStub(range_check_info, index); 1.34 if (index->is_constant()) { 1.35 +#ifndef MIPS64 1.36 cmp_mem_int(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), 1.37 index->as_jint(), null_check_info); 1.38 __ branch(lir_cond_belowEqual, T_INT, stub); // forward branch 1.39 +#else 1.40 + LIR_Opr left = LIR_OprFact::address(new LIR_Address(array, arrayOopDesc::length_offset_in_bytes(), T_INT)); 1.41 + LIR_Opr right = LIR_OprFact::intConst(index->as_jint()); 1.42 + __ null_check_for_branch(lir_cond_belowEqual, left, right, null_check_info); 1.43 + __ branch(lir_cond_belowEqual, left, right ,T_INT, stub); // forward branch 1.44 +#endif 1.45 } else { 1.46 +#ifndef MIPS64 1.47 cmp_reg_mem(lir_cond_aboveEqual, index, array, 1.48 arrayOopDesc::length_offset_in_bytes(), T_INT, null_check_info); 1.49 __ branch(lir_cond_aboveEqual, T_INT, stub); // forward branch 1.50 +#else 1.51 + LIR_Opr left = index; 1.52 + LIR_Opr right = LIR_OprFact::address(new LIR_Address( array, arrayOopDesc::length_offset_in_bytes(), T_INT)); 1.53 + __ null_check_for_branch(lir_cond_aboveEqual, left, right, null_check_info); 1.54 + __ branch(lir_cond_aboveEqual,left, right ,T_INT, stub); // forward branch 1.55 +#endif 1.56 } 1.57 } 1.58 1.59 @@ -496,12 +524,26 @@ 1.60 void LIRGenerator::nio_range_check(LIR_Opr buffer, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) { 1.61 CodeStub* stub = new RangeCheckStub(info, index, true); 1.62 if (index->is_constant()) { 1.63 +#ifndef MIPS64 1.64 cmp_mem_int(lir_cond_belowEqual, buffer, java_nio_Buffer::limit_offset(), index->as_jint(), info); 1.65 __ branch(lir_cond_belowEqual, T_INT, stub); // forward branch 1.66 +#else 1.67 + LIR_Opr left = LIR_OprFact::address(new LIR_Address(buffer, java_nio_Buffer::limit_offset(),T_INT)); 1.68 + LIR_Opr right = LIR_OprFact::intConst(index->as_jint()); 1.69 + __ null_check_for_branch(lir_cond_belowEqual, left, right, info); 1.70 + __ branch(lir_cond_belowEqual,left, right ,T_INT, stub); // forward branch 1.71 +#endif 1.72 } else { 1.73 +#ifndef MIPS64 1.74 cmp_reg_mem(lir_cond_aboveEqual, index, buffer, 1.75 java_nio_Buffer::limit_offset(), T_INT, info); 1.76 __ branch(lir_cond_aboveEqual, T_INT, stub); // forward branch 1.77 +#else 1.78 + LIR_Opr left = index; 1.79 + LIR_Opr right = LIR_OprFact::address(new LIR_Address( buffer, java_nio_Buffer::limit_offset(), T_INT)); 1.80 + __ null_check_for_branch(lir_cond_aboveEqual, left, right, info); 1.81 + __ branch(lir_cond_aboveEqual,left, right ,T_INT, stub); // forward branch 1.82 +#endif 1.83 } 1.84 __ move(index, result); 1.85 } 1.86 @@ -671,7 +713,12 @@ 1.87 } 1.88 #endif 1.89 1.90 +#ifndef MIPS64 1.91 void LIRGenerator::new_instance(LIR_Opr dst, ciInstanceKlass* klass, bool is_unresolved, LIR_Opr scratch1, LIR_Opr scratch2, LIR_Opr scratch3, LIR_Opr scratch4, LIR_Opr klass_reg, CodeEmitInfo* info) { 1.92 +#else 1.93 +void LIRGenerator::new_instance(LIR_Opr dst, ciInstanceKlass* klass, bool is_unresolved, LIR_Opr scratch1, LIR_Opr scratch2, LIR_Opr scratch3, 1.94 + LIR_Opr scratch4, LIR_Opr scratch5, LIR_Opr scratch6,LIR_Opr klass_reg, CodeEmitInfo* info) { 1.95 +#endif 1.96 klass2reg_with_patching(klass_reg, klass, info, is_unresolved); 1.97 // If klass is not loaded we do not know if the klass has finalizers: 1.98 if (UseFastNewInstance && klass->is_loaded() 1.99 @@ -685,12 +732,23 @@ 1.100 // allocate space for instance 1.101 assert(klass->size_helper() >= 0, "illegal instance size"); 1.102 const int instance_size = align_object_size(klass->size_helper()); 1.103 +#ifndef MIPS64 1.104 __ allocate_object(dst, scratch1, scratch2, scratch3, scratch4, 1.105 oopDesc::header_size(), instance_size, klass_reg, !klass->is_initialized(), slow_path); 1.106 +#else 1.107 + __ allocate_object(dst, scratch1, scratch2, scratch3, scratch4, scratch5, scratch6, 1.108 + oopDesc::header_size(), instance_size, klass_reg, !klass->is_initialized(), slow_path); 1.109 + 1.110 +#endif 1.111 } else { 1.112 CodeStub* slow_path = new NewInstanceStub(klass_reg, dst, klass, info, Runtime1::new_instance_id); 1.113 +#ifndef MIPS64 1.114 __ branch(lir_cond_always, T_ILLEGAL, slow_path); 1.115 __ branch_destination(slow_path->continuation()); 1.116 +#else 1.117 + __ branch(lir_cond_always, LIR_OprFact::illegalOpr, LIR_OprFact::illegalOpr, T_ILLEGAL, slow_path); 1.118 + __ branch_destination(slow_path->continuation()); 1.119 +#endif 1.120 } 1.121 } 1.122 1.123 @@ -934,6 +992,7 @@ 1.124 return tmp; 1.125 } 1.126 1.127 +#ifndef MIPS64 1.128 void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { 1.129 if (if_instr->should_profile()) { 1.130 ciMethod* method = if_instr->profiled_method(); 1.131 @@ -970,6 +1029,55 @@ 1.132 __ move(data_reg, data_addr); 1.133 } 1.134 } 1.135 +#else 1.136 +void LIRGenerator::profile_branch(If* if_instr, If::Condition cond , LIR_Opr left, LIR_Opr right) { 1.137 + if (if_instr->should_profile()) { 1.138 + ciMethod* method = if_instr->profiled_method(); 1.139 + assert(method != NULL, "method should be set if branch is profiled"); 1.140 + ciMethodData* md = method->method_data_or_null(); 1.141 + if (md == NULL) { 1.142 + bailout("out of memory building methodDataOop"); 1.143 + return; 1.144 + } 1.145 + ciProfileData* data = md->bci_to_data(if_instr->profiled_bci()); 1.146 + assert(data != NULL, "must have profiling data"); 1.147 + assert(data->is_BranchData(), "need BranchData for two-way branches"); 1.148 + int taken_count_offset = md->byte_offset_of_slot(data, BranchData::taken_offset()); 1.149 + int not_taken_count_offset = md->byte_offset_of_slot(data, BranchData::not_taken_offset()); 1.150 + if (if_instr->is_swapped()) { 1.151 + int t = taken_count_offset; 1.152 + taken_count_offset = not_taken_count_offset; 1.153 + not_taken_count_offset = t; 1.154 + } 1.155 + LIR_Opr md_reg = new_register(T_METADATA); 1.156 + __ metadata2reg(md->constant_encoding(), md_reg); 1.157 + //__ move(LIR_OprFact::oopConst(md->constant_encoding()), md_reg); 1.158 + LIR_Opr data_offset_reg = new_pointer_register(); 1.159 + 1.160 + LIR_Opr opr1 = LIR_OprFact::intConst(taken_count_offset); 1.161 + LIR_Opr opr2 = LIR_OprFact::intConst(not_taken_count_offset); 1.162 + LabelObj* skip = new LabelObj(); 1.163 + 1.164 + __ move(opr1, data_offset_reg); 1.165 + __ branch( lir_cond(cond), left, right, skip->label()); 1.166 + __ move(opr2, data_offset_reg); 1.167 + __ branch_destination(skip->label()); 1.168 + 1.169 + LIR_Opr data_reg = new_pointer_register(); 1.170 + LIR_Opr tmp_reg = new_pointer_register(); 1.171 + // LIR_Address* data_addr = new LIR_Address(md_reg, data_offset_reg, T_INT); 1.172 + __ move(data_offset_reg, tmp_reg); 1.173 + __ add(tmp_reg, md_reg, tmp_reg); 1.174 + LIR_Address* data_addr = new LIR_Address(tmp_reg, 0, T_INT); 1.175 + __ move(LIR_OprFact::address(data_addr), data_reg); 1.176 + LIR_Address* fake_incr_value = new LIR_Address(data_reg, DataLayout::counter_increment, T_INT); 1.177 + // Use leal instead of add to avoid destroying condition codes on x86 1.178 + __ leal(LIR_OprFact::address(fake_incr_value), data_reg); 1.179 + __ move(data_reg, LIR_OprFact::address(data_addr)); 1.180 + } 1.181 +} 1.182 + 1.183 +#endif 1.184 1.185 // Phi technique: 1.186 // This is about passing live values from one basic block to the other. 1.187 @@ -1096,6 +1204,35 @@ 1.188 } 1.189 return NULL; 1.190 } 1.191 +#ifdef MIPS64 1.192 +void LIRGenerator::write_barrier(LIR_Opr addr) { 1.193 + if (addr->is_address()) { 1.194 + LIR_Address* address = (LIR_Address*)addr; 1.195 + LIR_Opr ptr = new_register(T_OBJECT); 1.196 + if (!address->index()->is_valid() && address->disp() == 0) { 1.197 + __ move(address->base(), ptr); 1.198 + } else { 1.199 + __ leal(addr, ptr); 1.200 + } 1.201 + addr = ptr; 1.202 + } 1.203 + assert(addr->is_register(), "must be a register at this point"); 1.204 + 1.205 + LIR_Opr tmp = new_pointer_register(); 1.206 + if (TwoOperandLIRForm) { 1.207 + __ move(addr, tmp); 1.208 + __ unsigned_shift_right(tmp, CardTableModRefBS::card_shift, tmp); 1.209 + } else { 1.210 + __ unsigned_shift_right(addr, CardTableModRefBS::card_shift, tmp); 1.211 + } 1.212 + if (can_inline_as_constant(card_table_base())) { 1.213 + __ move(LIR_OprFact::intConst(0), new LIR_Address(tmp, card_table_base()->as_jint(), T_BYTE)); 1.214 + } else { 1.215 + __ add(tmp, load_constant(card_table_base()), tmp); 1.216 + __ move(LIR_OprFact::intConst(0), new LIR_Address(tmp, 0, T_BYTE)); 1.217 + } 1.218 +} 1.219 +#endif 1.220 1.221 1.222 void LIRGenerator::do_ExceptionObject(ExceptionObject* x) { 1.223 @@ -1481,7 +1618,10 @@ 1.224 // Read the marking-in-progress flag. 1.225 LIR_Opr flag_val = new_register(T_INT); 1.226 __ load(mark_active_flag_addr, flag_val); 1.227 + //MIPS not support cmp. 1.228 +#ifndef MIPS64 1.229 __ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0)); 1.230 +#endif 1.231 1.232 LIR_PatchCode pre_val_patch_code = lir_patch_none; 1.233 1.234 @@ -1510,7 +1650,11 @@ 1.235 slow = new G1PreBarrierStub(pre_val); 1.236 } 1.237 1.238 +#ifndef MIPS64 1.239 __ branch(lir_cond_notEqual, T_INT, slow); 1.240 +#else 1.241 + __ branch(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0), T_INT, slow); 1.242 +#endif 1.243 __ branch_destination(slow->continuation()); 1.244 } 1.245 1.246 @@ -1568,10 +1712,16 @@ 1.247 } 1.248 assert(new_val->is_register(), "must be a register at this point"); 1.249 1.250 +#ifndef MIPS64 1.251 __ cmp(lir_cond_notEqual, xor_shift_res, LIR_OprFact::intptrConst(NULL_WORD)); 1.252 1.253 +#endif 1.254 CodeStub* slow = new G1PostBarrierStub(addr, new_val); 1.255 +#ifndef MIPS64 1.256 __ branch(lir_cond_notEqual, LP64_ONLY(T_LONG) NOT_LP64(T_INT), slow); 1.257 +#else 1.258 + __ branch(lir_cond_notEqual, xor_shift_res, LIR_OprFact::intptrConst((intptr_t)NULL_WORD), LP64_ONLY(T_LONG) NOT_LP64(T_INT), slow); 1.259 +#endif 1.260 __ branch_destination(slow->continuation()); 1.261 } 1.262 1.263 @@ -1611,9 +1761,16 @@ 1.264 __ move(LIR_OprFact::intConst(0), 1.265 new LIR_Address(tmp, card_table_base->as_jint(), T_BYTE)); 1.266 } else { 1.267 +#ifndef MIPS64 1.268 __ move(LIR_OprFact::intConst(0), 1.269 new LIR_Address(tmp, load_constant(card_table_base), 1.270 T_BYTE)); 1.271 +#else 1.272 + __ add(tmp, load_constant(card_table_base), tmp); 1.273 + __ move(LIR_OprFact::intConst(0), 1.274 + new LIR_Address(tmp, 0, 1.275 + T_BYTE)); 1.276 +#endif 1.277 } 1.278 #endif 1.279 } 1.280 @@ -1832,12 +1989,28 @@ 1.281 CodeEmitInfo* info = state_for(x); 1.282 CodeStub* stub = new RangeCheckStub(info, index.result(), true); 1.283 if (index.result()->is_constant()) { 1.284 +#ifndef MIPS64 1.285 cmp_mem_int(lir_cond_belowEqual, buf.result(), java_nio_Buffer::limit_offset(), index.result()->as_jint(), info); 1.286 __ branch(lir_cond_belowEqual, T_INT, stub); 1.287 +#else 1.288 + LIR_Opr left = LIR_OprFact::address(new LIR_Address( buf.result(), 1.289 + java_nio_Buffer::limit_offset(),T_INT)); 1.290 + LIR_Opr right = LIR_OprFact::intConst(index.result()->as_jint()); 1.291 + __ null_check_for_branch(lir_cond_belowEqual, left, right, info); 1.292 + __ branch(lir_cond_belowEqual,left, right ,T_INT, stub); // forward branch 1.293 + 1.294 +#endif 1.295 } else { 1.296 +#ifndef MIPS64 1.297 cmp_reg_mem(lir_cond_aboveEqual, index.result(), buf.result(), 1.298 java_nio_Buffer::limit_offset(), T_INT, info); 1.299 __ branch(lir_cond_aboveEqual, T_INT, stub); 1.300 +#else 1.301 + LIR_Opr right = LIR_OprFact::address(new LIR_Address( buf.result(), java_nio_Buffer::limit_offset(),T_INT)); 1.302 + LIR_Opr left = index.result(); 1.303 + __ null_check_for_branch(lir_cond_aboveEqual, left, right, info); 1.304 + __ branch(lir_cond_aboveEqual, left, right , T_INT, stub); // forward branch 1.305 +#endif 1.306 } 1.307 __ move(index.result(), result); 1.308 } else { 1.309 @@ -1914,12 +2087,21 @@ 1.310 1.311 if (GenerateRangeChecks && needs_range_check) { 1.312 if (StressLoopInvariantCodeMotion && range_check_info->deoptimize_on_exception()) { 1.313 +#ifndef MIPS64 1.314 __ branch(lir_cond_always, T_ILLEGAL, new RangeCheckStub(range_check_info, index.result())); 1.315 +#else 1.316 + tty->print_cr("LIRGenerator::do_LoadIndexed(LoadIndexed* x) unimplemented yet!"); 1.317 + Unimplemented(); 1.318 +#endif 1.319 } else if (use_length) { 1.320 // TODO: use a (modified) version of array_range_check that does not require a 1.321 // constant length to be loaded to a register 1.322 +#ifndef MIPS64 1.323 __ cmp(lir_cond_belowEqual, length.result(), index.result()); 1.324 __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result())); 1.325 +#else 1.326 + __ branch(lir_cond_belowEqual, length.result(), index.result(),T_INT, new RangeCheckStub(range_check_info, index.result())); 1.327 +#endif 1.328 } else { 1.329 array_range_check(array.result(), index.result(), null_check_info, range_check_info); 1.330 // The range check performs the null check, so clear it out for the load 1.331 @@ -2107,7 +2289,19 @@ 1.332 addr = generate_address(base_op, index_op, log2_scale, 0, dst_type); 1.333 #else 1.334 if (index_op->is_illegal() || log2_scale == 0) { 1.335 +#ifndef MIPS64 1.336 addr = new LIR_Address(base_op, index_op, dst_type); 1.337 +#else 1.338 + #ifdef _LP64 1.339 + LIR_Opr ptr = new_register(T_LONG); 1.340 + #else 1.341 + LIR_Opr ptr = new_register(T_INT); 1.342 + #endif 1.343 + __ move(base_op, ptr); 1.344 + if(index_op -> is_valid()) 1.345 + __ add(ptr, index_op, ptr); 1.346 + addr = new LIR_Address(ptr, 0, dst_type); 1.347 +#endif 1.348 } else { 1.349 LIR_Opr tmp = new_pointer_register(); 1.350 __ shift_left(index_op, log2_scale, tmp); 1.351 @@ -2317,14 +2511,22 @@ 1.352 referent_off = new_register(T_LONG); 1.353 __ move(LIR_OprFact::longConst(java_lang_ref_Reference::referent_offset), referent_off); 1.354 } 1.355 +#ifndef MIPS64 1.356 __ cmp(lir_cond_notEqual, off.result(), referent_off); 1.357 __ branch(lir_cond_notEqual, as_BasicType(off.type()), Lcont->label()); 1.358 +#else 1.359 + __ branch(lir_cond_notEqual, off.result(), referent_off, Lcont->label()); 1.360 +#endif 1.361 } 1.362 if (gen_source_check) { 1.363 // offset is a const and equals referent offset 1.364 // if (source == null) -> continue 1.365 +#ifndef MIPS64 1.366 __ cmp(lir_cond_equal, src.result(), LIR_OprFact::oopConst(NULL)); 1.367 __ branch(lir_cond_equal, T_OBJECT, Lcont->label()); 1.368 +#else 1.369 + __ branch(lir_cond_equal, src.result(), LIR_OprFact::oopConst(NULL), Lcont->label()); 1.370 +#endif 1.371 } 1.372 LIR_Opr src_klass = new_register(T_OBJECT); 1.373 if (gen_type_check) { 1.374 @@ -2334,8 +2536,12 @@ 1.375 LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE); 1.376 LIR_Opr reference_type = new_register(T_INT); 1.377 __ move(reference_type_addr, reference_type); 1.378 +#ifndef MIPS64 1.379 __ cmp(lir_cond_equal, reference_type, LIR_OprFact::intConst(REF_NONE)); 1.380 __ branch(lir_cond_equal, T_INT, Lcont->label()); 1.381 +#else 1.382 + __ branch(lir_cond_equal, reference_type, LIR_OprFact::intConst(REF_NONE), Lcont->label()); 1.383 +#endif 1.384 } 1.385 { 1.386 // We have determined that src->_klass->_reference_type != REF_NONE 1.387 @@ -2415,20 +2621,36 @@ 1.388 int high_key = one_range->high_key(); 1.389 BlockBegin* dest = one_range->sux(); 1.390 if (low_key == high_key) { 1.391 +#ifndef MIPS64 1.392 __ cmp(lir_cond_equal, value, low_key); 1.393 __ branch(lir_cond_equal, T_INT, dest); 1.394 +#else 1.395 + __ branch(lir_cond_equal, value, LIR_OprFact::intConst(low_key), T_INT, dest); 1.396 +#endif 1.397 } else if (high_key - low_key == 1) { 1.398 +#ifndef MIPS64 1.399 __ cmp(lir_cond_equal, value, low_key); 1.400 __ branch(lir_cond_equal, T_INT, dest); 1.401 __ cmp(lir_cond_equal, value, high_key); 1.402 __ branch(lir_cond_equal, T_INT, dest); 1.403 +#else 1.404 + __ branch(lir_cond_equal, value, LIR_OprFact::intConst(low_key), T_INT, dest); 1.405 + __ branch(lir_cond_equal, value, LIR_OprFact::intConst(high_key), T_INT, dest); 1.406 + 1.407 +#endif 1.408 } else { 1.409 LabelObj* L = new LabelObj(); 1.410 +#ifndef MIPS64 1.411 __ cmp(lir_cond_less, value, low_key); 1.412 __ branch(lir_cond_less, T_INT, L->label()); 1.413 __ cmp(lir_cond_lessEqual, value, high_key); 1.414 __ branch(lir_cond_lessEqual, T_INT, dest); 1.415 __ branch_destination(L->label()); 1.416 +#else 1.417 + __ branch(lir_cond_less, value, LIR_OprFact::intConst(low_key), L->label()); 1.418 + __ branch(lir_cond_lessEqual, value, LIR_OprFact::intConst(high_key), T_INT, dest); 1.419 + __ branch_destination(L->label()); 1.420 +#endif 1.421 } 1.422 } 1.423 __ jump(default_sux); 1.424 @@ -2514,8 +2736,12 @@ 1.425 do_SwitchRanges(create_lookup_ranges(x), value, x->default_sux()); 1.426 } else { 1.427 for (int i = 0; i < len; i++) { 1.428 +#ifndef MIPS64 1.429 __ cmp(lir_cond_equal, value, i + lo_key); 1.430 __ branch(lir_cond_equal, T_INT, x->sux_at(i)); 1.431 +#else 1.432 + __ branch(lir_cond_equal, value, LIR_OprFact::intConst(i+lo_key), T_INT, x->sux_at(i)); 1.433 +#endif 1.434 } 1.435 __ jump(x->default_sux()); 1.436 } 1.437 @@ -2540,8 +2766,12 @@ 1.438 } else { 1.439 int len = x->length(); 1.440 for (int i = 0; i < len; i++) { 1.441 +#ifndef MIPS64 1.442 __ cmp(lir_cond_equal, value, x->key_at(i)); 1.443 __ branch(lir_cond_equal, T_INT, x->sux_at(i)); 1.444 +#else 1.445 + __ branch(lir_cond_equal, value, LIR_OprFact::intConst(x->key_at(i)), T_INT, x->sux_at(i)); 1.446 +#endif 1.447 } 1.448 __ jump(x->default_sux()); 1.449 } 1.450 @@ -3047,8 +3277,18 @@ 1.451 f_val.dont_load_item(); 1.452 LIR_Opr reg = rlock_result(x); 1.453 1.454 +#ifndef MIPS64 1.455 __ cmp(lir_cond(x->cond()), left.result(), right.result()); 1.456 __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type())); 1.457 +#else 1.458 + LIR_Opr opr1 = t_val.result(); 1.459 + LIR_Opr opr2 = f_val.result(); 1.460 + LabelObj* skip = new LabelObj(); 1.461 + __ move(opr1, reg); 1.462 + __ branch(lir_cond(x->cond()), left.result(), right.result(), skip->label()); 1.463 + __ move(opr2, reg); 1.464 + __ branch_destination(skip->label()); 1.465 +#endif 1.466 } 1.467 1.468 void LIRGenerator::do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x) { 1.469 @@ -3399,10 +3639,16 @@ 1.470 LIR_Opr meth = new_register(T_METADATA); 1.471 __ metadata2reg(method->constant_encoding(), meth); 1.472 __ logical_and(result, mask, result); 1.473 +#ifndef MIPS64 1.474 __ cmp(lir_cond_equal, result, LIR_OprFact::intConst(0)); 1.475 +#endif 1.476 // The bci for info can point to cmp for if's we want the if bci 1.477 CodeStub* overflow = new CounterOverflowStub(info, bci, meth); 1.478 +#ifndef MIPS64 1.479 __ branch(lir_cond_equal, T_INT, overflow); 1.480 +#else 1.481 + __ branch(lir_cond_equal, result, LIR_OprFact::intConst(0), T_INT, overflow); 1.482 +#endif 1.483 __ branch_destination(overflow->continuation()); 1.484 } 1.485 } 1.486 @@ -3514,8 +3760,13 @@ 1.487 CodeEmitInfo *info = state_for(x, x->state()); 1.488 CodeStub* stub = new PredicateFailedStub(info); 1.489 1.490 +#ifndef MIPS64 1.491 __ cmp(lir_cond(cond), left, right); 1.492 __ branch(lir_cond(cond), right->type(), stub); 1.493 +#else 1.494 + tty->print_cr("LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) unimplemented yet!"); 1.495 + Unimplemented(); 1.496 +#endif 1.497 } 1.498 } 1.499