7234 // No flag versions for CompareAndSwap{P,I,L} because matcher can't match them |
7234 // No flag versions for CompareAndSwap{P,I,L} because matcher can't match them |
7235 |
7235 |
7236 instruct compareAndSwapL( rRegI res, eSIRegP mem_ptr, eADXRegL oldval, eBCXRegL newval, eFlagsReg cr ) %{ |
7236 instruct compareAndSwapL( rRegI res, eSIRegP mem_ptr, eADXRegL oldval, eBCXRegL newval, eFlagsReg cr ) %{ |
7237 predicate(VM_Version::supports_cx8()); |
7237 predicate(VM_Version::supports_cx8()); |
7238 match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval))); |
7238 match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval))); |
|
7239 match(Set res (WeakCompareAndSwapL mem_ptr (Binary oldval newval))); |
7239 effect(KILL cr, KILL oldval); |
7240 effect(KILL cr, KILL oldval); |
7240 format %{ "CMPXCHG8 [$mem_ptr],$newval\t# If EDX:EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" |
7241 format %{ "CMPXCHG8 [$mem_ptr],$newval\t# If EDX:EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" |
7241 "MOV $res,0\n\t" |
7242 "MOV $res,0\n\t" |
7242 "JNE,s fail\n\t" |
7243 "JNE,s fail\n\t" |
7243 "MOV $res,1\n" |
7244 "MOV $res,1\n" |
7247 ins_pipe( pipe_cmpxchg ); |
7248 ins_pipe( pipe_cmpxchg ); |
7248 %} |
7249 %} |
7249 |
7250 |
7250 instruct compareAndSwapP( rRegI res, pRegP mem_ptr, eAXRegP oldval, eCXRegP newval, eFlagsReg cr) %{ |
7251 instruct compareAndSwapP( rRegI res, pRegP mem_ptr, eAXRegP oldval, eCXRegP newval, eFlagsReg cr) %{ |
7251 match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval))); |
7252 match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval))); |
|
7253 match(Set res (WeakCompareAndSwapP mem_ptr (Binary oldval newval))); |
7252 effect(KILL cr, KILL oldval); |
7254 effect(KILL cr, KILL oldval); |
7253 format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" |
7255 format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" |
7254 "MOV $res,0\n\t" |
7256 "MOV $res,0\n\t" |
7255 "JNE,s fail\n\t" |
7257 "JNE,s fail\n\t" |
7256 "MOV $res,1\n" |
7258 "MOV $res,1\n" |
7259 ins_pipe( pipe_cmpxchg ); |
7261 ins_pipe( pipe_cmpxchg ); |
7260 %} |
7262 %} |
7261 |
7263 |
7262 instruct compareAndSwapI( rRegI res, pRegP mem_ptr, eAXRegI oldval, eCXRegI newval, eFlagsReg cr) %{ |
7264 instruct compareAndSwapI( rRegI res, pRegP mem_ptr, eAXRegI oldval, eCXRegI newval, eFlagsReg cr) %{ |
7263 match(Set res (CompareAndSwapI mem_ptr (Binary oldval newval))); |
7265 match(Set res (CompareAndSwapI mem_ptr (Binary oldval newval))); |
|
7266 match(Set res (WeakCompareAndSwapI mem_ptr (Binary oldval newval))); |
7264 effect(KILL cr, KILL oldval); |
7267 effect(KILL cr, KILL oldval); |
7265 format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" |
7268 format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" |
7266 "MOV $res,0\n\t" |
7269 "MOV $res,0\n\t" |
7267 "JNE,s fail\n\t" |
7270 "JNE,s fail\n\t" |
7268 "MOV $res,1\n" |
7271 "MOV $res,1\n" |
7269 "fail:" %} |
7272 "fail:" %} |
7270 ins_encode( enc_cmpxchg(mem_ptr), enc_flags_ne_to_boolean(res) ); |
7273 ins_encode( enc_cmpxchg(mem_ptr), enc_flags_ne_to_boolean(res) ); |
|
7274 ins_pipe( pipe_cmpxchg ); |
|
7275 %} |
|
7276 |
|
7277 instruct compareAndExchangeL( eSIRegP mem_ptr, eADXRegL oldval, eBCXRegL newval, eFlagsReg cr ) %{ |
|
7278 predicate(VM_Version::supports_cx8()); |
|
7279 match(Set oldval (CompareAndExchangeL mem_ptr (Binary oldval newval))); |
|
7280 effect(KILL cr); |
|
7281 format %{ "CMPXCHG8 [$mem_ptr],$newval\t# If EDX:EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" %} |
|
7282 ins_encode( enc_cmpxchg8(mem_ptr) ); |
|
7283 ins_pipe( pipe_cmpxchg ); |
|
7284 %} |
|
7285 |
|
7286 instruct compareAndExchangeP( pRegP mem_ptr, eAXRegP oldval, eCXRegP newval, eFlagsReg cr) %{ |
|
7287 match(Set oldval (CompareAndExchangeP mem_ptr (Binary oldval newval))); |
|
7288 effect(KILL cr); |
|
7289 format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" %} |
|
7290 ins_encode( enc_cmpxchg(mem_ptr) ); |
|
7291 ins_pipe( pipe_cmpxchg ); |
|
7292 %} |
|
7293 |
|
7294 instruct compareAndExchangeI( pRegP mem_ptr, eAXRegI oldval, eCXRegI newval, eFlagsReg cr) %{ |
|
7295 match(Set oldval (CompareAndExchangeI mem_ptr (Binary oldval newval))); |
|
7296 effect(KILL cr); |
|
7297 format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t" %} |
|
7298 ins_encode( enc_cmpxchg(mem_ptr) ); |
7271 ins_pipe( pipe_cmpxchg ); |
7299 ins_pipe( pipe_cmpxchg ); |
7272 %} |
7300 %} |
7273 |
7301 |
7274 instruct xaddI_no_res( memory mem, Universe dummy, immI add, eFlagsReg cr) %{ |
7302 instruct xaddI_no_res( memory mem, Universe dummy, immI add, eFlagsReg cr) %{ |
7275 predicate(n->as_LoadStore()->result_not_used()); |
7303 predicate(n->as_LoadStore()->result_not_used()); |