use of org.graalvm.compiler.lir.sparc.SPARCAddressValue in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitPrefetchAllocate.
@Override
public void emitPrefetchAllocate(Value address) {
SPARCAddressValue addr = asAddressValue(address);
append(new SPARCPrefetchOp(addr, SPARCAssembler.Fcn.SeveralWritesAndPossiblyReads));
}
use of org.graalvm.compiler.lir.sparc.SPARCAddressValue in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitStore.
@Override
public void emitStore(ValueKind<?> kind, Value address, Value inputVal, LIRFrameState state) {
SPARCAddressValue storeAddress = getLIRGen().asAddressValue(address);
if (isJavaConstant(inputVal)) {
JavaConstant c = asJavaConstant(inputVal);
if (c.isDefaultForKind()) {
getLIRGen().append(new StoreConstantOp(kind.getPlatformKind(), storeAddress, c, state));
return;
}
}
Variable input = getLIRGen().load(inputVal);
getLIRGen().append(new StoreOp(kind.getPlatformKind(), storeAddress, input, state));
}
use of org.graalvm.compiler.lir.sparc.SPARCAddressValue in project graal by oracle.
the class SPARCLIRGenerator method emitZeroExtendLoad.
public Value emitZeroExtendLoad(LIRKind kind, LIRKind resultKind, Value address, LIRFrameState state) {
SPARCAddressValue loadAddress = asAddressValue(address);
Variable result = newVariable(resultKind);
append(new LoadOp(kind.getPlatformKind(), result, loadAddress, state));
return result;
}
use of org.graalvm.compiler.lir.sparc.SPARCAddressValue in project graal by oracle.
the class SPARCMoveFactory method createMove.
@Override
public LIRInstruction createMove(AllocatableValue dst, Value src) {
boolean srcIsSlot = isStackSlotValue(src);
boolean dstIsSlot = isStackSlotValue(dst);
if (isConstantValue(src)) {
return createLoad(dst, asConstant(src));
} else if (src instanceof SPARCAddressValue) {
return new LoadAddressOp(dst, (SPARCAddressValue) src);
} else {
assert src instanceof AllocatableValue;
if (srcIsSlot && dstIsSlot) {
throw GraalError.shouldNotReachHere(src.getClass() + " " + dst.getClass());
} else {
return new Move(dst, (AllocatableValue) src);
}
}
}
use of org.graalvm.compiler.lir.sparc.SPARCAddressValue in project graal by oracle.
the class SPARCNodeMatchRules method ifCompareLogicCas.
@MatchRule("(If (ObjectEquals=compare value LogicCompareAndSwap=cas))")
@MatchRule("(If (PointerEquals=compare value LogicCompareAndSwap=cas))")
@MatchRule("(If (FloatEquals=compare value LogicCompareAndSwap=cas))")
@MatchRule("(If (IntegerEquals=compare value LogicCompareAndSwap=cas))")
public ComplexMatchResult ifCompareLogicCas(IfNode root, CompareNode compare, ValueNode value, LogicCompareAndSwapNode cas) {
JavaConstant constant = value.asJavaConstant();
assert compare.condition() == CanonicalCondition.EQ;
if (constant != null && cas.usages().count() == 1) {
long constantValue = constant.asLong();
boolean successIsTrue;
if (constantValue == 0) {
successIsTrue = false;
} else if (constantValue == 1) {
successIsTrue = true;
} else {
return null;
}
return builder -> {
LIRKind kind = getLirKind(cas);
LabelRef trueLabel = getLIRBlock(root.trueSuccessor());
LabelRef falseLabel = getLIRBlock(root.falseSuccessor());
double trueLabelProbability = root.probability(root.trueSuccessor());
Value expectedValue = operand(cas.getExpectedValue());
Value newValue = operand(cas.getNewValue());
SPARCAddressValue address = (SPARCAddressValue) operand(cas.getAddress());
Condition condition = successIsTrue ? Condition.EQ : Condition.NE;
Value result = getLIRGeneratorTool().emitValueCompareAndSwap(address, expectedValue, newValue);
getLIRGeneratorTool().emitCompareBranch(kind.getPlatformKind(), result, expectedValue, condition, false, trueLabel, falseLabel, trueLabelProbability);
return null;
};
}
return null;
}
Aggregations