TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
#include <trlc/platform/architecture.hpp>
Static Public Member Functions | |
static bool | is64Bit () const |
Checks if the architecture is 64-bit. More... | |
static bool | is32Bit () const |
Checks if the architecture is 32-bit. More... | |
static bool | isLittleEndian () const |
Checks if the architecture uses little-endian byte order. More... | |
static bool | supportsUnalignedAccess () const |
Checks if the architecture supports unaligned memory access. More... | |
static bool | hasSimdSupport () const |
Checks if the architecture supports SIMD instructions. More... | |
static bool | isARM () const |
Checks if the architecture is ARM-based. More... | |
static bool | isX86 () const |
Checks if the architecture is x86-based. More... | |
Public Attributes | |
CpuArchitecture | architecture |
Detected CPU architecture type. More... | |
ByteOrder | byte_order |
Detected byte order (endianness) More... | |
int | pointer_size_bits |
Pointer size in bits (32 or 64) More... | |
size_t | cache_line_size |
Typical cache line size in bytes. More... | |
const char * | arch_name |
Human-readable architecture name. More... | |
Definition at line 165 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture supports SIMD instructions.
Determines whether the target architecture has Single Instruction, Multiple Data (SIMD) capabilities for parallel processing. This enables vectorized algorithms and optimizations.
Definition at line 265 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture is 32-bit.
Determines whether the target architecture uses 32-bit pointers and address space. This is important for embedded systems and legacy platform compatibility.
Definition at line 200 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture is 64-bit.
Determines whether the target architecture uses 64-bit pointers and address space. This is useful for selecting architecture-specific optimizations and determining memory layout constraints.
Definition at line 185 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture is ARM-based.
Determines whether the target architecture belongs to the ARM family. This is useful for ARM-specific optimizations and feature detection.
Definition at line 289 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture uses little-endian byte order.
Determines the byte ordering used by the target architecture. Little-endian systems store the least significant byte first, which is common on x86/x64 and most ARM systems.
Definition at line 214 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture is x86-based.
Determines whether the target architecture belongs to the Intel x86 family. This includes both 32-bit x86 and 64-bit x86_64 (AMD64) architectures.
Definition at line 310 of file architecture.hpp.
|
inlinestatic |
Checks if the architecture supports unaligned memory access.
Determines whether the target architecture can efficiently handle memory accesses that are not aligned to natural boundaries. This affects memory access patterns and data structure layout decisions.
Definition at line 238 of file architecture.hpp.
const char* trlc::platform::ArchitectureInfo::arch_name |
Human-readable architecture name.
Definition at line 170 of file architecture.hpp.
CpuArchitecture trlc::platform::ArchitectureInfo::architecture |
Detected CPU architecture type.
Definition at line 166 of file architecture.hpp.
ByteOrder trlc::platform::ArchitectureInfo::byte_order |
Detected byte order (endianness)
Definition at line 167 of file architecture.hpp.
size_t trlc::platform::ArchitectureInfo::cache_line_size |
Typical cache line size in bytes.
Definition at line 169 of file architecture.hpp.
int trlc::platform::ArchitectureInfo::pointer_size_bits |
Pointer size in bits (32 or 64)
Definition at line 168 of file architecture.hpp.