9207 ins_cost(BRANCH_COST); |
9283 ins_cost(BRANCH_COST); |
9208 format %{ "BP$cmp $icc,$labl" %} |
9284 format %{ "BP$cmp $icc,$labl" %} |
9209 // Prim = bits 24-22, Secnd = bits 31-30 |
9285 // Prim = bits 24-22, Secnd = bits 31-30 |
9210 ins_encode( enc_bp( labl, cmp, icc ) ); |
9286 ins_encode( enc_bp( labl, cmp, icc ) ); |
9211 ins_pipe(br_cc); |
9287 ins_pipe(br_cc); |
|
9288 %} |
|
9289 |
|
9290 instruct branchConU(cmpOpU cmp, flagsRegU icc, label labl) %{ |
|
9291 match(If cmp icc); |
|
9292 effect(USE labl); |
|
9293 |
|
9294 ins_cost(BRANCH_COST); |
|
9295 format %{ "BP$cmp $icc,$labl" %} |
|
9296 // Prim = bits 24-22, Secnd = bits 31-30 |
|
9297 ins_encode( enc_bp( labl, cmp, icc ) ); |
|
9298 ins_pipe(br_cc); |
|
9299 %} |
|
9300 |
|
9301 instruct branchConP(cmpOpP cmp, flagsRegP pcc, label labl) %{ |
|
9302 match(If cmp pcc); |
|
9303 effect(USE labl); |
|
9304 |
|
9305 size(8); |
|
9306 ins_cost(BRANCH_COST); |
|
9307 format %{ "BP$cmp $pcc,$labl" %} |
|
9308 ins_encode %{ |
|
9309 Label* L = $labl$$label; |
|
9310 Assembler::Predict predict_taken = |
|
9311 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9312 |
|
9313 __ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L); |
|
9314 __ delayed()->nop(); |
|
9315 %} |
|
9316 ins_pipe(br_cc); |
|
9317 %} |
|
9318 |
|
9319 instruct branchConF(cmpOpF cmp, flagsRegF fcc, label labl) %{ |
|
9320 match(If cmp fcc); |
|
9321 effect(USE labl); |
|
9322 |
|
9323 size(8); |
|
9324 ins_cost(BRANCH_COST); |
|
9325 format %{ "FBP$cmp $fcc,$labl" %} |
|
9326 ins_encode %{ |
|
9327 Label* L = $labl$$label; |
|
9328 Assembler::Predict predict_taken = |
|
9329 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9330 |
|
9331 __ fbp( (Assembler::Condition)($cmp$$cmpcode), false, (Assembler::CC)($fcc$$reg), predict_taken, *L); |
|
9332 __ delayed()->nop(); |
|
9333 %} |
|
9334 ins_pipe(br_fcc); |
|
9335 %} |
|
9336 |
|
9337 instruct branchLoopEnd(cmpOp cmp, flagsReg icc, label labl) %{ |
|
9338 match(CountedLoopEnd cmp icc); |
|
9339 effect(USE labl); |
|
9340 |
|
9341 size(8); |
|
9342 ins_cost(BRANCH_COST); |
|
9343 format %{ "BP$cmp $icc,$labl\t! Loop end" %} |
|
9344 // Prim = bits 24-22, Secnd = bits 31-30 |
|
9345 ins_encode( enc_bp( labl, cmp, icc ) ); |
|
9346 ins_pipe(br_cc); |
|
9347 %} |
|
9348 |
|
9349 instruct branchLoopEndU(cmpOpU cmp, flagsRegU icc, label labl) %{ |
|
9350 match(CountedLoopEnd cmp icc); |
|
9351 effect(USE labl); |
|
9352 |
|
9353 size(8); |
|
9354 ins_cost(BRANCH_COST); |
|
9355 format %{ "BP$cmp $icc,$labl\t! Loop end" %} |
|
9356 // Prim = bits 24-22, Secnd = bits 31-30 |
|
9357 ins_encode( enc_bp( labl, cmp, icc ) ); |
|
9358 ins_pipe(br_cc); |
|
9359 %} |
|
9360 |
|
9361 // Compare and branch instructions |
|
9362 instruct cmpI_reg_branch(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{ |
|
9363 match(If cmp (CmpI op1 op2)); |
|
9364 effect(USE labl, KILL icc); |
|
9365 |
|
9366 size(12); |
|
9367 ins_cost(BRANCH_COST); |
|
9368 format %{ "CMP $op1,$op2\t! int\n\t" |
|
9369 "BP$cmp $labl" %} |
|
9370 ins_encode %{ |
|
9371 Label* L = $labl$$label; |
|
9372 Assembler::Predict predict_taken = |
|
9373 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9374 __ cmp($op1$$Register, $op2$$Register); |
|
9375 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9376 __ delayed()->nop(); |
|
9377 %} |
|
9378 ins_pipe(cmp_br_reg_reg); |
|
9379 %} |
|
9380 |
|
9381 instruct cmpI_imm_branch(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{ |
|
9382 match(If cmp (CmpI op1 op2)); |
|
9383 effect(USE labl, KILL icc); |
|
9384 |
|
9385 size(12); |
|
9386 ins_cost(BRANCH_COST); |
|
9387 format %{ "CMP $op1,$op2\t! int\n\t" |
|
9388 "BP$cmp $labl" %} |
|
9389 ins_encode %{ |
|
9390 Label* L = $labl$$label; |
|
9391 Assembler::Predict predict_taken = |
|
9392 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9393 __ cmp($op1$$Register, $op2$$constant); |
|
9394 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9395 __ delayed()->nop(); |
|
9396 %} |
|
9397 ins_pipe(cmp_br_reg_imm); |
|
9398 %} |
|
9399 |
|
9400 instruct cmpU_reg_branch(cmpOpU cmp, iRegI op1, iRegI op2, label labl, flagsRegU icc) %{ |
|
9401 match(If cmp (CmpU op1 op2)); |
|
9402 effect(USE labl, KILL icc); |
|
9403 |
|
9404 size(12); |
|
9405 ins_cost(BRANCH_COST); |
|
9406 format %{ "CMP $op1,$op2\t! unsigned\n\t" |
|
9407 "BP$cmp $labl" %} |
|
9408 ins_encode %{ |
|
9409 Label* L = $labl$$label; |
|
9410 Assembler::Predict predict_taken = |
|
9411 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9412 __ cmp($op1$$Register, $op2$$Register); |
|
9413 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9414 __ delayed()->nop(); |
|
9415 %} |
|
9416 ins_pipe(cmp_br_reg_reg); |
|
9417 %} |
|
9418 |
|
9419 instruct cmpU_imm_branch(cmpOpU cmp, iRegI op1, immI5 op2, label labl, flagsRegU icc) %{ |
|
9420 match(If cmp (CmpU op1 op2)); |
|
9421 effect(USE labl, KILL icc); |
|
9422 |
|
9423 size(12); |
|
9424 ins_cost(BRANCH_COST); |
|
9425 format %{ "CMP $op1,$op2\t! unsigned\n\t" |
|
9426 "BP$cmp $labl" %} |
|
9427 ins_encode %{ |
|
9428 Label* L = $labl$$label; |
|
9429 Assembler::Predict predict_taken = |
|
9430 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9431 __ cmp($op1$$Register, $op2$$constant); |
|
9432 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9433 __ delayed()->nop(); |
|
9434 %} |
|
9435 ins_pipe(cmp_br_reg_imm); |
|
9436 %} |
|
9437 |
|
9438 instruct cmpL_reg_branch(cmpOp cmp, iRegL op1, iRegL op2, label labl, flagsRegL xcc) %{ |
|
9439 match(If cmp (CmpL op1 op2)); |
|
9440 effect(USE labl, KILL xcc); |
|
9441 |
|
9442 size(12); |
|
9443 ins_cost(BRANCH_COST); |
|
9444 format %{ "CMP $op1,$op2\t! long\n\t" |
|
9445 "BP$cmp $labl" %} |
|
9446 ins_encode %{ |
|
9447 Label* L = $labl$$label; |
|
9448 Assembler::Predict predict_taken = |
|
9449 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9450 __ cmp($op1$$Register, $op2$$Register); |
|
9451 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::xcc, predict_taken, *L); |
|
9452 __ delayed()->nop(); |
|
9453 %} |
|
9454 ins_pipe(cmp_br_reg_reg); |
|
9455 %} |
|
9456 |
|
9457 instruct cmpL_imm_branch(cmpOp cmp, iRegL op1, immL5 op2, label labl, flagsRegL xcc) %{ |
|
9458 match(If cmp (CmpL op1 op2)); |
|
9459 effect(USE labl, KILL xcc); |
|
9460 |
|
9461 size(12); |
|
9462 ins_cost(BRANCH_COST); |
|
9463 format %{ "CMP $op1,$op2\t! long\n\t" |
|
9464 "BP$cmp $labl" %} |
|
9465 ins_encode %{ |
|
9466 Label* L = $labl$$label; |
|
9467 Assembler::Predict predict_taken = |
|
9468 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9469 __ cmp($op1$$Register, $op2$$constant); |
|
9470 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::xcc, predict_taken, *L); |
|
9471 __ delayed()->nop(); |
|
9472 %} |
|
9473 ins_pipe(cmp_br_reg_imm); |
|
9474 %} |
|
9475 |
|
9476 // Compare Pointers and branch |
|
9477 instruct cmpP_reg_branch(cmpOpP cmp, iRegP op1, iRegP op2, label labl, flagsRegP pcc) %{ |
|
9478 match(If cmp (CmpP op1 op2)); |
|
9479 effect(USE labl, KILL pcc); |
|
9480 |
|
9481 size(12); |
|
9482 ins_cost(BRANCH_COST); |
|
9483 format %{ "CMP $op1,$op2\t! ptr\n\t" |
|
9484 "B$cmp $labl" %} |
|
9485 ins_encode %{ |
|
9486 Label* L = $labl$$label; |
|
9487 Assembler::Predict predict_taken = |
|
9488 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9489 __ cmp($op1$$Register, $op2$$Register); |
|
9490 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L); |
|
9491 __ delayed()->nop(); |
|
9492 %} |
|
9493 ins_pipe(cmp_br_reg_reg); |
|
9494 %} |
|
9495 |
|
9496 instruct cmpP_null_branch(cmpOpP cmp, iRegP op1, immP0 null, label labl, flagsRegP pcc) %{ |
|
9497 match(If cmp (CmpP op1 null)); |
|
9498 effect(USE labl, KILL pcc); |
|
9499 |
|
9500 size(12); |
|
9501 ins_cost(BRANCH_COST); |
|
9502 format %{ "CMP $op1,0\t! ptr\n\t" |
|
9503 "B$cmp $labl" %} |
|
9504 ins_encode %{ |
|
9505 Label* L = $labl$$label; |
|
9506 Assembler::Predict predict_taken = |
|
9507 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9508 __ cmp($op1$$Register, G0); |
|
9509 // bpr() is not used here since it has shorter distance. |
|
9510 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L); |
|
9511 __ delayed()->nop(); |
|
9512 %} |
|
9513 ins_pipe(cmp_br_reg_reg); |
|
9514 %} |
|
9515 |
|
9516 instruct cmpN_reg_branch(cmpOp cmp, iRegN op1, iRegN op2, label labl, flagsReg icc) %{ |
|
9517 match(If cmp (CmpN op1 op2)); |
|
9518 effect(USE labl, KILL icc); |
|
9519 |
|
9520 size(12); |
|
9521 ins_cost(BRANCH_COST); |
|
9522 format %{ "CMP $op1,$op2\t! compressed ptr\n\t" |
|
9523 "BP$cmp $labl" %} |
|
9524 ins_encode %{ |
|
9525 Label* L = $labl$$label; |
|
9526 Assembler::Predict predict_taken = |
|
9527 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9528 __ cmp($op1$$Register, $op2$$Register); |
|
9529 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9530 __ delayed()->nop(); |
|
9531 %} |
|
9532 ins_pipe(cmp_br_reg_reg); |
|
9533 %} |
|
9534 |
|
9535 instruct cmpN_null_branch(cmpOp cmp, iRegN op1, immN0 null, label labl, flagsReg icc) %{ |
|
9536 match(If cmp (CmpN op1 null)); |
|
9537 effect(USE labl, KILL icc); |
|
9538 |
|
9539 size(12); |
|
9540 ins_cost(BRANCH_COST); |
|
9541 format %{ "CMP $op1,0\t! compressed ptr\n\t" |
|
9542 "BP$cmp $labl" %} |
|
9543 ins_encode %{ |
|
9544 Label* L = $labl$$label; |
|
9545 Assembler::Predict predict_taken = |
|
9546 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9547 __ cmp($op1$$Register, G0); |
|
9548 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9549 __ delayed()->nop(); |
|
9550 %} |
|
9551 ins_pipe(cmp_br_reg_reg); |
|
9552 %} |
|
9553 |
|
9554 // Loop back branch |
|
9555 instruct cmpI_reg_branchLoopEnd(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{ |
|
9556 match(CountedLoopEnd cmp (CmpI op1 op2)); |
|
9557 effect(USE labl, KILL icc); |
|
9558 |
|
9559 size(12); |
|
9560 ins_cost(BRANCH_COST); |
|
9561 format %{ "CMP $op1,$op2\t! int\n\t" |
|
9562 "BP$cmp $labl\t! Loop end" %} |
|
9563 ins_encode %{ |
|
9564 Label* L = $labl$$label; |
|
9565 Assembler::Predict predict_taken = |
|
9566 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9567 __ cmp($op1$$Register, $op2$$Register); |
|
9568 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9569 __ delayed()->nop(); |
|
9570 %} |
|
9571 ins_pipe(cmp_br_reg_reg); |
|
9572 %} |
|
9573 |
|
9574 instruct cmpI_imm_branchLoopEnd(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{ |
|
9575 match(CountedLoopEnd cmp (CmpI op1 op2)); |
|
9576 effect(USE labl, KILL icc); |
|
9577 |
|
9578 size(12); |
|
9579 ins_cost(BRANCH_COST); |
|
9580 format %{ "CMP $op1,$op2\t! int\n\t" |
|
9581 "BP$cmp $labl\t! Loop end" %} |
|
9582 ins_encode %{ |
|
9583 Label* L = $labl$$label; |
|
9584 Assembler::Predict predict_taken = |
|
9585 cbuf.is_backward_branch(*L) ? Assembler::pt : Assembler::pn; |
|
9586 __ cmp($op1$$Register, $op2$$constant); |
|
9587 __ bp((Assembler::Condition)($cmp$$cmpcode), false, Assembler::icc, predict_taken, *L); |
|
9588 __ delayed()->nop(); |
|
9589 %} |
|
9590 ins_pipe(cmp_br_reg_imm); |
|
9591 %} |
|
9592 |
|
9593 // Short compare and branch instructions |
|
9594 instruct cmpI_reg_branch_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{ |
|
9595 match(If cmp (CmpI op1 op2)); |
|
9596 predicate(UseCBCond); |
|
9597 effect(USE labl, KILL icc); |
|
9598 |
|
9599 size(4); |
|
9600 ins_cost(BRANCH_COST); |
|
9601 format %{ "CWB$cmp $op1,$op2,$labl\t! int" %} |
|
9602 ins_encode %{ |
|
9603 Label* L = $labl$$label; |
|
9604 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9605 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); |
|
9606 %} |
|
9607 ins_short_branch(1); |
|
9608 ins_avoid_back_to_back(1); |
|
9609 ins_pipe(cbcond_reg_reg); |
|
9610 %} |
|
9611 |
|
9612 instruct cmpI_imm_branch_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{ |
|
9613 match(If cmp (CmpI op1 op2)); |
|
9614 predicate(UseCBCond); |
|
9615 effect(USE labl, KILL icc); |
|
9616 |
|
9617 size(4); |
|
9618 ins_cost(BRANCH_COST); |
|
9619 format %{ "CWB$cmp $op1,$op2,$labl\t! int" %} |
|
9620 ins_encode %{ |
|
9621 Label* L = $labl$$label; |
|
9622 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9623 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L); |
|
9624 %} |
|
9625 ins_short_branch(1); |
|
9626 ins_avoid_back_to_back(1); |
|
9627 ins_pipe(cbcond_reg_imm); |
|
9628 %} |
|
9629 |
|
9630 instruct cmpU_reg_branch_short(cmpOpU cmp, iRegI op1, iRegI op2, label labl, flagsRegU icc) %{ |
|
9631 match(If cmp (CmpU op1 op2)); |
|
9632 predicate(UseCBCond); |
|
9633 effect(USE labl, KILL icc); |
|
9634 |
|
9635 size(4); |
|
9636 ins_cost(BRANCH_COST); |
|
9637 format %{ "CWB$cmp $op1,$op2,$labl\t! unsigned" %} |
|
9638 ins_encode %{ |
|
9639 Label* L = $labl$$label; |
|
9640 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9641 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); |
|
9642 %} |
|
9643 ins_short_branch(1); |
|
9644 ins_avoid_back_to_back(1); |
|
9645 ins_pipe(cbcond_reg_reg); |
|
9646 %} |
|
9647 |
|
9648 instruct cmpU_imm_branch_short(cmpOpU cmp, iRegI op1, immI5 op2, label labl, flagsRegU icc) %{ |
|
9649 match(If cmp (CmpU op1 op2)); |
|
9650 predicate(UseCBCond); |
|
9651 effect(USE labl, KILL icc); |
|
9652 |
|
9653 size(4); |
|
9654 ins_cost(BRANCH_COST); |
|
9655 format %{ "CWB$cmp $op1,$op2,$labl\t! unsigned" %} |
|
9656 ins_encode %{ |
|
9657 Label* L = $labl$$label; |
|
9658 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9659 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L); |
|
9660 %} |
|
9661 ins_short_branch(1); |
|
9662 ins_avoid_back_to_back(1); |
|
9663 ins_pipe(cbcond_reg_imm); |
|
9664 %} |
|
9665 |
|
9666 instruct cmpL_reg_branch_short(cmpOp cmp, iRegL op1, iRegL op2, label labl, flagsRegL xcc) %{ |
|
9667 match(If cmp (CmpL op1 op2)); |
|
9668 predicate(UseCBCond); |
|
9669 effect(USE labl, KILL xcc); |
|
9670 |
|
9671 size(4); |
|
9672 ins_cost(BRANCH_COST); |
|
9673 format %{ "CXB$cmp $op1,$op2,$labl\t! long" %} |
|
9674 ins_encode %{ |
|
9675 Label* L = $labl$$label; |
|
9676 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9677 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$Register, *L); |
|
9678 %} |
|
9679 ins_short_branch(1); |
|
9680 ins_avoid_back_to_back(1); |
|
9681 ins_pipe(cbcond_reg_reg); |
|
9682 %} |
|
9683 |
|
9684 instruct cmpL_imm_branch_short(cmpOp cmp, iRegL op1, immL5 op2, label labl, flagsRegL xcc) %{ |
|
9685 match(If cmp (CmpL op1 op2)); |
|
9686 predicate(UseCBCond); |
|
9687 effect(USE labl, KILL xcc); |
|
9688 |
|
9689 size(4); |
|
9690 ins_cost(BRANCH_COST); |
|
9691 format %{ "CXB$cmp $op1,$op2,$labl\t! long" %} |
|
9692 ins_encode %{ |
|
9693 Label* L = $labl$$label; |
|
9694 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9695 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$constant, *L); |
|
9696 %} |
|
9697 ins_short_branch(1); |
|
9698 ins_avoid_back_to_back(1); |
|
9699 ins_pipe(cbcond_reg_imm); |
|
9700 %} |
|
9701 |
|
9702 // Compare Pointers and branch |
|
9703 instruct cmpP_reg_branch_short(cmpOpP cmp, iRegP op1, iRegP op2, label labl, flagsRegP pcc) %{ |
|
9704 match(If cmp (CmpP op1 op2)); |
|
9705 predicate(UseCBCond); |
|
9706 effect(USE labl, KILL pcc); |
|
9707 |
|
9708 size(4); |
|
9709 ins_cost(BRANCH_COST); |
|
9710 #ifdef _LP64 |
|
9711 format %{ "CXB$cmp $op1,$op2,$labl\t! ptr" %} |
|
9712 #else |
|
9713 format %{ "CWB$cmp $op1,$op2,$labl\t! ptr" %} |
|
9714 #endif |
|
9715 ins_encode %{ |
|
9716 Label* L = $labl$$label; |
|
9717 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9718 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, $op2$$Register, *L); |
|
9719 %} |
|
9720 ins_short_branch(1); |
|
9721 ins_avoid_back_to_back(1); |
|
9722 ins_pipe(cbcond_reg_reg); |
|
9723 %} |
|
9724 |
|
9725 instruct cmpP_null_branch_short(cmpOpP cmp, iRegP op1, immP0 null, label labl, flagsRegP pcc) %{ |
|
9726 match(If cmp (CmpP op1 null)); |
|
9727 predicate(UseCBCond); |
|
9728 effect(USE labl, KILL pcc); |
|
9729 |
|
9730 size(4); |
|
9731 ins_cost(BRANCH_COST); |
|
9732 #ifdef _LP64 |
|
9733 format %{ "CXB$cmp $op1,0,$labl\t! ptr" %} |
|
9734 #else |
|
9735 format %{ "CWB$cmp $op1,0,$labl\t! ptr" %} |
|
9736 #endif |
|
9737 ins_encode %{ |
|
9738 Label* L = $labl$$label; |
|
9739 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9740 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, G0, *L); |
|
9741 %} |
|
9742 ins_short_branch(1); |
|
9743 ins_avoid_back_to_back(1); |
|
9744 ins_pipe(cbcond_reg_reg); |
|
9745 %} |
|
9746 |
|
9747 instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flagsReg icc) %{ |
|
9748 match(If cmp (CmpN op1 op2)); |
|
9749 predicate(UseCBCond); |
|
9750 effect(USE labl, KILL icc); |
|
9751 |
|
9752 size(4); |
|
9753 ins_cost(BRANCH_COST); |
|
9754 format %{ "CWB$cmp $op1,op2,$labl\t! compressed ptr" %} |
|
9755 ins_encode %{ |
|
9756 Label* L = $labl$$label; |
|
9757 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9758 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); |
|
9759 %} |
|
9760 ins_short_branch(1); |
|
9761 ins_avoid_back_to_back(1); |
|
9762 ins_pipe(cbcond_reg_reg); |
|
9763 %} |
|
9764 |
|
9765 instruct cmpN_null_branch_short(cmpOp cmp, iRegN op1, immN0 null, label labl, flagsReg icc) %{ |
|
9766 match(If cmp (CmpN op1 null)); |
|
9767 predicate(UseCBCond); |
|
9768 effect(USE labl, KILL icc); |
|
9769 |
|
9770 size(4); |
|
9771 ins_cost(BRANCH_COST); |
|
9772 format %{ "CWB$cmp $op1,0,$labl\t! compressed ptr" %} |
|
9773 ins_encode %{ |
|
9774 Label* L = $labl$$label; |
|
9775 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9776 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, G0, *L); |
|
9777 %} |
|
9778 ins_short_branch(1); |
|
9779 ins_avoid_back_to_back(1); |
|
9780 ins_pipe(cbcond_reg_reg); |
|
9781 %} |
|
9782 |
|
9783 // Loop back branch |
|
9784 instruct cmpI_reg_branchLoopEnd_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flagsReg icc) %{ |
|
9785 match(CountedLoopEnd cmp (CmpI op1 op2)); |
|
9786 predicate(UseCBCond); |
|
9787 effect(USE labl, KILL icc); |
|
9788 |
|
9789 size(4); |
|
9790 ins_cost(BRANCH_COST); |
|
9791 format %{ "CWB$cmp $op1,$op2,$labl\t! Loop end" %} |
|
9792 ins_encode %{ |
|
9793 Label* L = $labl$$label; |
|
9794 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9795 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L); |
|
9796 %} |
|
9797 ins_short_branch(1); |
|
9798 ins_avoid_back_to_back(1); |
|
9799 ins_pipe(cbcond_reg_reg); |
|
9800 %} |
|
9801 |
|
9802 instruct cmpI_imm_branchLoopEnd_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flagsReg icc) %{ |
|
9803 match(CountedLoopEnd cmp (CmpI op1 op2)); |
|
9804 predicate(UseCBCond); |
|
9805 effect(USE labl, KILL icc); |
|
9806 |
|
9807 size(4); |
|
9808 ins_cost(BRANCH_COST); |
|
9809 format %{ "CWB$cmp $op1,$op2,$labl\t! Loop end" %} |
|
9810 ins_encode %{ |
|
9811 Label* L = $labl$$label; |
|
9812 assert(__ use_cbcond(*L), "back to back cbcond"); |
|
9813 __ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L); |
|
9814 %} |
|
9815 ins_short_branch(1); |
|
9816 ins_avoid_back_to_back(1); |
|
9817 ins_pipe(cbcond_reg_imm); |
9212 %} |
9818 %} |
9213 |
9819 |
9214 // Branch-on-register tests all 64 bits. We assume that values |
9820 // Branch-on-register tests all 64 bits. We assume that values |
9215 // in 64-bit registers always remains zero or sign extended |
9821 // in 64-bit registers always remains zero or sign extended |
9216 // unless our code munges the high bits. Interrupts can chop |
9822 // unless our code munges the high bits. Interrupts can chop |