Skip to content
Snippets Groups Projects
Commit 90bc007f authored by Florian Angerer's avatar Florian Angerer
Browse files

Fix: missing specialization in CastDoubleNode.

parent 4f5fa3a5
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,6 @@ import com.oracle.truffle.r.runtime.RType; ...@@ -37,7 +37,6 @@ import com.oracle.truffle.r.runtime.RType;
import com.oracle.truffle.r.runtime.data.RComplex; import com.oracle.truffle.r.runtime.data.RComplex;
import com.oracle.truffle.r.runtime.data.RComplexVector; import com.oracle.truffle.r.runtime.data.RComplexVector;
import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RDataFactory;
import com.oracle.truffle.r.runtime.data.RDoubleSequence;
import com.oracle.truffle.r.runtime.data.RDoubleVector; import com.oracle.truffle.r.runtime.data.RDoubleVector;
import com.oracle.truffle.r.runtime.data.RList; import com.oracle.truffle.r.runtime.data.RList;
import com.oracle.truffle.r.runtime.data.RRawVector; import com.oracle.truffle.r.runtime.data.RRawVector;
...@@ -164,13 +163,7 @@ public abstract class CastDoubleNode extends CastDoubleBaseNode { ...@@ -164,13 +163,7 @@ public abstract class CastDoubleNode extends CastDoubleBaseNode {
} }
@Specialization @Specialization
protected RDoubleVector doDoubleVector(RDoubleVector operand) { protected RAbstractDoubleVector doDoubleVector(RAbstractDoubleVector operand) {
return operand;
}
@Specialization
protected RDoubleSequence doDoubleVector(RDoubleSequence operand) {
// sequence does not have attributes - nothing to copy or drop
return operand; return operand;
} }
......
...@@ -166,14 +166,13 @@ public abstract class CastIntegerNode extends CastIntegerBaseNode { ...@@ -166,14 +166,13 @@ public abstract class CastIntegerNode extends CastIntegerBaseNode {
} }
@Specialization @Specialization
protected RIntVector doDoubleVector(RAbstractDoubleVector operand) { protected RAbstractIntVector doDoubleVector(RAbstractDoubleVector operand) {
naCheck.enable(operand); return castWithReuse(operand, index -> naCheck.convertDoubleToInt(operand.getDataAt(index)));
return vectorCopy(operand, naCheck.convertDoubleVectorToIntData(operand), naCheck.neverSeenNA());
} }
@Specialization @Specialization
protected RIntVector doRawVector(RAbstractRawVector operand) { protected RAbstractIntVector doRawVector(RAbstractRawVector operand) {
return createResultVector(operand, index -> RRuntime.raw2int(operand.getDataAt(index))); return castWithReuse(operand, index -> RRuntime.raw2int(operand.getDataAt(index)));
} }
@Specialization @Specialization
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment