.. default-domain:: chpl .. module:: Intrin Intrin ====== **Usage** .. code-block:: chapel use Intrin; or .. code-block:: chapel import Intrin; .. function:: proc isX8664() param: bool .. function:: proc isArm64() param: bool .. function:: proc vectorType(type eltType, param numElts: int) type .. function:: proc implType(type eltType, param numElts: int) type .. function:: proc extract(type eltType, param numElts: int, x: vectorType(eltType, numElts), param idx: int): eltType idx 0 is the least significant element .. function:: proc insert(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: eltType, param idx: int): x.type idx 0 is the least significant element .. function:: proc splat(type eltType, param numElts: int, x: eltType): vectorType(eltType, numElts) .. function:: proc set(type eltType, param numElts: int, values: numElts*eltType): vectorType(eltType, numElts) values(0) is the least significant element .. function:: proc loadAligned(type eltType, param numElts: int, ptr: c_ptrConst(eltType)): vectorType(eltType, numElts) .. function:: proc loadUnaligned(type eltType, param numElts: int, ptr: c_ptrConst(eltType)): vectorType(eltType, numElts) .. function:: proc storeAligned(type eltType, param numElts: int, ptr: c_ptr(eltType), x: vectorType(eltType, numElts)) .. function:: proc storeUnaligned(type eltType, param numElts: int, ptr: c_ptr(eltType), x: vectorType(eltType, numElts)) .. function:: proc loadMasked(type eltType, param numElts: int, ptr: c_ptrConst(eltType), mask: ?): vectorType(eltType, numElts) Load with a mask masked out elements are zeroed out only the most significant bit in each vector lane is considered for the mask .. function:: proc gather(type eltType, param numElts: int, ptr: c_ptrConst(eltType), type indexType, indices: ?, param scale: int): vectorType(eltType, numElts) .. function:: proc gatherMasked(type eltType, param numElts: int, ptr: c_ptrConst(eltType), type indexType, indices: ?, param scale: int, mask: ?, src: vectorType(eltType, numElts)): vectorType(eltType, numElts) .. function:: proc swapPairs(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc swapLowHigh(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc reverse(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc rotateLeft(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc rotateRight(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc interleaveLower(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc interleaveUpper(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc deinterleaveLower(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc deinterleaveUpper(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc blendLowHigh(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc add(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc sub(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc mul(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc div(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc neg(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc and(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc or(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc xor(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc not(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc andNot(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc cmpEq(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc cmpNe(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc cmpLt(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc cmpLe(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc cmpGt(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc cmpGe(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc bitSelect(type eltType, param numElts: int, mask: ?, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc isAllZeros(type eltType, param numElts: int, x: vectorType(eltType, numElts)): bool .. function:: proc allOnes(type eltType, param numElts: int): vectorType(eltType, numElts) .. function:: proc allZeros(type eltType, param numElts: int): vectorType(eltType, numElts) .. function:: proc moveMask(type eltType, param numElts: int, x: vectorType(eltType, numElts)): c_int .. function:: proc reinterpretCast(type fromEltType, param fromNumElts: int, type toEltType, param toNumElts: int, x: vectorType(fromEltType, fromNumElts)): vectorType(toEltType, toNumElts) .. function:: proc hadd(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type Add pairs of adjacent elements x: [a, b, c, d] y: [e, f, g, h] returns: [a+b, e+f, c+d, g+h] .. function:: proc sqrt(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc rsqrt(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type .. function:: proc fmadd(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type, z: x.type): x.type Performs (x*y)+z .. function:: proc fmsub(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type, z: x.type): x.type Performs (x*y)-z .. function:: proc min(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc max(type eltType, param numElts: int, x: vectorType(eltType, numElts), y: x.type): x.type .. function:: proc abs(type eltType, param numElts: int, x: vectorType(eltType, numElts)): x.type