6 Commits

Author SHA1 Message Date
Lang Hames
2b22d76ba7
[orc-rt] Implement rotl / rotr, fix missing include in unit test. (#177305)
In e838f27e0f3 the EndianTest.cpp unittest was updated to avoid using
`llvm::rotl` function, but the corresponding `orc_rt::rotl` function had
not been implemented yet.

This commit implements orc_rt::rotl, orc_rt::rotr, and
orc_rt::has_single_bit by copying their definitions from the
corresponding LLVM header (llvm-project/llvm/include/llvm/ADT/bit.h).
Unit tests for these functions are also copied from their LLVM
counterparts.

Thanks to @jaredwy for spotting this!
2026-01-22 16:15:04 +11:00
Lang Hames
6149895354
[orc-rt] Actually test orc-rt/bit.h functions. (#177300)
The unit test was copied from a similar test in llvm, and was still
qualifying calls with 'llvm::'. This was unintended, but happened to
work because LLVM's bit.h is transitively included through LLVM's gtest
headers. Qualifying with 'orc_rt::' tests the intended functions.

Thanks to @jaredwy for spotting this!
2026-01-22 14:04:29 +11:00
Lang Hames
c3bb00d38a
[orc-rt] Add substitutes for std::countl_zero and std::bit_width. (#157076)
These can be used until the ORC runtime can assume c++-20 or greater.
2025-09-05 21:22:30 +10:00
Lang Hames
adacab3015
[orc-rt] Fix byteswap implementation for 64-bit types, rename tests. (#157074)
The 64-bit path included references to the llvm:: namespace that would
have caused compile failures but for the fact that they were compiled
out on all machines where the ORC runtime is currently tested.
2025-09-05 21:15:39 +10:00
Lang Hames
a088dbd5b6 [orc-rt] Fix comment typos in unit tests. NFC. 2025-08-27 11:14:19 +10:00
Lang Hames
36627e1724
[orc-rt] Add bit.h -- substitute for not yet available STL <bit> APIs. (#155208)
Currently provides endian enum and byteswap.
2025-08-25 16:19:55 +10:00