7279 rax_RegP oldval, rRegP newval, |
7279 rax_RegP oldval, rRegP newval, |
7280 rFlagsReg cr) |
7280 rFlagsReg cr) |
7281 %{ |
7281 %{ |
7282 predicate(VM_Version::supports_cx8()); |
7282 predicate(VM_Version::supports_cx8()); |
7283 match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval))); |
7283 match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval))); |
|
7284 match(Set res (WeakCompareAndSwapP mem_ptr (Binary oldval newval))); |
7284 effect(KILL cr, KILL oldval); |
7285 effect(KILL cr, KILL oldval); |
7285 |
7286 |
7286 format %{ "cmpxchgq $mem_ptr,$newval\t# " |
7287 format %{ "cmpxchgq $mem_ptr,$newval\t# " |
7287 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" |
7288 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" |
7288 "sete $res\n\t" |
7289 "sete $res\n\t" |
7303 rax_RegL oldval, rRegL newval, |
7304 rax_RegL oldval, rRegL newval, |
7304 rFlagsReg cr) |
7305 rFlagsReg cr) |
7305 %{ |
7306 %{ |
7306 predicate(VM_Version::supports_cx8()); |
7307 predicate(VM_Version::supports_cx8()); |
7307 match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval))); |
7308 match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval))); |
|
7309 match(Set res (WeakCompareAndSwapL mem_ptr (Binary oldval newval))); |
7308 effect(KILL cr, KILL oldval); |
7310 effect(KILL cr, KILL oldval); |
7309 |
7311 |
7310 format %{ "cmpxchgq $mem_ptr,$newval\t# " |
7312 format %{ "cmpxchgq $mem_ptr,$newval\t# " |
7311 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" |
7313 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" |
7312 "sete $res\n\t" |
7314 "sete $res\n\t" |
7349 instruct compareAndSwapN(rRegI res, |
7352 instruct compareAndSwapN(rRegI res, |
7350 memory mem_ptr, |
7353 memory mem_ptr, |
7351 rax_RegN oldval, rRegN newval, |
7354 rax_RegN oldval, rRegN newval, |
7352 rFlagsReg cr) %{ |
7355 rFlagsReg cr) %{ |
7353 match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval))); |
7356 match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval))); |
|
7357 match(Set res (WeakCompareAndSwapN mem_ptr (Binary oldval newval))); |
7354 effect(KILL cr, KILL oldval); |
7358 effect(KILL cr, KILL oldval); |
7355 |
7359 |
7356 format %{ "cmpxchgl $mem_ptr,$newval\t# " |
7360 format %{ "cmpxchgl $mem_ptr,$newval\t# " |
7357 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" |
7361 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" |
7358 "sete $res\n\t" |
7362 "sete $res\n\t" |
7363 OpcP, OpcS, |
7367 OpcP, OpcS, |
7364 reg_mem(newval, mem_ptr), |
7368 reg_mem(newval, mem_ptr), |
7365 REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete |
7369 REX_breg(res), Opcode(0x0F), Opcode(0x94), reg(res), // sete |
7366 REX_reg_breg(res, res), // movzbl |
7370 REX_reg_breg(res, res), // movzbl |
7367 Opcode(0xF), Opcode(0xB6), reg_reg(res, res)); |
7371 Opcode(0xF), Opcode(0xB6), reg_reg(res, res)); |
|
7372 ins_pipe( pipe_cmpxchg ); |
|
7373 %} |
|
7374 |
|
7375 instruct compareAndExchangeI( |
|
7376 memory mem_ptr, |
|
7377 rax_RegI oldval, rRegI newval, |
|
7378 rFlagsReg cr) |
|
7379 %{ |
|
7380 match(Set oldval (CompareAndExchangeI mem_ptr (Binary oldval newval))); |
|
7381 effect(KILL cr); |
|
7382 |
|
7383 format %{ "cmpxchgl $mem_ptr,$newval\t# " |
|
7384 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %} |
|
7385 opcode(0x0F, 0xB1); |
|
7386 ins_encode(lock_prefix, |
|
7387 REX_reg_mem(newval, mem_ptr), |
|
7388 OpcP, OpcS, |
|
7389 reg_mem(newval, mem_ptr) // lock cmpxchg |
|
7390 ); |
|
7391 ins_pipe( pipe_cmpxchg ); |
|
7392 %} |
|
7393 |
|
7394 instruct compareAndExchangeL( |
|
7395 memory mem_ptr, |
|
7396 rax_RegL oldval, rRegL newval, |
|
7397 rFlagsReg cr) |
|
7398 %{ |
|
7399 predicate(VM_Version::supports_cx8()); |
|
7400 match(Set oldval (CompareAndExchangeL mem_ptr (Binary oldval newval))); |
|
7401 effect(KILL cr); |
|
7402 |
|
7403 format %{ "cmpxchgq $mem_ptr,$newval\t# " |
|
7404 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %} |
|
7405 opcode(0x0F, 0xB1); |
|
7406 ins_encode(lock_prefix, |
|
7407 REX_reg_mem_wide(newval, mem_ptr), |
|
7408 OpcP, OpcS, |
|
7409 reg_mem(newval, mem_ptr) // lock cmpxchg |
|
7410 ); |
|
7411 ins_pipe( pipe_cmpxchg ); |
|
7412 %} |
|
7413 |
|
7414 instruct compareAndExchangeN( |
|
7415 memory mem_ptr, |
|
7416 rax_RegN oldval, rRegN newval, |
|
7417 rFlagsReg cr) %{ |
|
7418 match(Set oldval (CompareAndExchangeN mem_ptr (Binary oldval newval))); |
|
7419 effect(KILL cr); |
|
7420 |
|
7421 format %{ "cmpxchgl $mem_ptr,$newval\t# " |
|
7422 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %} |
|
7423 opcode(0x0F, 0xB1); |
|
7424 ins_encode(lock_prefix, |
|
7425 REX_reg_mem(newval, mem_ptr), |
|
7426 OpcP, OpcS, |
|
7427 reg_mem(newval, mem_ptr) // lock cmpxchg |
|
7428 ); |
|
7429 ins_pipe( pipe_cmpxchg ); |
|
7430 %} |
|
7431 |
|
7432 instruct compareAndExchangeP( |
|
7433 memory mem_ptr, |
|
7434 rax_RegP oldval, rRegP newval, |
|
7435 rFlagsReg cr) |
|
7436 %{ |
|
7437 predicate(VM_Version::supports_cx8()); |
|
7438 match(Set oldval (CompareAndExchangeP mem_ptr (Binary oldval newval))); |
|
7439 effect(KILL cr); |
|
7440 |
|
7441 format %{ "cmpxchgq $mem_ptr,$newval\t# " |
|
7442 "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" %} |
|
7443 opcode(0x0F, 0xB1); |
|
7444 ins_encode(lock_prefix, |
|
7445 REX_reg_mem_wide(newval, mem_ptr), |
|
7446 OpcP, OpcS, |
|
7447 reg_mem(newval, mem_ptr) // lock cmpxchg |
|
7448 ); |
7368 ins_pipe( pipe_cmpxchg ); |
7449 ins_pipe( pipe_cmpxchg ); |
7369 %} |
7450 %} |
7370 |
7451 |
7371 instruct xaddI_no_res( memory mem, Universe dummy, immI add, rFlagsReg cr) %{ |
7452 instruct xaddI_no_res( memory mem, Universe dummy, immI add, rFlagsReg cr) %{ |
7372 predicate(n->as_LoadStore()->result_not_used()); |
7453 predicate(n->as_LoadStore()->result_not_used()); |