src/cpu/x86/vm/x86_64.ad

Print this page
rev 2570 : imported patch membar2
rev 2571 : [mq]: membar3


7359   ins_pipe(ialu_reg);
7360 %}
7361 
7362 
7363 //----------MemBar Instructions-----------------------------------------------
7364 // Memory barrier flavors
7365 
7366 instruct membar_acquire()
7367 %{
7368   match(MemBarAcquire);
7369   ins_cost(0);
7370 
7371   size(0);
7372   format %{ "MEMBAR-acquire ! (empty encoding)" %}
7373   ins_encode();
7374   ins_pipe(empty);
7375 %}
7376 
7377 instruct membar_acquire_lock()
7378 %{
7379   match(MemBarAcquire);
7380   predicate(Matcher::prior_fast_lock(n));
7381   ins_cost(0);
7382 
7383   size(0);
7384   format %{ "MEMBAR-acquire (prior CMPXCHG in FastLock so empty encoding)" %}
7385   ins_encode();
7386   ins_pipe(empty);
7387 %}
7388 
7389 instruct membar_release()
7390 %{
7391   match(MemBarRelease);
7392   ins_cost(0);
7393 
7394   size(0);
7395   format %{ "MEMBAR-release ! (empty encoding)" %}
7396   ins_encode();
7397   ins_pipe(empty);
7398 %}
7399 
7400 instruct membar_release_lock()
7401 %{
7402   match(MemBarRelease);
7403   predicate(Matcher::post_fast_unlock(n));
7404   ins_cost(0);
7405 
7406   size(0);
7407   format %{ "MEMBAR-release (a FastUnlock follows so empty encoding)" %}
7408   ins_encode();
7409   ins_pipe(empty);
7410 %}
7411 
7412 instruct membar_volatile(rFlagsReg cr) %{
7413   match(MemBarVolatile);
7414   effect(KILL cr);
7415   ins_cost(400);
7416 
7417   format %{
7418     $$template
7419     if (os::is_MP()) {
7420       $$emit$$"lock addl [rsp + #0], 0\t! membar_volatile"
7421     } else {
7422       $$emit$$"MEMBAR-volatile ! (empty encoding)"
7423     }




7359   ins_pipe(ialu_reg);
7360 %}
7361 
7362 
7363 //----------MemBar Instructions-----------------------------------------------
7364 // Memory barrier flavors
7365 
7366 instruct membar_acquire()
7367 %{
7368   match(MemBarAcquire);
7369   ins_cost(0);
7370 
7371   size(0);
7372   format %{ "MEMBAR-acquire ! (empty encoding)" %}
7373   ins_encode();
7374   ins_pipe(empty);
7375 %}
7376 
7377 instruct membar_acquire_lock()
7378 %{
7379   match(MemBarAcquireLock);

7380   ins_cost(0);
7381 
7382   size(0);
7383   format %{ "MEMBAR-acquire (prior CMPXCHG in FastLock so empty encoding)" %}
7384   ins_encode();
7385   ins_pipe(empty);
7386 %}
7387 
7388 instruct membar_release()
7389 %{
7390   match(MemBarRelease);
7391   ins_cost(0);
7392 
7393   size(0);
7394   format %{ "MEMBAR-release ! (empty encoding)" %}
7395   ins_encode();
7396   ins_pipe(empty);
7397 %}
7398 
7399 instruct membar_release_lock()
7400 %{
7401   match(MemBarReleaseLock);

7402   ins_cost(0);
7403 
7404   size(0);
7405   format %{ "MEMBAR-release (a FastUnlock follows so empty encoding)" %}
7406   ins_encode();
7407   ins_pipe(empty);
7408 %}
7409 
7410 instruct membar_volatile(rFlagsReg cr) %{
7411   match(MemBarVolatile);
7412   effect(KILL cr);
7413   ins_cost(400);
7414 
7415   format %{
7416     $$template
7417     if (os::is_MP()) {
7418       $$emit$$"lock addl [rsp + #0], 0\t! membar_volatile"
7419     } else {
7420       $$emit$$"MEMBAR-volatile ! (empty encoding)"
7421     }