[MDEV-21880] Suboptimal implementation of integer load / store InnoDB functions for big-endian architecture Created: 2020-03-06  Updated: 2020-03-06

Status: Open
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Dmitry Shulga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: ARMv8
Environment:

ARM64



 Description   

InnoDB has its own inline functions to load/store integer values from/to memory. These
functions make conversion between a host byte order and the big-endian representation
because the InnoDB on-disk format is big-endian. Unfortunately, implementation of these
functions could be translated by compiler to not optimal assembler code.
The following Godbolt link https://godbolt.org/z/Bvm4hx shows how optimized and
not-optimized functions look like after compiler generated assembler code.

Moreover, implementation of mi_*() macros and inlined functions located in the file
include/myisampack.h and implementation of mach_read_from_, mach_write_to_ functions
from the file storage/innobase/include/mach0data.ic use direct manipulation with bytes array
to store/load integers in big-endian representation instead of isolating such a code in
standalone functions and calling them from functions mentioned above. That leads to code
duplication and code bloating in a server binary.

This bug report is to make optimization of source code for loading/storing integers in
big-endian format and to refactor source code for storing/loading integers in big-endian
format to avoid code duplication.


Generated at Thu Feb 08 09:10:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.