< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package org.graalvm.compiler.hotspot.sparc;
  24 
  25 import static jdk.vm.ci.sparc.SPARCKind.WORD;
  26 import static jdk.vm.ci.sparc.SPARCKind.XWORD;
  27 import static org.graalvm.compiler.lir.LIRValueUtil.asConstant;
  28 import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue;
  29 

  30 import org.graalvm.compiler.core.common.CompressEncoding;
  31 import org.graalvm.compiler.core.common.LIRKind;
  32 import org.graalvm.compiler.core.common.calc.Condition;
  33 import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
  34 import org.graalvm.compiler.core.common.spi.LIRKindTool;
  35 import org.graalvm.compiler.core.sparc.SPARCArithmeticLIRGenerator;
  36 import org.graalvm.compiler.core.sparc.SPARCLIRGenerator;
  37 import org.graalvm.compiler.core.sparc.SPARCLIRKindTool;
  38 import org.graalvm.compiler.debug.GraalError;
  39 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
  40 import org.graalvm.compiler.hotspot.HotSpotBackend;
  41 import org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder;
  42 import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
  43 import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
  44 import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
  45 import org.graalvm.compiler.hotspot.HotSpotLockStack;
  46 import org.graalvm.compiler.hotspot.debug.BenchmarkCounters;
  47 import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
  48 import org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider;
  49 import org.graalvm.compiler.hotspot.stubs.Stub;


 238         ValueKind<?> kind = newValue.getValueKind();
 239         assert kind.equals(expectedValue.getValueKind());
 240         SPARCKind memKind = (SPARCKind) kind.getPlatformKind();
 241         Variable result = newVariable(newValue.getValueKind());
 242         append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
 243         return emitConditionalMove(memKind, expectedValue, result, Condition.EQ, true, trueValue, falseValue);
 244     }
 245 
 246     @Override
 247     public Variable emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
 248         ValueKind<?> kind = newValue.getValueKind();
 249         assert kind.equals(expectedValue.getValueKind());
 250         Variable result = newVariable(newValue.getValueKind());
 251         append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
 252         return result;
 253     }
 254 
 255     @Override
 256     public void emitPrefetchAllocate(Value address) {
 257         SPARCAddressValue addr = asAddressValue(address);
 258         append(new SPARCPrefetchOp(addr, config.allocatePrefetchInstr));
 259     }
 260 
 261     public StackSlot getDeoptimizationRescueSlot() {
 262         return deoptimizationRescueSlot;
 263     }
 264 
 265     @Override
 266     public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination,
 267                     double trueDestinationProbability) {
 268         Value localX = x;
 269         Value localY = y;
 270         if (localX instanceof HotSpotObjectConstant) {
 271             localX = load(localX);
 272         }
 273         if (localY instanceof HotSpotObjectConstant) {
 274             localY = load(localY);
 275         }
 276         super.emitCompareBranch(cmpKind, localX, localY, cond, unorderedIsTrue, trueDestination, falseDestination, trueDestinationProbability);
 277     }
 278 




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package org.graalvm.compiler.hotspot.sparc;
  24 
  25 import static jdk.vm.ci.sparc.SPARCKind.WORD;
  26 import static jdk.vm.ci.sparc.SPARCKind.XWORD;
  27 import static org.graalvm.compiler.lir.LIRValueUtil.asConstant;
  28 import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue;
  29 
  30 import org.graalvm.compiler.asm.sparc.SPARCAssembler;
  31 import org.graalvm.compiler.core.common.CompressEncoding;
  32 import org.graalvm.compiler.core.common.LIRKind;
  33 import org.graalvm.compiler.core.common.calc.Condition;
  34 import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
  35 import org.graalvm.compiler.core.common.spi.LIRKindTool;
  36 import org.graalvm.compiler.core.sparc.SPARCArithmeticLIRGenerator;
  37 import org.graalvm.compiler.core.sparc.SPARCLIRGenerator;
  38 import org.graalvm.compiler.core.sparc.SPARCLIRKindTool;
  39 import org.graalvm.compiler.debug.GraalError;
  40 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
  41 import org.graalvm.compiler.hotspot.HotSpotBackend;
  42 import org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder;
  43 import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
  44 import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
  45 import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
  46 import org.graalvm.compiler.hotspot.HotSpotLockStack;
  47 import org.graalvm.compiler.hotspot.debug.BenchmarkCounters;
  48 import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
  49 import org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider;
  50 import org.graalvm.compiler.hotspot.stubs.Stub;


 239         ValueKind<?> kind = newValue.getValueKind();
 240         assert kind.equals(expectedValue.getValueKind());
 241         SPARCKind memKind = (SPARCKind) kind.getPlatformKind();
 242         Variable result = newVariable(newValue.getValueKind());
 243         append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
 244         return emitConditionalMove(memKind, expectedValue, result, Condition.EQ, true, trueValue, falseValue);
 245     }
 246 
 247     @Override
 248     public Variable emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
 249         ValueKind<?> kind = newValue.getValueKind();
 250         assert kind.equals(expectedValue.getValueKind());
 251         Variable result = newVariable(newValue.getValueKind());
 252         append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
 253         return result;
 254     }
 255 
 256     @Override
 257     public void emitPrefetchAllocate(Value address) {
 258         SPARCAddressValue addr = asAddressValue(address);
 259         append(new SPARCPrefetchOp(addr, SPARCAssembler.Fcn.SeveralWritesAndPossiblyReads));
 260     }
 261 
 262     public StackSlot getDeoptimizationRescueSlot() {
 263         return deoptimizationRescueSlot;
 264     }
 265 
 266     @Override
 267     public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination,
 268                     double trueDestinationProbability) {
 269         Value localX = x;
 270         Value localY = y;
 271         if (localX instanceof HotSpotObjectConstant) {
 272             localX = load(localX);
 273         }
 274         if (localY instanceof HotSpotObjectConstant) {
 275             localY = load(localY);
 276         }
 277         super.emitCompareBranch(cmpKind, localX, localY, cond, unorderedIsTrue, trueDestination, falseDestination, trueDestinationProbability);
 278     }
 279 


< prev index next >