Skip to content

Commit

Permalink
[GR-23843] Support a LLVMPointerVector argument for LLVMSignedCastToI…
Browse files Browse the repository at this point in the history
…64VectorNode.

PullRequest: graal/8200
  • Loading branch information
eregon committed Feb 5, 2021
2 parents 5ab2a1d + f01afae commit 9d139ce
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates.
* Copyright (c) 2017, 2021, Oracle and/or its affiliates.
*
* All rights reserved.
*
Expand Down Expand Up @@ -29,12 +29,14 @@
*/
package com.oracle.truffle.llvm.runtime.nodes.cast;

import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.NodeField;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.llvm.runtime.floating.LLVM80BitFloat;
import com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode;
import com.oracle.truffle.llvm.runtime.nodes.api.LLVMToNativeNode;
import com.oracle.truffle.llvm.runtime.pointer.LLVMNativePointer;
import com.oracle.truffle.llvm.runtime.pointer.LLVMPointer;
import com.oracle.truffle.llvm.runtime.vector.LLVMDoubleVector;
Expand Down Expand Up @@ -436,6 +438,18 @@ protected LLVMI64Vector doDouble(LLVMDoubleVector from) {
}
return LLVMI64Vector.create(vector);
}

@Specialization
@ExplodeLoop
protected LLVMI64Vector doPointer(LLVMPointerVector from,
@Cached LLVMToNativeNode toNativeNode) {
assert from.getLength() == getVectorLength();
final long[] vector = new long[getVectorLength()];
for (int i = 0; i < getVectorLength(); i++) {
vector[i] = toNativeNode.executeWithTarget(from.getValue(i)).asNative();
}
return LLVMI64Vector.create(vector);
}
}

public abstract static class LLVMSignedCastToFloatVectorNode extends LLVMToVectorNode {
Expand Down

0 comments on commit 9d139ce

Please sign in to comment.