use of jdk.vm.ci.amd64.AMD64Kind in project graal by oracle.
the class AMD64HotSpotLoadConfigValueOp method emitCode.
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
if (GeneratePIC.getValue(crb.getOptions())) {
AMD64Kind kind = (AMD64Kind) result.getPlatformKind();
Register reg = asRegister(result);
AMD64Address placeholder = masm.getPlaceholder(-1);
switch(kind) {
case BYTE:
masm.movsbl(reg, placeholder);
break;
case WORD:
masm.movswl(reg, placeholder);
break;
case DWORD:
masm.movl(reg, placeholder);
break;
case QWORD:
masm.movq(reg, placeholder);
break;
default:
throw GraalError.unimplemented();
}
} else {
throw GraalError.unimplemented();
}
crb.recordMark(markId);
}
use of jdk.vm.ci.amd64.AMD64Kind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitStore.
@Override
public void emitStore(ValueKind<?> lirKind, Value address, Value input, LIRFrameState state) {
AMD64AddressValue storeAddress = getAMD64LIRGen().asAddressValue(address);
AMD64Kind kind = (AMD64Kind) lirKind.getPlatformKind();
if (isConstantValue(input)) {
emitStoreConst(kind, storeAddress, asConstantValue(input), state);
} else {
emitStore(kind, storeAddress, getLIRGen().asAllocatable(input), state);
}
}
use of jdk.vm.ci.amd64.AMD64Kind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitLoad.
@Override
public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
AMD64AddressValue loadAddress = getAMD64LIRGen().asAddressValue(address);
Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
switch((AMD64Kind) kind.getPlatformKind()) {
case BYTE:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSXB, DWORD, result, loadAddress, state));
break;
case WORD:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSX, DWORD, result, loadAddress, state));
break;
case DWORD:
getLIRGen().append(new AMD64Unary.MemoryOp(MOV, DWORD, result, loadAddress, state));
break;
case QWORD:
getLIRGen().append(new AMD64Unary.MemoryOp(MOV, QWORD, result, loadAddress, state));
break;
case SINGLE:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSS, SS, result, loadAddress, state));
break;
case DOUBLE:
getLIRGen().append(new AMD64Unary.MemoryOp(MOVSD, SD, result, loadAddress, state));
break;
default:
throw GraalError.shouldNotReachHere();
}
return result;
}
use of jdk.vm.ci.amd64.AMD64Kind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitMul.
@Override
public Variable emitMul(Value a, Value b, boolean setFlags) {
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 emitIMUL(DWORD, a, b);
case QWORD:
return emitIMUL(QWORD, a, b);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.MUL, SS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.MUL, SS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.MUL, SD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.MUL, SD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.amd64.AMD64Kind in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitXor.
@Override
public Variable emitXor(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, XOR, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, XOR, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.XOR, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.XOR, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.XOR, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.XOR, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
Aggregations