externals: Update oaknut to 2.0.2

Merge commit '48dcc318c977ce17373f3710d04d96f9b05860a0'
This commit is contained in:
Merry
2024-01-30 12:28:40 +00:00
6 changed files with 116 additions and 49 deletions

View File

@@ -7,14 +7,18 @@
#include <catch2/catch_test_macros.hpp>
#include "oaknut/code_block.hpp"
#include "oaknut/dual_code_block.hpp"
#include "architecture.hpp"
#include "oaknut/oaknut.hpp"
#include "rand_int.hpp"
using namespace oaknut;
using namespace oaknut::util;
#ifdef ON_ARM64
# include "oaknut/code_block.hpp"
# include "oaknut/dual_code_block.hpp"
TEST_CASE("Basic Test")
{
CodeBlock mem{4096};
@@ -196,19 +200,6 @@ TEST_CASE("ADR", "[slow]")
}
}
TEST_CASE("PageOffset (rollover)")
{
REQUIRE(PageOffset<21, 12>::encode(0x0000000088e74000, 0xffffffffd167dece) == 0xd2202);
}
TEST_CASE("PageOffset (page boundary)")
{
REQUIRE(PageOffset<21, 12>::encode(0x0001000000000002, 0x0001000000000001) == 0);
REQUIRE(PageOffset<21, 12>::encode(0x0001000000000001, 0x0001000000000002) == 0);
REQUIRE(PageOffset<21, 12>::encode(0x0001000000001000, 0x0001000000000fff) == 0x1fffff);
REQUIRE(PageOffset<21, 12>::encode(0x0001000000000fff, 0x0001000000001000) == 0x080000);
}
TEST_CASE("ADRP", "[slow]")
{
CodeBlock mem{4096};
@@ -325,3 +316,18 @@ TEST_CASE("MOVP2R (4GiB boundary)")
test(-i);
}
}
#endif
TEST_CASE("PageOffset (rollover)")
{
REQUIRE(PageOffset<21, 12>::encode(0x0000000088e74000, 0xffffffffd167dece) == 0xd2202);
}
TEST_CASE("PageOffset (page boundary)")
{
REQUIRE(PageOffset<21, 12>::encode(0x0001000000000002, 0x0001000000000001) == 0);
REQUIRE(PageOffset<21, 12>::encode(0x0001000000000001, 0x0001000000000002) == 0);
REQUIRE(PageOffset<21, 12>::encode(0x0001000000001000, 0x0001000000000fff) == 0x1fffff);
REQUIRE(PageOffset<21, 12>::encode(0x0001000000000fff, 0x0001000000001000) == 0x080000);
}