diff options
| author | 2026-03-02 17:52:57 +0100 | |
|---|---|---|
| committer | 2026-03-02 17:52:57 +0100 | |
| commit | f2285400e65dafe730a073b3ca92494d72c7295b (patch) | |
| tree | d5a96f09fbd0402ada3c39165a9d2d8202ee8e5d /endian.h | |
| parent | a498f851ef2f50c9b8ac47e238137af52b54057d (diff) | |
add bswap16/32/64
- frontend: __builtin_bswapX intrinsics
- backend: ObswapX instructions
Diffstat (limited to 'endian.h')
| -rw-r--r-- | endian.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2,6 +2,7 @@ #define ENDIAN_H_ #include "common.h" +extern bool targ_bigendian; /*** Macros and functions for endian specific memory access ***/ @@ -121,7 +122,7 @@ rd32targ(uchar *p) { uint x; memcpy(&x, p, sizeof x); - if (!hostntarg_sameendian()) x = bswap16(x); + if (!hostntarg_sameendian()) x = bswap32(x); return x; } @@ -130,7 +131,7 @@ rd64targ(uchar *p) { uvlong x; memcpy(&x, p, sizeof x); - if (!hostntarg_sameendian()) x = bswap16(x); + if (!hostntarg_sameendian()) x = bswap64(x); return x; } |