Bug #64304 | assemble to implement procedure of transforming between big-end and little-end | ||
---|---|---|---|
Submitted: | 12 Feb 2012 17:04 | Modified: | 12 Feb 2012 19:57 |
Reporter: | xiaobin lin (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S5 (Performance) |
Version: | 5.5 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | assemble, big-end, Contribution, little-end |
[12 Feb 2012 17:04]
xiaobin lin
[12 Feb 2012 17:06]
xiaobin lin
It is based on 5.5.22. bzr revno: 3694
Attachment: swap_int_assemble.patch (application/octet-stream, text), 2.51 KiB.
[12 Feb 2012 19:57]
Valeriy Kravchuk
Thank you for the patch contributed.
[14 Feb 2012 14:17]
Marko Mäkelä
In GCC, there are built-in functions for these. On Windows x86 and x86-64, we might have to use asm, but the GCC builtins should work on all target platforms according to the documentation. int32_t __builtin_bswap32 (int32_t x) int64_t __builtin_bswap64 (int64_t x) Note that these are only to be used on little-endian platforms. On big-endian platforms, any byte order conversion must be skipped.