public class Simd

  1. Object
  2. Simd
Portable SIMD API with Java fallback implementations.

Constructors

public Simd()

Methods

public static Simd get()Returns the singleton instance of the Simd class.
public boolean isSupported()Returns true if SIMD instructions are natively supported if this returns false the APIs in this class would still work using fallback loop code
public boolean isByteShuffleAccelerated()Returns true when chained, fine-grained byte shuffle/interleave pipelines (as the Base64 SIMD codec uses: unpack/pack interleaved, byte shifts, table lookups) are hardware-accelerated AND actually beat the compiler’s autovectorized scalar code.
public byte[] allocByte(int size)Allocates an aligned memory block for efficient SIMD operations.
public int[] allocInt(int size)Allocates an aligned memory block for efficient SIMD operations.
public float[] allocFloat(int size)Allocates an aligned memory block for efficient SIMD operations.
public byte[] allocaByte(int size)Deprecated
public int[] allocaInt(int size)Deprecated
public float[] allocaFloat(int size)Deprecated
public byte[] allocaByteZeroed(int size)Special scratch-allocation API that guarantees a zero-initialized byte array while retaining the same method-local constraints as allocaByte(int).
public int[] allocaIntZeroed(int size)Special scratch-allocation API that guarantees a zero-initialized int array while retaining the same method-local constraints as allocaInt(int).
public float[] allocaFloatZeroed(int size)Special scratch-allocation API that guarantees a zero-initialized float array while retaining the same method-local constraints as allocaFloat(int).
public byte[] allocaByteFilled(int size, byte value)Special scratch-allocation API that guarantees every byte starts with the same value while retaining the same method-local constraints as allocaByte(int).
public int[] allocaIntFilled(int size, int value)Special scratch-allocation API that guarantees every int starts with the same value while retaining the same method-local constraints as allocaInt(int).
public float[] allocaFloatFilled(int size, float value)Special scratch-allocation API that guarantees every float starts with the same value while retaining the same method-local constraints as allocaFloat(int).
public void lookupBytes(byte[] table, byte[] indices, byte[] dst, int offset, int length)Looks up values from a table using unsigned byte indices.
public void lookupBytes(byte[] table, byte[] indices, int indicesOffset, byte[] dst, int dstOffset, int length)Looks up values from a table using unsigned byte indices.
public void and(byte[] srcA, int srcAOffset, byte[] srcB, int srcBOffset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void or(byte[] srcA, int srcAOffset, byte[] srcB, int srcBOffset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shl(byte[] src, int srcOffset, int bits, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shrLogical(byte[] src, int srcOffset, int bits, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackBytesInterleaved3(byte[] src, int srcOffset, byte[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void add(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void sub(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void mul(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void min(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void max(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void abs(byte[] src, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void clamp(byte[] src, byte[] dst, byte minValue, byte maxValue, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void and(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void or(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void xor(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void not(byte[] src, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpEq(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpEq(byte[] src, byte value, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpLt(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpLt(byte[] src, byte value, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpGt(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpRange(byte[] src, byte minValue, byte maxValue, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void select(byte[] mask, byte[] trueValues, byte[] falseValues, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shl(byte[] src, int bits, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shrLogical(byte[] src, int bits, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void addWrapping(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void addWrapping(byte[] src, byte value, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void subWrapping(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void subWrapping(byte[] src, byte value, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackUnsignedByteToInt(byte[] src, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackUnsignedByteToInt(byte[] src, int srcOffset, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackUnsignedByteToIntInterleaved3(byte[] src, int srcOffset, int[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackBytesInterleaved3(byte[] src, int srcOffset, byte[] dst0, byte[] dst1, byte[] dst2, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackBytesInterleaved4(byte[] src, int srcOffset, byte[] dst0, byte[] dst1, byte[] dst2, byte[] dst3, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void unpackBytesInterleaved4(byte[] src, int srcOffset, byte[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int dst3Offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public int unpackLookupBytesInterleaved4(byte[] table, byte[] src, int srcOffset, byte[] dst0, byte[] dst1, byte[] dst2, byte[] dst3, int length)Unpacks interleaved bytes, looks each byte up in the provided table, stores the looked-up values into separate lane arrays, and returns the bitwise OR of all written values.
public int unpackLookupBytesInterleaved4(byte[] table, byte[] src, int srcOffset, byte[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int dst3Offset, int length)Unpacks interleaved bytes, looks each byte up in the provided table, stores the looked-up values into virtual lane ranges in a destination array, and returns the bitwise OR of all written values.
public void packIntToByteSaturating(int[] src, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packIntToByteTruncate(int[] src, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packIntToByteTruncate(int[] src, int srcOffset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packIntToByteTruncateInterleaved4(int[] src, int src0Offset, int src1Offset, int src2Offset, int src3Offset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packBytesInterleaved3(byte[] src0, byte[] src1, byte[] src2, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packBytesInterleaved3(byte[] src, int src0Offset, int src1Offset, int src2Offset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packBytesInterleaved4(byte[] src0, byte[] src1, byte[] src2, byte[] src3, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void packBytesInterleaved4(byte[] src, int src0Offset, int src1Offset, int src2Offset, int src3Offset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void permuteBytes(byte[] src, byte[] indices, byte[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void add(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void add(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void sub(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void mul(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void min(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void max(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void abs(int[] src, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void clamp(int[] src, int[] dst, int minValue, int maxValue, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void and(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void and(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void or(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void or(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void xor(int[] srcA, int[] srcB, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void not(int[] src, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shl(int[] src, int bits, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shl(int[] src, int srcOffset, int bits, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shrLogical(int[] src, int bits, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shrLogical(int[] src, int srcOffset, int bits, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void shrArithmetic(int[] src, int bits, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpEq(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpEq(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, byte[] dstMask, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpLt(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpLt(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, byte[] dstMask, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpGt(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void select(byte[] mask, int[] trueValues, int[] falseValues, int[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void select(byte[] mask, int maskOffset, int[] trueValues, int trueOffset, int[] falseValues, int falseOffset, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public int sum(int[] src, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public int dot(int[] srcA, int[] srcB, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void add(float[] srcA, float[] srcB, float[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void sub(float[] srcA, float[] srcB, float[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void mul(float[] srcA, float[] srcB, float[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void min(float[] srcA, float[] srcB, float[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void max(float[] srcA, float[] srcB, float[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void abs(float[] src, float[] dst, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void clamp(float[] src, float[] dst, float minValue, float maxValue, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public float sum(float[] src, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public float dot(float[] srcA, float[] srcB, int offset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void and(int[] src, int srcOffset, int constant, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void or(int[] src, int srcOffset, int constant, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void xor(int[] src, int srcOffset, int constant, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpEq(int[] src, int srcOffset, int constant, byte[] dstMask, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpLt(int[] src, int srcOffset, int constant, byte[] dstMask, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void cmpGt(int[] src, int srcOffset, int constant, byte[] dstMask, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void not(byte[] src, int srcOffset, byte[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void select(byte[] mask, int maskOffset, int trueConstant, int falseConstant, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void select(byte[] mask, int maskOffset, int[] trueValues, int trueOffset, int falseConstant, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void select(byte[] mask, int maskOffset, int trueConstant, int[] falseValues, int falseOffset, int[] dst, int dstOffset, int length)Exposes SIMD APIs directly all arrays MUST be aligned arrays
public void blendByMaskTestNonzero(int[] src, int srcOffset, int testMask, int trueKeepMask, int trueOrValue, int[] dst, int dstOffset, int length)Fused single-pass conditional bit-blend driven by a masked-non-zero test of src against testMask.
public void blendByMaskTestNonzeroSubstituteOnKeepEq(int[] src, int srcOffset, int testMask, int trueKeepMask, int trueOrValue, int removeMatch, int removeValue, int[] dst, int dstOffset, int length)Fused single-pass extension of blendByMaskTestNonzero that additionally substitutes removeValue whenever the post-mask result would equal removeMatch.
public void replaceTopByteFromUnsignedBytes(int[] rgbSrc, int rgbSrcOffset, byte[] alphaSrc, int alphaSrcOffset, int[] dst, int dstOffset, int length)Fused single-pass replacement of the top byte of every int in rgbSrc with the corresponding unsigned byte from alphaSrc.
protected final void validateBinaryByte(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateMaskBinaryByte(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateRangeMaskByte(byte[] src, byte[] dstMask, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateSelectByte(byte[] mask, byte[] trueValues, byte[] falseValues, byte[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateByteToInt(byte[] src, int[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateIntToByte(int[] src, byte[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validatePermuteByte(byte[] src, byte[] indices, byte[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateUnaryByte(byte[] src, byte[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateBinaryInt(int[] srcA, int[] srcB, int[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateUnaryInt(int[] src, int[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateMaskBinaryInt(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateSelectInt(byte[] mask, int[] trueValues, int[] falseValues, int[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateReductionInt(int[] src, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateDotInt(int[] srcA, int[] srcB, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateBinaryFloat(float[] srcA, float[] srcB, float[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateUnaryFloat(float[] src, float[] dst, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateReductionFloat(float[] src, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateDotFloat(float[] srcA, float[] srcB, int offset, int length)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateNotNull(Object o, String name)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.
protected final void validateRange(int arrayLength, int offset, int length, String name)This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

Inherited methods

Constructor details

Simd

public Simd()

Method details

get

public static Simd get()
Returns the singleton instance of the Simd class. Equivalent to CN.getSimd();

isSupported

public boolean isSupported()
Returns true if SIMD instructions are natively supported if this returns false the APIs in this class would still work using fallback loop code

isByteShuffleAccelerated

public boolean isByteShuffleAccelerated()
Returns true when chained, fine-grained byte shuffle/interleave pipelines (as the Base64 SIMD codec uses: unpack/pack interleaved, byte shifts, table lookups) are hardware-accelerated AND actually beat the compiler’s autovectorized scalar code. NEON platforms (iOS, Windows-on-Arm) return true – there the explicit codec is dramatically faster even at -O2. x86-64 returns false: its /O2 autovectorizer already matches the scalar path and SSE2 has no 3-way interleave, so the codec should stay scalar there. This is distinct from isSupported() – the fused whole-array image ops (alpha/mask blends) win on every platform and are gated on isSupported(), not on this flag. Defaults to false (the generic scalar Simd).

allocByte

public byte[] allocByte(int size)
Allocates an aligned memory block for efficient SIMD operations. All operations MUST be performed on aligned arrays and shouldn’t use arrays created with new. Operations on unaligned arrays might produce undefined results.

allocInt

public int[] allocInt(int size)
Allocates an aligned memory block for efficient SIMD operations. All operations MUST be performed on aligned arrays and shouldn’t use arrays created with new. Operations on unaligned arrays might produce undefined results.

allocFloat

public float[] allocFloat(int size)
Allocates an aligned memory block for efficient SIMD operations. All operations MUST be performed on aligned arrays and shouldn’t use arrays created with new. Operations on unaligned arrays might produce undefined results.

allocaByte

public byte[] allocaByte(int size)
Deprecated. This is a special scratch-allocation API. On ParparVM this may be lowered to a stack-backed faux array, so callers MUST keep it method-local, MUST be extremely cautious when using it, and MUST treat its contents as undefined until written. Use allocByte(int) for heap-backed arrays. The ParparVM lowering automatically falls back to a heap allocation when the requested size would not fit safely on the per-thread stack, so this API is safe to call with image-scale sizes - but using allocByte(int) directly is preferred when the size is known to be large.

allocaInt

public int[] allocaInt(int size)
Deprecated. This is a special scratch-allocation API. On ParparVM this may be lowered to a stack-backed faux array, so callers MUST keep it method-local, MUST be extremely cautious when using it, and MUST treat its contents as undefined until written. Use allocInt(int) for heap-backed arrays. The ParparVM lowering automatically falls back to a heap allocation when the requested size would not fit safely on the per-thread stack, so this API is safe to call with image-scale sizes - but using allocInt(int) directly is preferred when the size is known to be large.

allocaFloat

public float[] allocaFloat(int size)
Deprecated. This is a special scratch-allocation API. On ParparVM this may be lowered to a stack-backed faux array, so callers MUST keep it method-local, MUST be extremely cautious when using it, and MUST treat its contents as undefined until written. Use allocFloat(int) for heap-backed arrays. The ParparVM lowering automatically falls back to a heap allocation when the requested size would not fit safely on the per-thread stack, so this API is safe to call with image-scale sizes - but using allocFloat(int) directly is preferred when the size is known to be large.

allocaByteZeroed

public byte[] allocaByteZeroed(int size)
Special scratch-allocation API that guarantees a zero-initialized byte array while retaining the same method-local constraints as allocaByte(int).

allocaIntZeroed

public int[] allocaIntZeroed(int size)
Special scratch-allocation API that guarantees a zero-initialized int array while retaining the same method-local constraints as allocaInt(int).

allocaFloatZeroed

public float[] allocaFloatZeroed(int size)
Special scratch-allocation API that guarantees a zero-initialized float array while retaining the same method-local constraints as allocaFloat(int).

allocaByteFilled

public byte[] allocaByteFilled(int size, byte value)
Special scratch-allocation API that guarantees every byte starts with the same value while retaining the same method-local constraints as allocaByte(int).

allocaIntFilled

public int[] allocaIntFilled(int size, int value)
Special scratch-allocation API that guarantees every int starts with the same value while retaining the same method-local constraints as allocaInt(int).

allocaFloatFilled

public float[] allocaFloatFilled(int size, float value)
Special scratch-allocation API that guarantees every float starts with the same value while retaining the same method-local constraints as allocaFloat(int).

lookupBytes

public void lookupBytes(byte[] table, byte[] indices, byte[] dst, int offset, int length)
Looks up values from a table using unsigned byte indices.

lookupBytes

public void lookupBytes(byte[] table, byte[] indices, int indicesOffset, byte[] dst, int dstOffset, int length)
Looks up values from a table using unsigned byte indices.

and

public void and(byte[] srcA, int srcAOffset, byte[] srcB, int srcBOffset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

or

public void or(byte[] srcA, int srcAOffset, byte[] srcB, int srcBOffset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shl

public void shl(byte[] src, int srcOffset, int bits, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shrLogical

public void shrLogical(byte[] src, int srcOffset, int bits, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackBytesInterleaved3

public void unpackBytesInterleaved3(byte[] src, int srcOffset, byte[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

add

public void add(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

sub

public void sub(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

mul

public void mul(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

min

public void min(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

max

public void max(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

abs

public void abs(byte[] src, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

clamp

public void clamp(byte[] src, byte[] dst, byte minValue, byte maxValue, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

and

public void and(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

or

public void or(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

xor

public void xor(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

not

public void not(byte[] src, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpEq

public void cmpEq(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpEq

public void cmpEq(byte[] src, byte value, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpLt

public void cmpLt(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpLt

public void cmpLt(byte[] src, byte value, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpGt

public void cmpGt(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpRange

public void cmpRange(byte[] src, byte minValue, byte maxValue, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

select

public void select(byte[] mask, byte[] trueValues, byte[] falseValues, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shl

public void shl(byte[] src, int bits, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shrLogical

public void shrLogical(byte[] src, int bits, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

addWrapping

public void addWrapping(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

addWrapping

public void addWrapping(byte[] src, byte value, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

subWrapping

public void subWrapping(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

subWrapping

public void subWrapping(byte[] src, byte value, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackUnsignedByteToInt

public void unpackUnsignedByteToInt(byte[] src, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackUnsignedByteToInt

public void unpackUnsignedByteToInt(byte[] src, int srcOffset, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackUnsignedByteToIntInterleaved3

public void unpackUnsignedByteToIntInterleaved3(byte[] src, int srcOffset, int[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackBytesInterleaved3

public void unpackBytesInterleaved3(byte[] src, int srcOffset, byte[] dst0, byte[] dst1, byte[] dst2, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackBytesInterleaved4

public void unpackBytesInterleaved4(byte[] src, int srcOffset, byte[] dst0, byte[] dst1, byte[] dst2, byte[] dst3, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackBytesInterleaved4

public void unpackBytesInterleaved4(byte[] src, int srcOffset, byte[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int dst3Offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

unpackLookupBytesInterleaved4

public int unpackLookupBytesInterleaved4(byte[] table, byte[] src, int srcOffset, byte[] dst0, byte[] dst1, byte[] dst2, byte[] dst3, int length)
Unpacks interleaved bytes, looks each byte up in the provided table, stores the looked-up values into separate lane arrays, and returns the bitwise OR of all written values.

unpackLookupBytesInterleaved4

public int unpackLookupBytesInterleaved4(byte[] table, byte[] src, int srcOffset, byte[] dst, int dst0Offset, int dst1Offset, int dst2Offset, int dst3Offset, int length)
Unpacks interleaved bytes, looks each byte up in the provided table, stores the looked-up values into virtual lane ranges in a destination array, and returns the bitwise OR of all written values.

packIntToByteSaturating

public void packIntToByteSaturating(int[] src, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packIntToByteTruncate

public void packIntToByteTruncate(int[] src, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packIntToByteTruncate

public void packIntToByteTruncate(int[] src, int srcOffset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packIntToByteTruncateInterleaved4

public void packIntToByteTruncateInterleaved4(int[] src, int src0Offset, int src1Offset, int src2Offset, int src3Offset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packBytesInterleaved3

public void packBytesInterleaved3(byte[] src0, byte[] src1, byte[] src2, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packBytesInterleaved3

public void packBytesInterleaved3(byte[] src, int src0Offset, int src1Offset, int src2Offset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packBytesInterleaved4

public void packBytesInterleaved4(byte[] src0, byte[] src1, byte[] src2, byte[] src3, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

packBytesInterleaved4

public void packBytesInterleaved4(byte[] src, int src0Offset, int src1Offset, int src2Offset, int src3Offset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

permuteBytes

public void permuteBytes(byte[] src, byte[] indices, byte[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

add

public void add(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

add

public void add(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

sub

public void sub(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

mul

public void mul(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

min

public void min(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

max

public void max(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

abs

public void abs(int[] src, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

clamp

public void clamp(int[] src, int[] dst, int minValue, int maxValue, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

and

public void and(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

and

public void and(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

or

public void or(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

or

public void or(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

xor

public void xor(int[] srcA, int[] srcB, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

not

public void not(int[] src, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shl

public void shl(int[] src, int bits, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shl

public void shl(int[] src, int srcOffset, int bits, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shrLogical

public void shrLogical(int[] src, int bits, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shrLogical

public void shrLogical(int[] src, int srcOffset, int bits, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

shrArithmetic

public void shrArithmetic(int[] src, int bits, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpEq

public void cmpEq(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpEq

public void cmpEq(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, byte[] dstMask, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpLt

public void cmpLt(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpLt

public void cmpLt(int[] srcA, int srcAOffset, int[] srcB, int srcBOffset, byte[] dstMask, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpGt

public void cmpGt(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

select

public void select(byte[] mask, int[] trueValues, int[] falseValues, int[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

select

public void select(byte[] mask, int maskOffset, int[] trueValues, int trueOffset, int[] falseValues, int falseOffset, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

sum

public int sum(int[] src, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

dot

public int dot(int[] srcA, int[] srcB, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

add

public void add(float[] srcA, float[] srcB, float[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

sub

public void sub(float[] srcA, float[] srcB, float[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

mul

public void mul(float[] srcA, float[] srcB, float[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

min

public void min(float[] srcA, float[] srcB, float[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

max

public void max(float[] srcA, float[] srcB, float[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

abs

public void abs(float[] src, float[] dst, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

clamp

public void clamp(float[] src, float[] dst, float minValue, float maxValue, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

sum

public float sum(float[] src, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

dot

public float dot(float[] srcA, float[] srcB, int offset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

and

public void and(int[] src, int srcOffset, int constant, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

or

public void or(int[] src, int srcOffset, int constant, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

xor

public void xor(int[] src, int srcOffset, int constant, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpEq

public void cmpEq(int[] src, int srcOffset, int constant, byte[] dstMask, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpLt

public void cmpLt(int[] src, int srcOffset, int constant, byte[] dstMask, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

cmpGt

public void cmpGt(int[] src, int srcOffset, int constant, byte[] dstMask, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

not

public void not(byte[] src, int srcOffset, byte[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

select

public void select(byte[] mask, int maskOffset, int trueConstant, int falseConstant, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

select

public void select(byte[] mask, int maskOffset, int[] trueValues, int trueOffset, int falseConstant, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

select

public void select(byte[] mask, int maskOffset, int trueConstant, int[] falseValues, int falseOffset, int[] dst, int dstOffset, int length)
Exposes SIMD APIs directly all arrays MUST be aligned arrays

blendByMaskTestNonzero

public void blendByMaskTestNonzero(int[] src, int srcOffset, int testMask, int trueKeepMask, int trueOrValue, int[] dst, int dstOffset, int length)

Fused single-pass conditional bit-blend driven by a masked-non-zero test of src against testMask. For every element:

dst[i] = (src[i] & testMask) != 0 ? (src[i] & trueKeepMask) | trueOrValue : src[i]

This collapses a “test-then-modify-or-keep-source” pattern that would otherwise require three or more separate primitive calls (and three or more passes over src) into a single pass. It maps directly to one NEON / SSE vector loop on platforms that ship a vectorized implementation. All arrays MUST be aligned/registered arrays.

blendByMaskTestNonzeroSubstituteOnKeepEq

public void blendByMaskTestNonzeroSubstituteOnKeepEq(int[] src, int srcOffset, int testMask, int trueKeepMask, int trueOrValue, int removeMatch, int removeValue, int[] dst, int dstOffset, int length)

Fused single-pass extension of blendByMaskTestNonzero that additionally substitutes removeValue whenever the post-mask result would equal removeMatch. For every element:

v = src[i]
if ((v & testMask) == 0)            dst[i] = v
else if ((v & trueKeepMask) == removeMatch) dst[i] = removeValue
else                                dst[i] = (v & trueKeepMask) | trueOrValue

This collapses a blendByMaskTestNonzero + cmpEq + select chain (three passes over the buffer plus two scratch allocations) into a single vector pass. It maps to one NEON / SSE loop on platforms that ship a vectorized implementation. All arrays MUST be aligned / registered arrays.

replaceTopByteFromUnsignedBytes

public void replaceTopByteFromUnsignedBytes(int[] rgbSrc, int rgbSrcOffset, byte[] alphaSrc, int alphaSrcOffset, int[] dst, int dstOffset, int length)

Fused single-pass replacement of the top byte of every int in rgbSrc with the corresponding unsigned byte from alphaSrc. For every element:

dst[i] = (rgbSrc[i] & 0x00ffffff) | ((alphaSrc[i] & 0xff) << 24)

Designed for the Image.applyMask hot path, which previously required four separate primitive calls (unpackUnsignedByteToInt, shl, and, or) and two scratch allocations. Maps to a single NEON / SSE vector loop (vmovl_u8 => vshlq_n_u32(24) => vorrq(vandq, ...)) on platforms that ship a vectorized implementation. All arrays MUST be aligned / registered arrays.

validateBinaryByte

protected final void validateBinaryByte(byte[] srcA, byte[] srcB, byte[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateMaskBinaryByte

protected final void validateMaskBinaryByte(byte[] srcA, byte[] srcB, byte[] dstMask, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateRangeMaskByte

protected final void validateRangeMaskByte(byte[] src, byte[] dstMask, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateSelectByte

protected final void validateSelectByte(byte[] mask, byte[] trueValues, byte[] falseValues, byte[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateByteToInt

protected final void validateByteToInt(byte[] src, int[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateIntToByte

protected final void validateIntToByte(int[] src, byte[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validatePermuteByte

protected final void validatePermuteByte(byte[] src, byte[] indices, byte[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateUnaryByte

protected final void validateUnaryByte(byte[] src, byte[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateBinaryInt

protected final void validateBinaryInt(int[] srcA, int[] srcB, int[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateUnaryInt

protected final void validateUnaryInt(int[] src, int[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateMaskBinaryInt

protected final void validateMaskBinaryInt(int[] srcA, int[] srcB, byte[] dstMask, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateSelectInt

protected final void validateSelectInt(byte[] mask, int[] trueValues, int[] falseValues, int[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateReductionInt

protected final void validateReductionInt(int[] src, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateDotInt

protected final void validateDotInt(int[] srcA, int[] srcB, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateBinaryFloat

protected final void validateBinaryFloat(float[] srcA, float[] srcB, float[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateUnaryFloat

protected final void validateUnaryFloat(float[] src, float[] dst, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateReductionFloat

protected final void validateReductionFloat(float[] src, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateDotFloat

protected final void validateDotFloat(float[] srcA, float[] srcB, int offset, int length)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateNotNull

protected final void validateNotNull(Object o, String name)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.

validateRange

protected final void validateRange(int arrayLength, int offset, int length, String name)
This API is used internally to verify valid array arguments in the simulator notice that no validation occurs on the devices.