src/cpu/x86/vm/x86_64.ad

Print this page
rev 2506 : [mq]: membar2


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




7364     __ popcntq($dst$$Register, $mem$$Address);
7365   %}
7366   ins_pipe(ialu_reg);
7367 %}
7368 
7369 
7370 //----------MemBar Instructions-----------------------------------------------
7371 // Memory barrier flavors
7372 
7373 instruct membar_acquire()
7374 %{
7375   match(MemBarAcquire);
7376   ins_cost(0);
7377 
7378   size(0);
7379   format %{ "MEMBAR-acquire ! (empty encoding)" %}
7380   ins_encode();
7381   ins_pipe(empty);
7382 %}
7383 












7384 instruct membar_release()
7385 %{
7386   match(MemBarRelease);
7387   ins_cost(0);
7388 
7389   size(0);
7390   format %{ "MEMBAR-release ! (empty encoding)" %}












7391   ins_encode();
7392   ins_pipe(empty);
7393 %}
7394 
7395 instruct membar_volatile(rFlagsReg cr) %{
7396   match(MemBarVolatile);
7397   effect(KILL cr);
7398   ins_cost(400);
7399 
7400   format %{
7401     $$template
7402     if (os::is_MP()) {
7403       $$emit$$"lock addl [rsp + #0], 0\t! membar_volatile"
7404     } else {
7405       $$emit$$"MEMBAR-volatile ! (empty encoding)"
7406     }
7407   %}
7408   ins_encode %{
7409     __ membar(Assembler::StoreLoad);
7410   %}