/** * Writes byte to specified pipe * @param pipe to be updated * @param loc for the field to be updated * @param value byte to write to specified location */ public static void writeByte(Pipe pipe, int loc, byte value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] = value; }
/** * Writes byte to specified pipe * @param pipe to be updated * @param loc for the field to be updated * @param value byte to write to specified location */ public static void writeByte(Pipe pipe, int loc, byte value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] = value; }
public static ByteBuffer[] wrappedUnstructuredLayoutBuffer(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); return wrappedUnstructuredLayoutBufferImpl(pipe, pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK & (loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc)); }
/** * Copies int from specified pipe ring to target pipe ring * @param sourceRing to copy from * @param targetRing to copy to * @param sourceLOC location of the int to copy * @param targetLOC location to put the copied int */ public static void copyInt(final Pipe sourceRing, final Pipe targetRing, int sourceLOC, int targetLOC) { assert(LOCUtil.isLocOfAnyType(sourceLOC, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(sourceLOC); assert(LOCUtil.isLocOfAnyType(targetLOC, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(targetLOC); Pipe.slab((Pipe<?>) targetRing)[targetRing.slabMask &((int)targetRing.ringWalker.activeWriteFragmentStack[PipeWriter.STACK_OFF_MASK&(targetLOC>>PipeWriter.STACK_OFF_SHIFT)] + (PipeWriter.OFF_MASK&targetLOC))] = Pipe.slab((Pipe<?>) sourceRing)[sourceRing.slabMask & (int)(sourceRing.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(sourceLOC>>STACK_OFF_SHIFT)]+(OFF_MASK&sourceLOC))]; }
/** * Writes byte to specified pipe * @param pipe to be updated * @param loc for the field to be updated * @param value byte to write to specified location */ public static void writeByte(Pipe pipe, int loc, byte value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] = value; }
/** * Reads the length of bytes at given section of a pipe * @param pipe to read from * @param loc location of bytes to read * @return bytes */ public static int readBytesLength(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); return Pipe.slab(pipe)[pipe.slabMask & (int)(pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc) + 1)];// second int is always the length }
/** * * @param pipe to be updated * @param loc for the field to be updated * @param value to be ORed with the existing data in this position */ public static void accumulateBitsValue(Pipe pipe, int loc, int value) { //allow for all types of int and for length assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] |= value; }
/** * Reads int bits from specified pipe and converts to float * @param pipe to be read * @param loc location of int bits to read * @return float bits converted from int */ public static float readIntBitsToFloat(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); return Float.intBitsToFloat(readInt(pipe,loc)); }
/** * * @param pipe to be updated * @param loc for the field to be updated * @param value to be ORed with the existing data in this position */ public static void accumulateBitsValue(Pipe pipe, int loc, int value) { //allow for all types of int and for length assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] |= value; }
/** * Writes short to specified pipe * @param pipe to be updated * @param loc for the field to be updated * @param value short to write to specified location */ public static void writeShort(Pipe pipe, int loc, short value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] = value; }
/** * Writes short to specified pipe * @param pipe to be updated * @param loc for the field to be updated * @param value short to write to specified location */ public static void writeShort(Pipe pipe, int loc, short value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] = value; }
/** * * @param pipe to be updated * @param loc for the field to be updated * @param value to be ORed with the existing data in this position */ public static void accumulateBitsValue(Pipe pipe, int loc, int value) { //allow for all types of int and for length assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] |= value; }
/** * Writes short to specified pipe * @param pipe to be updated * @param loc for the field to be updated * @param value short to write to specified location */ public static void writeShort(Pipe pipe, int loc, short value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); Pipe.slab(pipe)[pipe.slabMask &((int)pipe.ringWalker.activeWriteFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))] = value; }
/** * * @param pipe to be updated * @param loc for the field to be updated * @param value float to write to specified location */ public static void writeFloatAsIntBits(Pipe pipe, int loc, float value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); writeInt(pipe, loc, Float.floatToIntBits(value)); }
private static int readBytesMeta(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); return Pipe.slab(pipe)[pipe.slabMask & (int)(pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc) )]; }
public static ByteBuffer[] wrappedUnstructuredLayoutBuffer(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); return wrappedUnstructuredLayoutBufferImpl(pipe, pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK & (loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc)); }
/** * Writes double to specified pipe as long bits * @param pipe to write to * @param loc location to write to * @param value double to be converted */ public static void writeDoubleAsLongBits(Pipe pipe, int loc, double value) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.LongSigned, TypeMask.LongSignedOptional, TypeMask.LongUnsigned, TypeMask.LongUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); writeLong(pipe, loc, Double.doubleToLongBits(value)); } //<<OFF_BITS
/** * Reads int bits from specified pipe and converts to float * @param pipe to be read * @param loc location of int bits to read * @return float bits converted from int */ public static float readIntBitsToFloat(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional)): "Value found "+LOCUtil.typeAsString(loc); return Float.intBitsToFloat(readInt(pipe,loc)); }
private static int readBytesMeta(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); return Pipe.slab(pipe)[pipe.slabMask & (int)(pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc) )]; }
public static ByteBuffer[] wrappedUnstructuredLayoutBuffer(Pipe pipe, int loc) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); return wrappedUnstructuredLayoutBufferImpl(pipe, pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK & (loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc)); }