Repository navigation
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Ran this under Rosetta, head Machine: Apple M2 Max, macOS 27.2, Xcode 27 clang, relinker-only Release builds, x86_64 (
The red-zone check looks at the wrong side of RSP. The wrapper writes the sentinels at A version that checks the bytes below the guest RSP works for me under Rosetta:
With that version, the real lowering passes. A 16-byte frame and a 128-byte frame both fail with Test diff@@ -149,14 +149,13 @@ public:
rspToCell(48);
statePtrToCell(0);
loadCellTo(0, 256);
+ push(0);
+ bytes.push_back(0x9D);
bytes.insert(bytes.end(), {0x48, 0x8D, 0xA4, 0x24});
append32(-128);
bytes.insert(bytes.end(), {0x48, 0xB8});
append64(preservationSentinel);
- for (int slot = 0; slot < 16; ++slot) storeAtStack(0, slot * 8);
- loadCellTo(0, 256);
- push(0);
- bytes.push_back(0x9D);
+ for (int slot = 0; slot < 16; ++slot) storeAtStack(0, -128 + slot * 8);
rspToCell(72);
@@ -170,6 +169,12 @@ public:
rspToCell(24);
+ raxToCell(80);
+ for (int slot = 0; slot < 16; ++slot) {
+ stackLoad(0, -128 + slot * 8);
+ raxToCell(96 + slot * 8);
+ }
+ loadCellTo(0, 80);
rspFromCell(72);
@@ -185,7 +190,7 @@ public:
for (int slot = 0; slot < 16; ++slot) {
- stackLoad(0, slot * 8);
+ loadCellTo(0, 96 + slot * 8);
store(0, (34 + slot) * 8);
}
@@ -255,6 +260,10 @@ private:
+ void raxToCell(const int slot) {
+ bytes.insert(bytes.end(), {0x48, 0x89, 0x05});
+ append32(static_cast<std::int32_t>(4096 + slot - (bytes.size() + 4)));
+ }Written with AI assistance (Claude Code). I ran the builds and tests above on my machine. |
|
Fixed in |
|
Thanks for the independent Rosetta check and the short-frame negative control. The updated head |
What
Adds generated-stub regression checks for the ADCX/ADOX lowering in #7173. For both widths and instructions, the test covers every destination except RSP and every source register including RSP, with four flag images and zero, mixed, and all-ones register patterns. It checks the result, every unrelated guest GPR, the guest RSP, arithmetic flags, and the caller's 128-byte red zone.
This is test-only and depends on #7173. The preservation gap and independent validation matrix were reported by plokmklo in #7157; this follow-up credits that contribution and omits the VEX forms whose validity was not established in that discussion.
Tested
ctest -R '^adx_lowering$'passes (1/1), including the new preservation matrix.python3 tools/check_conventions.py --base upstream/mainpasses.git diff --checkpasses.Checklist