graal/com.oracle.graal.lir.ptx/src/com/oracle/graal/lir/ptx/PTXMove.java
Print this page
rev 8592 : Graal PTX enhancements
*** 163,173 ****
--- 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:
+ System.err.println("missing: " + address.getKind());
throw GraalInternalError.shouldNotReachHere();
}
}
}
*** 248,261 ****
--- 255,278 ----
}
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:
+ System.err.println("missing: " + input.getKind());
throw GraalInternalError.shouldNotReachHere("kind=" + result.getKind());
}
}
private static void const2reg(TargetMethodAssembler tasm, PTXAssembler masm, Value result, Constant input) {
*** 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");
}
}
--- 281,312 ----
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 {
+ System.out.println("OA: " + tasm.recordDataReferenceInCode(input, 0, false).getClass().getName());
+ // masm.mov_u64(asRegister(result), tasm.recordDataReferenceInCode(input, 0, false));
+ }
+ break;
default:
+ System.err.println("missing: " + input.getKind());
throw GraalInternalError.shouldNotReachHere();
}
}
protected static void compareAndSwap(TargetMethodAssembler tasm, PTXAssembler masm, AllocatableValue result, PTXAddressValue address, AllocatableValue cmpValue, AllocatableValue newValue) {
throw new InternalError("NYI");
}
}