use of com.oracle.truffle.llvm.runtime.vector.LLVMFloatVector in project sulong by graalvm.
the class LLVMX86_64VAStart method storeArgument.
private static int storeArgument(Object ptr, long offset, LLVMMemMoveNode memmove, LLVMIncrementPointerNode pointerArithmetic, LLVMStoreNode storeI64Node, LLVMStoreNode storeI32Node, LLVMStoreNode storeFP80Node, Object object) {
if (object instanceof Number) {
return doPrimitiveWrite(ptr, offset, pointerArithmetic, storeI64Node, object);
} else if (object instanceof LLVMVarArgCompoundValue) {
LLVMVarArgCompoundValue obj = (LLVMVarArgCompoundValue) object;
Object currentPtr = pointerArithmetic.executeWithTarget(ptr, offset);
memmove.executeWithTarget(currentPtr, obj.getAddr(), obj.getSize());
return obj.getSize();
} else if (object instanceof LLVMAddress || object instanceof LLVMGlobal || object instanceof LLVMTruffleObject) {
Object currentPtr = pointerArithmetic.executeWithTarget(ptr, offset);
storeI64Node.executeWithTarget(currentPtr, object);
return X86_64BitVarArgs.STACK_STEP;
} else if (object instanceof LLVM80BitFloat) {
Object currentPtr = pointerArithmetic.executeWithTarget(ptr, offset);
storeFP80Node.executeWithTarget(currentPtr, object);
return 16;
} else if (object instanceof LLVMFloatVector) {
final LLVMFloatVector floatVec = (LLVMFloatVector) object;
for (int i = 0; i < floatVec.getLength(); i++) {
Object currentPtr = pointerArithmetic.executeWithTarget(ptr, offset + i * Float.BYTES);
storeI32Node.executeWithTarget(currentPtr, Float.floatToIntBits(floatVec.getValue(i)));
}
return floatVec.getLength() * Float.BYTES;
} else {
throw new AssertionError(object);
}
}
Aggregations