comparison src/cpu/sparc/vm/sparc.ad @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 89152779163c 0bf37f737702
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
455 455
456 //----------SOURCE BLOCK------------------------------------------------------- 456 //----------SOURCE BLOCK-------------------------------------------------------
457 // This is a block of C++ code which provides values, functions, and 457 // This is a block of C++ code which provides values, functions, and
458 // definitions necessary in the rest of the architecture description 458 // definitions necessary in the rest of the architecture description
459 source_hpp %{ 459 source_hpp %{
460 // Header information of the source block.
461 // Method declarations/definitions which are used outside
462 // the ad-scope can conveniently be defined here.
463 //
464 // To keep related declarations/definitions/uses close together,
465 // we switch between source %{ }% and source_hpp %{ }% freely as needed.
466
460 // Must be visible to the DFA in dfa_sparc.cpp 467 // Must be visible to the DFA in dfa_sparc.cpp
461 extern bool can_branch_register( Node *bol, Node *cmp ); 468 extern bool can_branch_register( Node *bol, Node *cmp );
462 469
463 extern bool use_block_zeroing(Node* count); 470 extern bool use_block_zeroing(Node* count);
464 471
465 // Macros to extract hi & lo halves from a long pair. 472 // Macros to extract hi & lo halves from a long pair.
466 // G0 is not part of any long pair, so assert on that. 473 // G0 is not part of any long pair, so assert on that.
467 // Prevents accidentally using G1 instead of G0. 474 // Prevents accidentally using G1 instead of G0.
468 #define LONG_HI_REG(x) (x) 475 #define LONG_HI_REG(x) (x)
469 #define LONG_LO_REG(x) (x) 476 #define LONG_LO_REG(x) (x)
477
478 class CallStubImpl {
479
480 //--------------------------------------------------------------
481 //---< Used for optimization in Compile::Shorten_branches >---
482 //--------------------------------------------------------------
483
484 public:
485 // Size of call trampoline stub.
486 static uint size_call_trampoline() {
487 return 0; // no call trampolines on this platform
488 }
489
490 // number of relocations needed by a call trampoline stub
491 static uint reloc_call_trampoline() {
492 return 0; // no call trampolines on this platform
493 }
494 };
495
496 class HandlerImpl {
497
498 public:
499
500 static int emit_exception_handler(CodeBuffer &cbuf);
501 static int emit_deopt_handler(CodeBuffer& cbuf);
502
503 static uint size_exception_handler() {
504 if (TraceJumps) {
505 return (400); // just a guess
506 }
507 return ( NativeJump::instruction_size ); // sethi;jmp;nop
508 }
509
510 static uint size_deopt_handler() {
511 if (TraceJumps) {
512 return (400); // just a guess
513 }
514 return ( 4+ NativeJump::instruction_size ); // save;sethi;jmp;restore
515 }
516 };
470 517
471 %} 518 %}
472 519
473 source %{ 520 source %{
474 #define __ _masm. 521 #define __ _masm.
1038 } 1085 }
1039 return offset; 1086 return offset;
1040 } 1087 }
1041 } 1088 }
1042 1089
1090 bool MachConstantBaseNode::requires_postalloc_expand() const { return false; }
1091 void MachConstantBaseNode::postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_) {
1092 ShouldNotReachHere();
1093 }
1094
1043 void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { 1095 void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
1044 Compile* C = ra_->C; 1096 Compile* C = ra_->C;
1045 Compile::ConstantTable& constant_table = C->constant_table(); 1097 Compile::ConstantTable& constant_table = C->constant_table();
1046 MacroAssembler _masm(&cbuf); 1098 MacroAssembler _masm(&cbuf);
1047 1099
1139 1191
1140 if( VerifyThread ) { 1192 if( VerifyThread ) {
1141 st->print_cr("Verify_Thread"); st->print("\t"); 1193 st->print_cr("Verify_Thread"); st->print("\t");
1142 } 1194 }
1143 1195
1144 size_t framesize = C->frame_slots() << LogBytesPerInt; 1196 size_t framesize = C->frame_size_in_bytes();
1197 int bangsize = C->bang_size_in_bytes();
1145 1198
1146 // Calls to C2R adapters often do not accept exceptional returns. 1199 // Calls to C2R adapters often do not accept exceptional returns.
1147 // We require that their callers must bang for them. But be careful, because 1200 // We require that their callers must bang for them. But be careful, because
1148 // some VM calls (such as call site linkage) can use several kilobytes of 1201 // some VM calls (such as call site linkage) can use several kilobytes of
1149 // stack. But the stack safety zone should account for that. 1202 // stack. But the stack safety zone should account for that.
1150 // See bugs 4446381, 4468289, 4497237. 1203 // See bugs 4446381, 4468289, 4497237.
1151 if (C->need_stack_bang(framesize)) { 1204 if (C->need_stack_bang(bangsize)) {
1152 st->print_cr("! stack bang"); st->print("\t"); 1205 st->print_cr("! stack bang (%d bytes)", bangsize); st->print("\t");
1153 } 1206 }
1154 1207
1155 if (Assembler::is_simm13(-framesize)) { 1208 if (Assembler::is_simm13(-framesize)) {
1156 st->print ("SAVE R_SP,-%d,R_SP",framesize); 1209 st->print ("SAVE R_SP,-%d,R_SP",framesize);
1157 } else { 1210 } else {
1171 __ nop(); 1224 __ nop();
1172 } 1225 }
1173 1226
1174 __ verify_thread(); 1227 __ verify_thread();
1175 1228
1176 size_t framesize = C->frame_slots() << LogBytesPerInt; 1229 size_t framesize = C->frame_size_in_bytes();
1177 assert(framesize >= 16*wordSize, "must have room for reg. save area"); 1230 assert(framesize >= 16*wordSize, "must have room for reg. save area");
1178 assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment"); 1231 assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
1232 int bangsize = C->bang_size_in_bytes();
1179 1233
1180 // Calls to C2R adapters often do not accept exceptional returns. 1234 // Calls to C2R adapters often do not accept exceptional returns.
1181 // We require that their callers must bang for them. But be careful, because 1235 // We require that their callers must bang for them. But be careful, because
1182 // some VM calls (such as call site linkage) can use several kilobytes of 1236 // some VM calls (such as call site linkage) can use several kilobytes of
1183 // stack. But the stack safety zone should account for that. 1237 // stack. But the stack safety zone should account for that.
1184 // See bugs 4446381, 4468289, 4497237. 1238 // See bugs 4446381, 4468289, 4497237.
1185 if (C->need_stack_bang(framesize)) { 1239 if (C->need_stack_bang(bangsize)) {
1186 __ generate_stack_overflow_check(framesize); 1240 __ generate_stack_overflow_check(bangsize);
1187 } 1241 }
1188 1242
1189 if (Assembler::is_simm13(-framesize)) { 1243 if (Assembler::is_simm13(-framesize)) {
1190 __ save(SP, -framesize, SP); 1244 __ save(SP, -framesize, SP);
1191 } else { 1245 } else {
1214 //============================================================================= 1268 //=============================================================================
1215 #ifndef PRODUCT 1269 #ifndef PRODUCT
1216 void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { 1270 void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
1217 Compile* C = ra_->C; 1271 Compile* C = ra_->C;
1218 1272
1219 if( do_polling() && ra_->C->is_method_compilation() ) { 1273 if(do_polling() && ra_->C->is_method_compilation()) {
1220 st->print("SETHI #PollAddr,L0\t! Load Polling address\n\t"); 1274 st->print("SETHI #PollAddr,L0\t! Load Polling address\n\t");
1221 #ifdef _LP64 1275 #ifdef _LP64
1222 st->print("LDX [L0],G0\t!Poll for Safepointing\n\t"); 1276 st->print("LDX [L0],G0\t!Poll for Safepointing\n\t");
1223 #else 1277 #else
1224 st->print("LDUW [L0],G0\t!Poll for Safepointing\n\t"); 1278 st->print("LDUW [L0],G0\t!Poll for Safepointing\n\t");
1225 #endif 1279 #endif
1226 } 1280 }
1227 1281
1228 if( do_polling() ) 1282 if(do_polling()) {
1283 if (UseCBCond && !ra_->C->is_method_compilation()) {
1284 st->print("NOP\n\t");
1285 }
1229 st->print("RET\n\t"); 1286 st->print("RET\n\t");
1287 }
1230 1288
1231 st->print("RESTORE"); 1289 st->print("RESTORE");
1232 } 1290 }
1233 #endif 1291 #endif
1234 1292
1237 Compile* C = ra_->C; 1295 Compile* C = ra_->C;
1238 1296
1239 __ verify_thread(); 1297 __ verify_thread();
1240 1298
1241 // If this does safepoint polling, then do it here 1299 // If this does safepoint polling, then do it here
1242 if( do_polling() && ra_->C->is_method_compilation() ) { 1300 if(do_polling() && ra_->C->is_method_compilation()) {
1243 AddressLiteral polling_page(os::get_polling_page()); 1301 AddressLiteral polling_page(os::get_polling_page());
1244 __ sethi(polling_page, L0); 1302 __ sethi(polling_page, L0);
1245 __ relocate(relocInfo::poll_return_type); 1303 __ relocate(relocInfo::poll_return_type);
1246 __ ld_ptr( L0, 0, G0 ); 1304 __ ld_ptr(L0, 0, G0);
1247 } 1305 }
1248 1306
1249 // If this is a return, then stuff the restore in the delay slot 1307 // If this is a return, then stuff the restore in the delay slot
1250 if( do_polling() ) { 1308 if(do_polling()) {
1309 if (UseCBCond && !ra_->C->is_method_compilation()) {
1310 // Insert extra padding for the case when the epilogue is preceded by
1311 // a cbcond jump, which can't be followed by a CTI instruction
1312 __ nop();
1313 }
1251 __ ret(); 1314 __ ret();
1252 __ delayed()->restore(); 1315 __ delayed()->restore();
1253 } else { 1316 } else {
1254 __ restore(); 1317 __ restore();
1255 } 1318 }
1703 } 1766 }
1704 1767
1705 1768
1706 //============================================================================= 1769 //=============================================================================
1707 1770
1708 uint size_exception_handler() {
1709 if (TraceJumps) {
1710 return (400); // just a guess
1711 }
1712 return ( NativeJump::instruction_size ); // sethi;jmp;nop
1713 }
1714
1715 uint size_deopt_handler() {
1716 if (TraceJumps) {
1717 return (400); // just a guess
1718 }
1719 return ( 4+ NativeJump::instruction_size ); // save;sethi;jmp;restore
1720 }
1721 1771
1722 // Emit exception handler code. 1772 // Emit exception handler code.
1723 int emit_exception_handler(CodeBuffer& cbuf) { 1773 int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
1724 Register temp_reg = G3; 1774 Register temp_reg = G3;
1725 AddressLiteral exception_blob(OptoRuntime::exception_blob()->entry_point()); 1775 AddressLiteral exception_blob(OptoRuntime::exception_blob()->entry_point());
1726 MacroAssembler _masm(&cbuf); 1776 MacroAssembler _masm(&cbuf);
1727 1777
1728 address base = 1778 address base =
1739 __ end_a_stub(); 1789 __ end_a_stub();
1740 1790
1741 return offset; 1791 return offset;
1742 } 1792 }
1743 1793
1744 int emit_deopt_handler(CodeBuffer& cbuf) { 1794 int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
1745 // Can't use any of the current frame's registers as we may have deopted 1795 // Can't use any of the current frame's registers as we may have deopted
1746 // at a poll and everything (including G3) can be live. 1796 // at a poll and everything (including G3) can be live.
1747 Register temp_reg = L0; 1797 Register temp_reg = L0;
1748 AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack()); 1798 AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
1749 MacroAssembler _masm(&cbuf); 1799 MacroAssembler _masm(&cbuf);
1846 // SPARC doesn't support misaligned vectors store/load. 1896 // SPARC doesn't support misaligned vectors store/load.
1847 const bool Matcher::misaligned_vectors_ok() { 1897 const bool Matcher::misaligned_vectors_ok() {
1848 return false; 1898 return false;
1849 } 1899 }
1850 1900
1901 // Current (2013) SPARC platforms need to read original key
1902 // to construct decryption expanded key
1903 const bool Matcher::pass_original_key_for_aes() {
1904 return true;
1905 }
1906
1851 // USII supports fxtof through the whole range of number, USIII doesn't 1907 // USII supports fxtof through the whole range of number, USIII doesn't
1852 const bool Matcher::convL2FSupported(void) { 1908 const bool Matcher::convL2FSupported(void) {
1853 return VM_Version::has_fast_fxtof(); 1909 return VM_Version::has_fast_fxtof();
1854 } 1910 }
1855 1911
1882 1938
1883 // CMOVF/CMOVD are expensive on T4 and on SPARC64. 1939 // CMOVF/CMOVD are expensive on T4 and on SPARC64.
1884 const int Matcher::float_cmove_cost() { 1940 const int Matcher::float_cmove_cost() {
1885 return (VM_Version::is_T4() || VM_Version::is_sparc64()) ? ConditionalMoveLimit : 0; 1941 return (VM_Version::is_T4() || VM_Version::is_sparc64()) ? ConditionalMoveLimit : 0;
1886 } 1942 }
1943
1944 // Does the CPU require late expand (see block.cpp for description of late expand)?
1945 const bool Matcher::require_postalloc_expand = false;
1887 1946
1888 // Should the Matcher clone shifts on addressing modes, expecting them to 1947 // Should the Matcher clone shifts on addressing modes, expecting them to
1889 // be subsumed into complex addressing expressions or compute them into 1948 // be subsumed into complex addressing expressions or compute them into
1890 // registers? True for Intel but false for most RISCs 1949 // registers? True for Intel but false for most RISCs
1891 const bool Matcher::clone_shift_expressions = false; 1950 const bool Matcher::clone_shift_expressions = false;
2020 } 2079 }
2021 2080
2022 const RegMask Matcher::method_handle_invoke_SP_save_mask() { 2081 const RegMask Matcher::method_handle_invoke_SP_save_mask() {
2023 return L7_REGP_mask(); 2082 return L7_REGP_mask();
2024 } 2083 }
2025
2026 const RegMask Matcher::mathExactI_result_proj_mask() {
2027 return G1_REGI_mask();
2028 }
2029
2030 const RegMask Matcher::mathExactL_result_proj_mask() {
2031 return G1_REGL_mask();
2032 }
2033
2034 const RegMask Matcher::mathExactI_flags_proj_mask() {
2035 return INT_FLAGS_mask();
2036 }
2037
2038 2084
2039 %} 2085 %}
2040 2086
2041 2087
2042 // The intptr_t operand types, defined by textual substitution. 2088 // The intptr_t operand types, defined by textual substitution.
2501 %} 2547 %}
2502 2548
2503 enc_class call_epilog %{ 2549 enc_class call_epilog %{
2504 if( VerifyStackAtCalls ) { 2550 if( VerifyStackAtCalls ) {
2505 MacroAssembler _masm(&cbuf); 2551 MacroAssembler _masm(&cbuf);
2506 int framesize = ra_->C->frame_slots() << LogBytesPerInt; 2552 int framesize = ra_->C->frame_size_in_bytes();
2507 Register temp_reg = G3; 2553 Register temp_reg = G3;
2508 __ add(SP, framesize, temp_reg); 2554 __ add(SP, framesize, temp_reg);
2509 __ cmp(temp_reg, FP); 2555 __ cmp(temp_reg, FP);
2510 __ breakpoint_trap(Assembler::notEqual, Assembler::ptr_cc); 2556 __ breakpoint_trap(Assembler::notEqual, Assembler::ptr_cc);
2511 } 2557 }
3240 // Body of function which returns an OptoRegs array locating 3286 // Body of function which returns an OptoRegs array locating
3241 // arguments either in registers or in stack slots for callin 3287 // arguments either in registers or in stack slots for callin
3242 // C. 3288 // C.
3243 c_calling_convention %{ 3289 c_calling_convention %{
3244 // This is obviously always outgoing 3290 // This is obviously always outgoing
3245 (void) SharedRuntime::c_calling_convention(sig_bt, regs, length); 3291 (void) SharedRuntime::c_calling_convention(sig_bt, regs, /*regs2=*/NULL, length);
3246 %} 3292 %}
3247 3293
3248 // Location of native (C/C++) and interpreter return values. This is specified to 3294 // Location of native (C/C++) and interpreter return values. This is specified to
3249 // be the same as Java. In the 32-bit VM, long values are actually returned from 3295 // be the same as Java. In the 32-bit VM, long values are actually returned from
3250 // native calls in O0:O1 and returned to the interpreter in I0:I1. The copying 3296 // native calls in O0:O1 and returned to the interpreter in I0:I1. The copying
3293 op_attrib op_cost(1); // Required cost attribute 3339 op_attrib op_cost(1); // Required cost attribute
3294 3340
3295 //----------Instruction Attributes--------------------------------------------- 3341 //----------Instruction Attributes---------------------------------------------
3296 ins_attrib ins_cost(DEFAULT_COST); // Required cost attribute 3342 ins_attrib ins_cost(DEFAULT_COST); // Required cost attribute
3297 ins_attrib ins_size(32); // Required size attribute (in bits) 3343 ins_attrib ins_size(32); // Required size attribute (in bits)
3298 ins_attrib ins_avoid_back_to_back(0); // instruction should not be generated back to back 3344
3345 // avoid_back_to_back attribute is an expression that must return
3346 // one of the following values defined in MachNode:
3347 // AVOID_NONE - instruction can be placed anywhere
3348 // AVOID_BEFORE - instruction cannot be placed after an
3349 // instruction with MachNode::AVOID_AFTER
3350 // AVOID_AFTER - the next instruction cannot be the one
3351 // with MachNode::AVOID_BEFORE
3352 // AVOID_BEFORE_AND_AFTER - BEFORE and AFTER attributes at
3353 // the same time
3354 ins_attrib ins_avoid_back_to_back(MachNode::AVOID_NONE);
3355
3299 ins_attrib ins_short_branch(0); // Required flag: is this instruction a 3356 ins_attrib ins_short_branch(0); // Required flag: is this instruction a
3300 // non-matching short branch variant of some 3357 // non-matching short branch variant of some
3301 // long branch? 3358 // long branch?
3302 3359
3303 //----------OPERANDS----------------------------------------------------------- 3360 //----------OPERANDS-----------------------------------------------------------
6593 match(Set dst (EncodeP src)); 6650 match(Set dst (EncodeP src));
6594 format %{ "encode_heap_oop $src, $dst" %} 6651 format %{ "encode_heap_oop $src, $dst" %}
6595 ins_encode %{ 6652 ins_encode %{
6596 __ encode_heap_oop($src$$Register, $dst$$Register); 6653 __ encode_heap_oop($src$$Register, $dst$$Register);
6597 %} 6654 %}
6655 ins_avoid_back_to_back(Universe::narrow_oop_base() == NULL ? AVOID_NONE : AVOID_BEFORE);
6598 ins_pipe(ialu_reg); 6656 ins_pipe(ialu_reg);
6599 %} 6657 %}
6600 6658
6601 instruct encodeHeapOop_not_null(iRegN dst, iRegP src) %{ 6659 instruct encodeHeapOop_not_null(iRegN dst, iRegP src) %{
6602 predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull); 6660 predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull);
6651 //----------MemBar Instructions----------------------------------------------- 6709 //----------MemBar Instructions-----------------------------------------------
6652 // Memory barrier flavors 6710 // Memory barrier flavors
6653 6711
6654 instruct membar_acquire() %{ 6712 instruct membar_acquire() %{
6655 match(MemBarAcquire); 6713 match(MemBarAcquire);
6714 match(LoadFence);
6656 ins_cost(4*MEMORY_REF_COST); 6715 ins_cost(4*MEMORY_REF_COST);
6657 6716
6658 size(0); 6717 size(0);
6659 format %{ "MEMBAR-acquire" %} 6718 format %{ "MEMBAR-acquire" %}
6660 ins_encode( enc_membar_acquire ); 6719 ins_encode( enc_membar_acquire );
6671 ins_pipe(empty); 6730 ins_pipe(empty);
6672 %} 6731 %}
6673 6732
6674 instruct membar_release() %{ 6733 instruct membar_release() %{
6675 match(MemBarRelease); 6734 match(MemBarRelease);
6735 match(StoreFence);
6676 ins_cost(4*MEMORY_REF_COST); 6736 ins_cost(4*MEMORY_REF_COST);
6677 6737
6678 size(0); 6738 size(0);
6679 format %{ "MEMBAR-release" %} 6739 format %{ "MEMBAR-release" %}
6680 ins_encode( enc_membar_release ); 6740 ins_encode( enc_membar_release );
9160 ins_encode %{ 9220 ins_encode %{
9161 Label* L = $labl$$label; 9221 Label* L = $labl$$label;
9162 __ ba(*L); 9222 __ ba(*L);
9163 __ delayed()->nop(); 9223 __ delayed()->nop();
9164 %} 9224 %}
9225 ins_avoid_back_to_back(AVOID_BEFORE);
9165 ins_pipe(br); 9226 ins_pipe(br);
9166 %} 9227 %}
9167 9228
9168 // Direct Branch, short with no delay slot 9229 // Direct Branch, short with no delay slot
9169 instruct branch_short(label labl) %{ 9230 instruct branch_short(label labl) %{
9172 effect(USE labl); 9233 effect(USE labl);
9173 9234
9174 size(4); 9235 size(4);
9175 ins_cost(BRANCH_COST); 9236 ins_cost(BRANCH_COST);
9176 format %{ "BA $labl\t! short branch" %} 9237 format %{ "BA $labl\t! short branch" %}
9177 ins_encode %{ 9238 ins_encode %{
9178 Label* L = $labl$$label; 9239 Label* L = $labl$$label;
9179 assert(__ use_cbcond(*L), "back to back cbcond"); 9240 assert(__ use_cbcond(*L), "back to back cbcond");
9180 __ ba_short(*L); 9241 __ ba_short(*L);
9181 %} 9242 %}
9182 ins_short_branch(1); 9243 ins_short_branch(1);
9183 ins_avoid_back_to_back(1); 9244 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9184 ins_pipe(cbcond_reg_imm); 9245 ins_pipe(cbcond_reg_imm);
9185 %} 9246 %}
9186 9247
9187 // Conditional Direct Branch 9248 // Conditional Direct Branch
9188 instruct branchCon(cmpOp cmp, flagsReg icc, label labl) %{ 9249 instruct branchCon(cmpOp cmp, flagsReg icc, label labl) %{
9192 size(8); 9253 size(8);
9193 ins_cost(BRANCH_COST); 9254 ins_cost(BRANCH_COST);
9194 format %{ "BP$cmp $icc,$labl" %} 9255 format %{ "BP$cmp $icc,$labl" %}
9195 // Prim = bits 24-22, Secnd = bits 31-30 9256 // Prim = bits 24-22, Secnd = bits 31-30
9196 ins_encode( enc_bp( labl, cmp, icc ) ); 9257 ins_encode( enc_bp( labl, cmp, icc ) );
9258 ins_avoid_back_to_back(AVOID_BEFORE);
9197 ins_pipe(br_cc); 9259 ins_pipe(br_cc);
9198 %} 9260 %}
9199 9261
9200 instruct branchConU(cmpOpU cmp, flagsRegU icc, label labl) %{ 9262 instruct branchConU(cmpOpU cmp, flagsRegU icc, label labl) %{
9201 match(If cmp icc); 9263 match(If cmp icc);
9203 9265
9204 ins_cost(BRANCH_COST); 9266 ins_cost(BRANCH_COST);
9205 format %{ "BP$cmp $icc,$labl" %} 9267 format %{ "BP$cmp $icc,$labl" %}
9206 // Prim = bits 24-22, Secnd = bits 31-30 9268 // Prim = bits 24-22, Secnd = bits 31-30
9207 ins_encode( enc_bp( labl, cmp, icc ) ); 9269 ins_encode( enc_bp( labl, cmp, icc ) );
9270 ins_avoid_back_to_back(AVOID_BEFORE);
9208 ins_pipe(br_cc); 9271 ins_pipe(br_cc);
9209 %} 9272 %}
9210 9273
9211 instruct branchConP(cmpOpP cmp, flagsRegP pcc, label labl) %{ 9274 instruct branchConP(cmpOpP cmp, flagsRegP pcc, label labl) %{
9212 match(If cmp pcc); 9275 match(If cmp pcc);
9221 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; 9284 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn;
9222 9285
9223 __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L); 9286 __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L);
9224 __ delayed()->nop(); 9287 __ delayed()->nop();
9225 %} 9288 %}
9289 ins_avoid_back_to_back(AVOID_BEFORE);
9226 ins_pipe(br_cc); 9290 ins_pipe(br_cc);
9227 %} 9291 %}
9228 9292
9229 instruct branchConF(cmpOpF cmp, flagsRegF fcc, label labl) %{ 9293 instruct branchConF(cmpOpF cmp, flagsRegF fcc, label labl) %{
9230 match(If cmp fcc); 9294 match(If cmp fcc);
9239 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; 9303 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn;
9240 9304
9241 __ fbp( (Assembler::Condition)($cmp$$cmpcode), false, (Assembler::CC)($fcc$$reg), predict_taken, *L); 9305 __ fbp( (Assembler::Condition)($cmp$$cmpcode), false, (Assembler::CC)($fcc$$reg), predict_taken, *L);
9242 __ delayed()->nop(); 9306 __ delayed()->nop();
9243 %} 9307 %}
9308 ins_avoid_back_to_back(AVOID_BEFORE);
9244 ins_pipe(br_fcc); 9309 ins_pipe(br_fcc);
9245 %} 9310 %}
9246 9311
9247 instruct branchLoopEnd(cmpOp cmp, flagsReg icc, label labl) %{ 9312 instruct branchLoopEnd(cmpOp cmp, flagsReg icc, label labl) %{
9248 match(CountedLoopEnd cmp icc); 9313 match(CountedLoopEnd cmp icc);
9251 size(8); 9316 size(8);
9252 ins_cost(BRANCH_COST); 9317 ins_cost(BRANCH_COST);
9253 format %{ "BP$cmp $icc,$labl\t! Loop end" %} 9318 format %{ "BP$cmp $icc,$labl\t! Loop end" %}
9254 // Prim = bits 24-22, Secnd = bits 31-30 9319 // Prim = bits 24-22, Secnd = bits 31-30
9255 ins_encode( enc_bp( labl, cmp, icc ) ); 9320 ins_encode( enc_bp( labl, cmp, icc ) );
9321 ins_avoid_back_to_back(AVOID_BEFORE);
9256 ins_pipe(br_cc); 9322 ins_pipe(br_cc);
9257 %} 9323 %}
9258 9324
9259 instruct branchLoopEndU(cmpOpU cmp, flagsRegU icc, label labl) %{ 9325 instruct branchLoopEndU(cmpOpU cmp, flagsRegU icc, label labl) %{
9260 match(CountedLoopEnd cmp icc); 9326 match(CountedLoopEnd cmp icc);
9263 size(8); 9329 size(8);
9264 ins_cost(BRANCH_COST); 9330 ins_cost(BRANCH_COST);
9265 format %{ "BP$cmp $icc,$labl\t! Loop end" %} 9331 format %{ "BP$cmp $icc,$labl\t! Loop end" %}
9266 // Prim = bits 24-22, Secnd = bits 31-30 9332 // Prim = bits 24-22, Secnd = bits 31-30
9267 ins_encode( enc_bp( labl, cmp, icc ) ); 9333 ins_encode( enc_bp( labl, cmp, icc ) );
9334 ins_avoid_back_to_back(AVOID_BEFORE);
9268 ins_pipe(br_cc); 9335 ins_pipe(br_cc);
9269 %} 9336 %}
9270 9337
9271 // Compare and branch instructions 9338 // Compare and branch instructions
9272 instruct cmpI_reg_branch(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{ 9339 instruct cmpI_reg_branch(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{
9513 Label* L = $labl$$label; 9580 Label* L = $labl$$label;
9514 assert(__ use_cbcond(*L), "back to back cbcond"); 9581 assert(__ use_cbcond(*L), "back to back cbcond");
9515 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); 9582 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
9516 %} 9583 %}
9517 ins_short_branch(1); 9584 ins_short_branch(1);
9518 ins_avoid_back_to_back(1); 9585 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9519 ins_pipe(cbcond_reg_reg); 9586 ins_pipe(cbcond_reg_reg);
9520 %} 9587 %}
9521 9588
9522 instruct cmpI_imm_branch_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{ 9589 instruct cmpI_imm_branch_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{
9523 match(If cmp (CmpI op1 op2)); 9590 match(If cmp (CmpI op1 op2));
9531 Label* L = $labl$$label; 9598 Label* L = $labl$$label;
9532 assert(__ use_cbcond(*L), "back to back cbcond"); 9599 assert(__ use_cbcond(*L), "back to back cbcond");
9533 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L); 9600 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
9534 %} 9601 %}
9535 ins_short_branch(1); 9602 ins_short_branch(1);
9536 ins_avoid_back_to_back(1); 9603 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9537 ins_pipe(cbcond_reg_imm); 9604 ins_pipe(cbcond_reg_imm);
9538 %} 9605 %}
9539 9606
9540 instruct cmpU_reg_branch_short(cmpOpU cmp, iRegI op1, iRegI op2, label labl, flagsRegU icc) %{ 9607 instruct cmpU_reg_branch_short(cmpOpU cmp, iRegI op1, iRegI op2, label labl, flagsRegU icc) %{
9541 match(If cmp (CmpU op1 op2)); 9608 match(If cmp (CmpU op1 op2));
9549 Label* L = $labl$$label; 9616 Label* L = $labl$$label;
9550 assert(__ use_cbcond(*L), "back to back cbcond"); 9617 assert(__ use_cbcond(*L), "back to back cbcond");
9551 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); 9618 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
9552 %} 9619 %}
9553 ins_short_branch(1); 9620 ins_short_branch(1);
9554 ins_avoid_back_to_back(1); 9621 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9555 ins_pipe(cbcond_reg_reg); 9622 ins_pipe(cbcond_reg_reg);
9556 %} 9623 %}
9557 9624
9558 instruct cmpU_imm_branch_short(cmpOpU cmp, iRegI op1, immI5 op2, label labl, flagsRegU icc) %{ 9625 instruct cmpU_imm_branch_short(cmpOpU cmp, iRegI op1, immI5 op2, label labl, flagsRegU icc) %{
9559 match(If cmp (CmpU op1 op2)); 9626 match(If cmp (CmpU op1 op2));
9567 Label* L = $labl$$label; 9634 Label* L = $labl$$label;
9568 assert(__ use_cbcond(*L), "back to back cbcond"); 9635 assert(__ use_cbcond(*L), "back to back cbcond");
9569 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L); 9636 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
9570 %} 9637 %}
9571 ins_short_branch(1); 9638 ins_short_branch(1);
9572 ins_avoid_back_to_back(1); 9639 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9573 ins_pipe(cbcond_reg_imm); 9640 ins_pipe(cbcond_reg_imm);
9574 %} 9641 %}
9575 9642
9576 instruct cmpL_reg_branch_short(cmpOp cmp, iRegL op1, iRegL op2, label labl, flagsRegL xcc) %{ 9643 instruct cmpL_reg_branch_short(cmpOp cmp, iRegL op1, iRegL op2, label labl, flagsRegL xcc) %{
9577 match(If cmp (CmpL op1 op2)); 9644 match(If cmp (CmpL op1 op2));
9585 Label* L = $labl$$label; 9652 Label* L = $labl$$label;
9586 assert(__ use_cbcond(*L), "back to back cbcond"); 9653 assert(__ use_cbcond(*L), "back to back cbcond");
9587 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$Register, *L); 9654 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$Register, *L);
9588 %} 9655 %}
9589 ins_short_branch(1); 9656 ins_short_branch(1);
9590 ins_avoid_back_to_back(1); 9657 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9591 ins_pipe(cbcond_reg_reg); 9658 ins_pipe(cbcond_reg_reg);
9592 %} 9659 %}
9593 9660
9594 instruct cmpL_imm_branch_short(cmpOp cmp, iRegL op1, immL5 op2, label labl, flagsRegL xcc) %{ 9661 instruct cmpL_imm_branch_short(cmpOp cmp, iRegL op1, immL5 op2, label labl, flagsRegL xcc) %{
9595 match(If cmp (CmpL op1 op2)); 9662 match(If cmp (CmpL op1 op2));
9603 Label* L = $labl$$label; 9670 Label* L = $labl$$label;
9604 assert(__ use_cbcond(*L), "back to back cbcond"); 9671 assert(__ use_cbcond(*L), "back to back cbcond");
9605 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$constant, *L); 9672 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$constant, *L);
9606 %} 9673 %}
9607 ins_short_branch(1); 9674 ins_short_branch(1);
9608 ins_avoid_back_to_back(1); 9675 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9609 ins_pipe(cbcond_reg_imm); 9676 ins_pipe(cbcond_reg_imm);
9610 %} 9677 %}
9611 9678
9612 // Compare Pointers and branch 9679 // Compare Pointers and branch
9613 instruct cmpP_reg_branch_short(cmpOpP cmp, iRegP op1, iRegP op2, label labl, flagsRegP pcc) %{ 9680 instruct cmpP_reg_branch_short(cmpOpP cmp, iRegP op1, iRegP op2, label labl, flagsRegP pcc) %{
9626 Label* L = $labl$$label; 9693 Label* L = $labl$$label;
9627 assert(__ use_cbcond(*L), "back to back cbcond"); 9694 assert(__ use_cbcond(*L), "back to back cbcond");
9628 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, $op2$$Register, *L); 9695 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, $op2$$Register, *L);
9629 %} 9696 %}
9630 ins_short_branch(1); 9697 ins_short_branch(1);
9631 ins_avoid_back_to_back(1); 9698 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9632 ins_pipe(cbcond_reg_reg); 9699 ins_pipe(cbcond_reg_reg);
9633 %} 9700 %}
9634 9701
9635 instruct cmpP_null_branch_short(cmpOpP cmp, iRegP op1, immP0 null, label labl, flagsRegP pcc) %{ 9702 instruct cmpP_null_branch_short(cmpOpP cmp, iRegP op1, immP0 null, label labl, flagsRegP pcc) %{
9636 match(If cmp (CmpP op1 null)); 9703 match(If cmp (CmpP op1 null));
9648 Label* L = $labl$$label; 9715 Label* L = $labl$$label;
9649 assert(__ use_cbcond(*L), "back to back cbcond"); 9716 assert(__ use_cbcond(*L), "back to back cbcond");
9650 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, G0, *L); 9717 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, G0, *L);
9651 %} 9718 %}
9652 ins_short_branch(1); 9719 ins_short_branch(1);
9653 ins_avoid_back_to_back(1); 9720 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9654 ins_pipe(cbcond_reg_reg); 9721 ins_pipe(cbcond_reg_reg);
9655 %} 9722 %}
9656 9723
9657 instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flagsReg icc) %{ 9724 instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flagsReg icc) %{
9658 match(If cmp (CmpN op1 op2)); 9725 match(If cmp (CmpN op1 op2));
9666 Label* L = $labl$$label; 9733 Label* L = $labl$$label;
9667 assert(__ use_cbcond(*L), "back to back cbcond"); 9734 assert(__ use_cbcond(*L), "back to back cbcond");
9668 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); 9735 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
9669 %} 9736 %}
9670 ins_short_branch(1); 9737 ins_short_branch(1);
9671 ins_avoid_back_to_back(1); 9738 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9672 ins_pipe(cbcond_reg_reg); 9739 ins_pipe(cbcond_reg_reg);
9673 %} 9740 %}
9674 9741
9675 instruct cmpN_null_branch_short(cmpOp cmp, iRegN op1, immN0 null, label labl, flagsReg icc) %{ 9742 instruct cmpN_null_branch_short(cmpOp cmp, iRegN op1, immN0 null, label labl, flagsReg icc) %{
9676 match(If cmp (CmpN op1 null)); 9743 match(If cmp (CmpN op1 null));
9684 Label* L = $labl$$label; 9751 Label* L = $labl$$label;
9685 assert(__ use_cbcond(*L), "back to back cbcond"); 9752 assert(__ use_cbcond(*L), "back to back cbcond");
9686 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, G0, *L); 9753 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, G0, *L);
9687 %} 9754 %}
9688 ins_short_branch(1); 9755 ins_short_branch(1);
9689 ins_avoid_back_to_back(1); 9756 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9690 ins_pipe(cbcond_reg_reg); 9757 ins_pipe(cbcond_reg_reg);
9691 %} 9758 %}
9692 9759
9693 // Loop back branch 9760 // Loop back branch
9694 instruct cmpI_reg_branchLoopEnd_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{ 9761 instruct cmpI_reg_branchLoopEnd_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{
9703 Label* L = $labl$$label; 9770 Label* L = $labl$$label;
9704 assert(__ use_cbcond(*L), "back to back cbcond"); 9771 assert(__ use_cbcond(*L), "back to back cbcond");
9705 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); 9772 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
9706 %} 9773 %}
9707 ins_short_branch(1); 9774 ins_short_branch(1);
9708 ins_avoid_back_to_back(1); 9775 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9709 ins_pipe(cbcond_reg_reg); 9776 ins_pipe(cbcond_reg_reg);
9710 %} 9777 %}
9711 9778
9712 instruct cmpI_imm_branchLoopEnd_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{ 9779 instruct cmpI_imm_branchLoopEnd_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{
9713 match(CountedLoopEnd cmp (CmpI op1 op2)); 9780 match(CountedLoopEnd cmp (CmpI op1 op2));
9721 Label* L = $labl$$label; 9788 Label* L = $labl$$label;
9722 assert(__ use_cbcond(*L), "back to back cbcond"); 9789 assert(__ use_cbcond(*L), "back to back cbcond");
9723 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L); 9790 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
9724 %} 9791 %}
9725 ins_short_branch(1); 9792 ins_short_branch(1);
9726 ins_avoid_back_to_back(1); 9793 ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
9727 ins_pipe(cbcond_reg_imm); 9794 ins_pipe(cbcond_reg_imm);
9728 %} 9795 %}
9729 9796
9730 // Branch-on-register tests all 64 bits. We assume that values 9797 // Branch-on-register tests all 64 bits. We assume that values
9731 // in 64-bit registers always remains zero or sign extended 9798 // in 64-bit registers always remains zero or sign extended
9738 9805
9739 size(8); 9806 size(8);
9740 ins_cost(BRANCH_COST); 9807 ins_cost(BRANCH_COST);
9741 format %{ "BR$cmp $op1,$labl" %} 9808 format %{ "BR$cmp $op1,$labl" %}
9742 ins_encode( enc_bpr( labl, cmp, op1 ) ); 9809 ins_encode( enc_bpr( labl, cmp, op1 ) );
9810 ins_avoid_back_to_back(AVOID_BEFORE);
9743 ins_pipe(br_reg); 9811 ins_pipe(br_reg);
9744 %} 9812 %}
9745 9813
9746 instruct branchCon_regP(cmpOp_reg cmp, iRegP op1, immP0 null, label labl) %{ 9814 instruct branchCon_regP(cmpOp_reg cmp, iRegP op1, immP0 null, label labl) %{
9747 match(If cmp (CmpP op1 null)); 9815 match(If cmp (CmpP op1 null));
9750 9818
9751 size(8); 9819 size(8);
9752 ins_cost(BRANCH_COST); 9820 ins_cost(BRANCH_COST);
9753 format %{ "BR$cmp $op1,$labl" %} 9821 format %{ "BR$cmp $op1,$labl" %}
9754 ins_encode( enc_bpr( labl, cmp, op1 ) ); 9822 ins_encode( enc_bpr( labl, cmp, op1 ) );
9823 ins_avoid_back_to_back(AVOID_BEFORE);
9755 ins_pipe(br_reg); 9824 ins_pipe(br_reg);
9756 %} 9825 %}
9757 9826
9758 instruct branchCon_regL(cmpOp_reg cmp, iRegL op1, immL0 zero, label labl) %{ 9827 instruct branchCon_regL(cmpOp_reg cmp, iRegL op1, immL0 zero, label labl) %{
9759 match(If cmp (CmpL op1 zero)); 9828 match(If cmp (CmpL op1 zero));
9762 9831
9763 size(8); 9832 size(8);
9764 ins_cost(BRANCH_COST); 9833 ins_cost(BRANCH_COST);
9765 format %{ "BR$cmp $op1,$labl" %} 9834 format %{ "BR$cmp $op1,$labl" %}
9766 ins_encode( enc_bpr( labl, cmp, op1 ) ); 9835 ins_encode( enc_bpr( labl, cmp, op1 ) );
9836 ins_avoid_back_to_back(AVOID_BEFORE);
9767 ins_pipe(br_reg); 9837 ins_pipe(br_reg);
9768 %} 9838 %}
9769 9839
9770 9840
9771 // ============================================================================ 9841 // ============================================================================
9802 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; 9872 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn;
9803 9873
9804 __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::xcc, predict_taken, *L); 9874 __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::xcc, predict_taken, *L);
9805 __ delayed()->nop(); 9875 __ delayed()->nop();
9806 %} 9876 %}
9877 ins_avoid_back_to_back(AVOID_BEFORE);
9807 ins_pipe(br_cc); 9878 ins_pipe(br_cc);
9808 %} 9879 %}
9809 9880
9810 // Manifest a CmpL3 result in an integer register. Very painful. 9881 // Manifest a CmpL3 result in an integer register. Very painful.
9811 // This is the test to avoid. 9882 // This is the test to avoid.
9929 10000
9930 size(8); 10001 size(8);
9931 ins_cost(CALL_COST); 10002 ins_cost(CALL_COST);
9932 format %{ "CALL,static ; NOP ==> " %} 10003 format %{ "CALL,static ; NOP ==> " %}
9933 ins_encode( Java_Static_Call( meth ), call_epilog ); 10004 ins_encode( Java_Static_Call( meth ), call_epilog );
10005 ins_avoid_back_to_back(AVOID_BEFORE);
9934 ins_pipe(simple_call); 10006 ins_pipe(simple_call);
9935 %} 10007 %}
9936 10008
9937 // Call Java Static Instruction (method handle version) 10009 // Call Java Static Instruction (method handle version)
9938 instruct CallStaticJavaHandle(method meth, l7RegP l7_mh_SP_save) %{ 10010 instruct CallStaticJavaHandle(method meth, l7RegP l7_mh_SP_save) %{
9965 effect(USE meth, KILL l7); 10037 effect(USE meth, KILL l7);
9966 ins_cost(CALL_COST); 10038 ins_cost(CALL_COST);
9967 format %{ "CALL,runtime" %} 10039 format %{ "CALL,runtime" %}
9968 ins_encode( Java_To_Runtime( meth ), 10040 ins_encode( Java_To_Runtime( meth ),
9969 call_epilog, adjust_long_from_native_call ); 10041 call_epilog, adjust_long_from_native_call );
10042 ins_avoid_back_to_back(AVOID_BEFORE);
9970 ins_pipe(simple_call); 10043 ins_pipe(simple_call);
9971 %} 10044 %}
9972 10045
9973 // Call runtime without safepoint - same as CallRuntime 10046 // Call runtime without safepoint - same as CallRuntime
9974 instruct CallLeafDirect(method meth, l7RegP l7) %{ 10047 instruct CallLeafDirect(method meth, l7RegP l7) %{
9977 ins_cost(CALL_COST); 10050 ins_cost(CALL_COST);
9978 format %{ "CALL,runtime leaf" %} 10051 format %{ "CALL,runtime leaf" %}
9979 ins_encode( Java_To_Runtime( meth ), 10052 ins_encode( Java_To_Runtime( meth ),
9980 call_epilog, 10053 call_epilog,
9981 adjust_long_from_native_call ); 10054 adjust_long_from_native_call );
10055 ins_avoid_back_to_back(AVOID_BEFORE);
9982 ins_pipe(simple_call); 10056 ins_pipe(simple_call);
9983 %} 10057 %}
9984 10058
9985 // Call runtime without safepoint - same as CallLeaf 10059 // Call runtime without safepoint - same as CallLeaf
9986 instruct CallLeafNoFPDirect(method meth, l7RegP l7) %{ 10060 instruct CallLeafNoFPDirect(method meth, l7RegP l7) %{
9989 ins_cost(CALL_COST); 10063 ins_cost(CALL_COST);
9990 format %{ "CALL,runtime leaf nofp" %} 10064 format %{ "CALL,runtime leaf nofp" %}
9991 ins_encode( Java_To_Runtime( meth ), 10065 ins_encode( Java_To_Runtime( meth ),
9992 call_epilog, 10066 call_epilog,
9993 adjust_long_from_native_call ); 10067 adjust_long_from_native_call );
10068 ins_avoid_back_to_back(AVOID_BEFORE);
9994 ins_pipe(simple_call); 10069 ins_pipe(simple_call);
9995 %} 10070 %}
9996 10071
9997 // Tail Call; Jump from runtime stub to Java code. 10072 // Tail Call; Jump from runtime stub to Java code.
9998 // Also known as an 'interprocedural jump'. 10073 // Also known as an 'interprocedural jump'.
10002 match(TailCall jump_target method_oop ); 10077 match(TailCall jump_target method_oop );
10003 10078
10004 ins_cost(CALL_COST); 10079 ins_cost(CALL_COST);
10005 format %{ "Jmp $jump_target ; NOP \t! $method_oop holds method oop" %} 10080 format %{ "Jmp $jump_target ; NOP \t! $method_oop holds method oop" %}
10006 ins_encode(form_jmpl(jump_target)); 10081 ins_encode(form_jmpl(jump_target));
10082 ins_avoid_back_to_back(AVOID_BEFORE);
10007 ins_pipe(tail_call); 10083 ins_pipe(tail_call);
10008 %} 10084 %}
10009 10085
10010 10086
10011 // Return Instruction 10087 // Return Instruction
10033 "Jmp $jump_target ; ADD O7,8,O1 \t! $ex_oop holds exc. oop" %} 10109 "Jmp $jump_target ; ADD O7,8,O1 \t! $ex_oop holds exc. oop" %}
10034 ins_encode(form_jmpl_set_exception_pc(jump_target)); 10110 ins_encode(form_jmpl_set_exception_pc(jump_target));
10035 // opcode(Assembler::jmpl_op3, Assembler::arith_op); 10111 // opcode(Assembler::jmpl_op3, Assembler::arith_op);
10036 // The hack duplicates the exception oop into G3, so that CreateEx can use it there. 10112 // The hack duplicates the exception oop into G3, so that CreateEx can use it there.
10037 // ins_encode( form3_rs1_simm13_rd( jump_target, 0x00, R_G0 ), move_return_pc_to_o1() ); 10113 // ins_encode( form3_rs1_simm13_rd( jump_target, 0x00, R_G0 ), move_return_pc_to_o1() );
10114 ins_avoid_back_to_back(AVOID_BEFORE);
10038 ins_pipe(tail_call); 10115 ins_pipe(tail_call);
10039 %} 10116 %}
10040 10117
10041 // Create exception oop: created by stack-crawling runtime code. 10118 // Create exception oop: created by stack-crawling runtime code.
10042 // Created exception is now available to this handler, and is setup 10119 // Created exception is now available to this handler, and is setup
10063 ins_cost(CALL_COST); 10140 ins_cost(CALL_COST);
10064 10141
10065 // use the following format syntax 10142 // use the following format syntax
10066 format %{ "Jmp rethrow_stub" %} 10143 format %{ "Jmp rethrow_stub" %}
10067 ins_encode(enc_rethrow); 10144 ins_encode(enc_rethrow);
10145 ins_avoid_back_to_back(AVOID_BEFORE);
10068 ins_pipe(tail_call); 10146 ins_pipe(tail_call);
10069 %} 10147 %}
10070 10148
10071 10149
10072 // Die now 10150 // Die now
10091 match(Set index (PartialSubtypeCheck sub super)); 10169 match(Set index (PartialSubtypeCheck sub super));
10092 effect( KILL pcc, KILL o7 ); 10170 effect( KILL pcc, KILL o7 );
10093 ins_cost(DEFAULT_COST*10); 10171 ins_cost(DEFAULT_COST*10);
10094 format %{ "CALL PartialSubtypeCheck\n\tNOP" %} 10172 format %{ "CALL PartialSubtypeCheck\n\tNOP" %}
10095 ins_encode( enc_PartialSubtypeCheck() ); 10173 ins_encode( enc_PartialSubtypeCheck() );
10174 ins_avoid_back_to_back(AVOID_BEFORE);
10096 ins_pipe(partial_subtype_check_pipe); 10175 ins_pipe(partial_subtype_check_pipe);
10097 %} 10176 %}
10098 10177
10099 instruct partialSubtypeCheck_vs_zero( flagsRegP pcc, o1RegP sub, o2RegP super, immP0 zero, o0RegP idx, o7RegP o7 ) %{ 10178 instruct partialSubtypeCheck_vs_zero( flagsRegP pcc, o1RegP sub, o2RegP super, immP0 zero, o0RegP idx, o7RegP o7 ) %{
10100 match(Set pcc (CmpP (PartialSubtypeCheck sub super) zero)); 10179 match(Set pcc (CmpP (PartialSubtypeCheck sub super) zero));
10101 effect( KILL idx, KILL o7 ); 10180 effect( KILL idx, KILL o7 );
10102 ins_cost(DEFAULT_COST*10); 10181 ins_cost(DEFAULT_COST*10);
10103 format %{ "CALL PartialSubtypeCheck\n\tNOP\t# (sets condition codes)" %} 10182 format %{ "CALL PartialSubtypeCheck\n\tNOP\t# (sets condition codes)" %}
10104 ins_encode( enc_PartialSubtypeCheck() ); 10183 ins_encode( enc_PartialSubtypeCheck() );
10184 ins_avoid_back_to_back(AVOID_BEFORE);
10105 ins_pipe(partial_subtype_check_pipe); 10185 ins_pipe(partial_subtype_check_pipe);
10106 %} 10186 %}
10107 10187
10108 10188
10109 // ============================================================================ 10189 // ============================================================================