Skip to content
TO_LITTLE_ENDIAN8

TO_LITTLE_ENDIAN8

Description

Conditionally converts value from native byte order to little-endian. On big-endian systems, this inverts the byte order. On little-endian systems, this is a no-op.

Parameters

Name Direction Description
x in 64-bit value in native byte order

Success

Returns value in little-endian format.

Failure

Function cannot fail - pure bitwise operation.

Usage example (Cross-references)

Usage examples (Cross-references)
        if (k == 8u) {
            // Whole limb in bounds: one little-endian store instead of a byte loop.
            u64 le = TO_LITTLE_ENDIAN8(value);
            MemCopy(data + off, &le, 8u);
        } else {
Last updated on