graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMove.java
Print this page
rev 8661 : Graal PTX enhancements
rev 8663 : [mq]: ptx_lookup_switch
*** 163,174 ****
PTXAddress addr = address.toAddress();
switch (address.getKind()) {
case Int:
masm.st_global_s32(addr.getBase(), addr.getDisplacement(), asRegister(input));
break;
default:
! throw GraalInternalError.shouldNotReachHere();
}
}
}
public static class LeaOp extends PTXLIRInstruction {
--- 163,180 ----
PTXAddress addr = address.toAddress();
switch (address.getKind()) {
case Int:
masm.st_global_s32(addr.getBase(), addr.getDisplacement(), asRegister(input));
break;
+ case Byte:
+ masm.st_global_s8(addr.getBase(), addr.getDisplacement(), asRegister(input));
+ break;
+ case Object:
+ masm.st_global_s32(addr.getBase(), addr.getDisplacement(), asRegister(input));
+ break;
default:
! throw GraalInternalError.shouldNotReachHere("missing: " + address.getKind());
}
}
}
public static class LeaOp extends PTXLIRInstruction {
*** 248,262 ****
}
switch (input.getKind()) {
case Int:
masm.mov_s32(asRegister(result), asRegister(input));
break;
case Object:
masm.mov_u64(asRegister(result), asRegister(input));
break;
default:
! throw GraalInternalError.shouldNotReachHere("kind=" + result.getKind());
}
}
private static void const2reg(TargetMethodAssembler tasm, PTXAssembler masm, Value result, Constant input) {
switch (input.getKind().getStackKind()) {
--- 254,277 ----
}
switch (input.getKind()) {
case Int:
masm.mov_s32(asRegister(result), asRegister(input));
break;
+ case Long:
+ masm.mov_s64(asRegister(result), asRegister(input));
+ break;
+ case Float:
+ masm.mov_f32(asRegister(result), asRegister(input));
+ break;
+ case Double:
+ masm.mov_f64(asRegister(result), asRegister(input));
+ break;
case Object:
masm.mov_u64(asRegister(result), asRegister(input));
break;
default:
! throw GraalInternalError.shouldNotReachHere("missing: " + input.getKind());
}
}
private static void const2reg(TargetMethodAssembler tasm, PTXAssembler masm, Value result, Constant input) {
switch (input.getKind().getStackKind()) {
*** 264,278 ****
if (tasm.runtime.needsDataPatch(input)) {
tasm.recordDataReferenceInCode(input, 0, true);
}
masm.mov_s32(asRegister(result), input.asInt());
break;
default:
! throw GraalInternalError.shouldNotReachHere();
}
}
- @SuppressWarnings("unused")
protected static void compareAndSwap(TargetMethodAssembler tasm, PTXAssembler masm, AllocatableValue result, PTXAddressValue address, AllocatableValue cmpValue, AllocatableValue newValue) {
throw new InternalError("NYI");
}
}
--- 279,308 ----
if (tasm.runtime.needsDataPatch(input)) {
tasm.recordDataReferenceInCode(input, 0, true);
}
masm.mov_s32(asRegister(result), input.asInt());
break;
+ case Long:
+ if (tasm.runtime.needsDataPatch(input)) {
+ tasm.recordDataReferenceInCode(input, 0, true);
+ }
+ masm.mov_s64(asRegister(result), input.asLong());
+ break;
+ case Object:
+ if (input.isNull()) {
+ masm.mov_u64(asRegister(result), 0x0L);
+ } else if (tasm.target.inlineObjects) {
+ tasm.recordDataReferenceInCode(input, 0, true);
+ masm.mov_u64(asRegister(result), 0xDEADDEADDEADDEADL);
+ } else {
+ masm.mov_u64(asRegister(result), tasm.recordDataReferenceInCode(input, 0, false));
+ }
+ break;
default:
! throw GraalInternalError.shouldNotReachHere("missing: " + input.getKind());
}
}
protected static void compareAndSwap(TargetMethodAssembler tasm, PTXAssembler masm, AllocatableValue result, PTXAddressValue address, AllocatableValue cmpValue, AllocatableValue newValue) {
throw new InternalError("NYI");
}
}