Search in sources :

Example 1 with LLVMMemory

use of com.oracle.truffle.llvm.runtime.memory.LLVMMemory in project graal by oracle.

the class LLVMStoreVectorNode method writeVector.

@Specialization(guards = "!isAutoDerefHandle(address)")
@ExplodeLoop
protected void writeVector(LLVMNativePointer address, LLVMI16Vector vector) {
    assert vector.getLength() == getVectorLength();
    LLVMMemory memory = getLanguage().getLLVMMemory();
    long currentPtr = address.asNative();
    for (int i = 0; i < getVectorLength(); i++) {
        memory.putI16(this, currentPtr, vector.getValue(i));
        currentPtr += I16_SIZE_IN_BYTES;
    }
}
Also used : LLVMMemory(com.oracle.truffle.llvm.runtime.memory.LLVMMemory) Specialization(com.oracle.truffle.api.dsl.Specialization) ExplodeLoop(com.oracle.truffle.api.nodes.ExplodeLoop)

Example 2 with LLVMMemory

use of com.oracle.truffle.llvm.runtime.memory.LLVMMemory in project graal by oracle.

the class LLVMStoreVectorNode method writeVector.

@Specialization(guards = "!isAutoDerefHandle(address)")
@ExplodeLoop
protected void writeVector(LLVMNativePointer address, LLVMI32Vector vector) {
    assert vector.getLength() == getVectorLength();
    LLVMMemory memory = getLanguage().getLLVMMemory();
    long currentPtr = address.asNative();
    for (int i = 0; i < getVectorLength(); i++) {
        memory.putI32(this, currentPtr, vector.getValue(i));
        currentPtr += I32_SIZE_IN_BYTES;
    }
}
Also used : LLVMMemory(com.oracle.truffle.llvm.runtime.memory.LLVMMemory) Specialization(com.oracle.truffle.api.dsl.Specialization) ExplodeLoop(com.oracle.truffle.api.nodes.ExplodeLoop)

Example 3 with LLVMMemory

use of com.oracle.truffle.llvm.runtime.memory.LLVMMemory in project graal by oracle.

the class LLVMStoreVectorNode method writeVector.

@Specialization(guards = "!isAutoDerefHandle(address)")
@ExplodeLoop
protected void writeVector(LLVMNativePointer address, LLVMDoubleVector vector) {
    assert vector.getLength() == getVectorLength();
    LLVMMemory memory = getLanguage().getLLVMMemory();
    long currentPtr = address.asNative();
    for (int i = 0; i < getVectorLength(); i++) {
        memory.putDouble(this, currentPtr, vector.getValue(i));
        currentPtr += DOUBLE_SIZE_IN_BYTES;
    }
}
Also used : LLVMMemory(com.oracle.truffle.llvm.runtime.memory.LLVMMemory) Specialization(com.oracle.truffle.api.dsl.Specialization) ExplodeLoop(com.oracle.truffle.api.nodes.ExplodeLoop)

Example 4 with LLVMMemory

use of com.oracle.truffle.llvm.runtime.memory.LLVMMemory in project graal by oracle.

the class LLVMStoreVectorNode method writeVector.

@Specialization(guards = "!isAutoDerefHandle(address)")
@ExplodeLoop
protected void writeVector(LLVMNativePointer address, LLVMI8Vector vector) {
    assert vector.getLength() == getVectorLength();
    LLVMMemory memory = getLanguage().getLLVMMemory();
    long currentPtr = address.asNative();
    for (int i = 0; i < getVectorLength(); i++) {
        memory.putI8(this, currentPtr, vector.getValue(i));
        currentPtr += I8_SIZE_IN_BYTES;
    }
}
Also used : LLVMMemory(com.oracle.truffle.llvm.runtime.memory.LLVMMemory) Specialization(com.oracle.truffle.api.dsl.Specialization) ExplodeLoop(com.oracle.truffle.api.nodes.ExplodeLoop)

Example 5 with LLVMMemory

use of com.oracle.truffle.llvm.runtime.memory.LLVMMemory in project graal by oracle.

the class LLVMStoreVectorNode method writeVector.

@Specialization(guards = "!isAutoDerefHandle(address)")
@ExplodeLoop
protected void writeVector(LLVMNativePointer address, LLVMI64Vector vector) {
    assert vector.getLength() == getVectorLength();
    LLVMMemory memory = getLanguage().getLLVMMemory();
    long currentPtr = address.asNative();
    for (int i = 0; i < getVectorLength(); i++) {
        memory.putI64(this, currentPtr, vector.getValue(i));
        currentPtr += I64_SIZE_IN_BYTES;
    }
}
Also used : LLVMMemory(com.oracle.truffle.llvm.runtime.memory.LLVMMemory) Specialization(com.oracle.truffle.api.dsl.Specialization) ExplodeLoop(com.oracle.truffle.api.nodes.ExplodeLoop)

Aggregations

LLVMMemory (com.oracle.truffle.llvm.runtime.memory.LLVMMemory)15 Specialization (com.oracle.truffle.api.dsl.Specialization)11 ExplodeLoop (com.oracle.truffle.api.nodes.ExplodeLoop)7 LLVMNativePointer (com.oracle.truffle.llvm.runtime.pointer.LLVMNativePointer)2 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)1 ExportMessage (com.oracle.truffle.api.library.ExportMessage)1 LLVMInternalTruffleObject (com.oracle.truffle.llvm.runtime.interop.LLVMInternalTruffleObject)1