use of jdk.vm.ci.code.TargetDescription in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitSub.
@Override
public Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlags) {
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, SUB, DWORD, false, a, b, setFlags);
case QWORD:
return emitBinary(resultKind, SUB, QWORD, false, a, b, setFlags);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.SUB, SS, false, a, b);
} else {
return emitBinary(resultKind, SSEOp.SUB, SS, false, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.SUB, SD, false, a, b);
} else {
return emitBinary(resultKind, SSEOp.SUB, SD, false, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.code.TargetDescription in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitOr.
@Override
public Variable emitOr(Value a, Value b) {
LIRKind resultKind = LIRKind.combine(a, b);
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, OR, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, OR, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.OR, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.OR, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.OR, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.OR, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.code.TargetDescription in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitAnd.
@Override
public Variable emitAnd(Value a, Value b) {
LIRKind resultKind = LIRKind.combine(a, b);
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, AND, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, AND, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.AND, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.AND, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.AND, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.AND, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.code.TargetDescription in project graal by oracle.
the class AMD64NodeMatchRules method mulMemory.
@MatchRule("(Mul value Read=access)")
@MatchRule("(Mul value FloatingRead=access)")
public ComplexMatchResult mulMemory(ValueNode value, LIRLowerableAccess access) {
OperandSize size = getMemorySize(access);
if (size.isXmmType()) {
TargetDescription target = getLIRGeneratorTool().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
if (isAvx) {
return binaryRead(AVXOp.MUL, size, value, access);
} else {
return binaryRead(SSEOp.MUL, size, value, access);
}
} else {
return binaryRead(AMD64RMOp.IMUL, size, value, access);
}
}
use of jdk.vm.ci.code.TargetDescription in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitDiv.
@Override
public Value emitDiv(Value a, Value b, LIRFrameState state) {
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
LIRKind resultKind = LIRKind.combine(a, b);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
AMD64MulDivOp op = emitIDIV(DWORD, a, b, state);
return getLIRGen().emitMove(op.getQuotient());
case QWORD:
AMD64MulDivOp lop = emitIDIV(QWORD, a, b, state);
return getLIRGen().emitMove(lop.getQuotient());
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.DIV, SS, false, a, b);
} else {
return emitBinary(resultKind, SSEOp.DIV, SS, false, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.DIV, SD, false, a, b);
} else {
return emitBinary(resultKind, SSEOp.DIV, SD, false, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
Aggregations