Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emulator: Remove vestiges of special handling of x(0) #7387

Merged
merged 1 commit into from Jun 13, 2023

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Jun 11, 2023

In the BEAM emulator, X register 0 (x(0)) used to be specially handled by the macro r(0) so that it could be placed in a CPU register.

That made sense for platforms with many registers such as Sparc and PowerPC. For the register-starved x86_64 platform it is not possible to allocate a CPU register for x(0). Therefore, in 1f996cc (part of Erlang/OTP 19), the special handling of x(0) was removed. Removing that special case simplified the code in many places.

Get rid of the vestiges of the special handling of x(0). While at it, also re-introduce the REG_xregs attribute for the variable holding the pointer to the X registers.

In the BEAM emulator, X register 0 (`x(0)`) used to be specially
handled by the macro `r(0)` so that it could be placed in a CPU
register.

That made sense for platforms with many registers such as Sparc and
PowerPC. For the register-starved x86_64 platform it is not possible
to allocate a CPU register for `x(0)`. Therefore, in
1f996cc (part of Erlang/OTP 19), the special handling of `x(0)`
was removed. Removing that special case simplified the code in many
places.

Get rid of the vestiges of the special handling of `x(0)`. While at
it, also re-introduce the `REG_xregs` attribute for the variable
holding the pointer to the X registers.
@bjorng bjorng added team:VM Assigned to OTP team VM enhancement testing currently being tested, tag is used by OTP internal CI labels Jun 11, 2023
@bjorng bjorng self-assigned this Jun 11, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 11, 2023

CT Test Results

       3 files     133 suites   48m 13s ⏱️
1 554 tests 1 503 ✔️ 51 💤 0
1 972 runs  1 902 ✔️ 70 💤 0

Results for commit f53c6f4.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@bjorng bjorng merged commit 638ffb4 into erlang:master Jun 13, 2023
17 checks passed
@bjorng bjorng deleted the bjorn/erts/clean-up-emu branch June 13, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant