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

Modernize the codebase #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Modernize the codebase #77

wants to merge 4 commits into from

Conversation

nagisa
Copy link
Member

@nagisa nagisa commented Oct 30, 2022

Reviewed best commit-by-commit.

@nagisa nagisa force-pushed the modernize branch 9 times, most recently from eec8f0e to 0c2bccd Compare October 30, 2022 18:46
@nagisa
Copy link
Member Author

nagisa commented Oct 30, 2022

The Android failures are rust-lang/rust#103673, the freebsd issue is cross-rs/cross#1100 and I don’t really have much understanding of the wasm tool conventions to understand what that failure is about (and whether the problem is in the linker or the archiver.)

Unmaintained, and manual `run` commands are more readable anyhow.
This avoids compiling a binary for each separate test. Makes it much
easier to point a debugger at psm test cases too.
This really has a couple benefits – first, is that we have an
opportunity to simplify the code in some instances. But most
importantly, we no longer need to deal with external assemblers and
different syntax for each.

Eventually we might even be able to utilize them macros to reduce
duplication too!
@nagisa
Copy link
Member Author

nagisa commented Nov 6, 2022

NB for anybody looking at this, the last commit is very incomplete port (ran out of time!)

I am way more optimistic about having an actually working support for stack switching for windows in psm, but I believe this will also require us to add functionality to set up the stack, or at least write the documentation on how the stack ought to be allocated (and give the ability for the users to pass through the relevant information about the stack to the switch function.)

@Zoxc
Copy link
Contributor

Zoxc commented Feb 22, 2023

The currently remaining_stack function has quite bad code generation, so it would be nice to save the function call and the shuffling of XMM registers (on Windows), then it only needs a switch to const thread locals and some inline attributes :)

@Mrmaxmeier
Copy link

Mrmaxmeier commented Mar 15, 2023

Hi,

I took a stab at some of this in interest of not having to rely on external assemblers.
(cargo-zigbuild is nice for cross compilation but zig cc recently switched to an in-house assembler which is not compatible with psm's assembly snippets.)

Here's a summary of my current status: (I haven't cleaned up my branch yet)

I'm not sure why the macOS/iOS targets support a different set of directives, even for inline assembly. Rust's inline assembly guide states that the assembler is guaranteed to support .type for example, but I had to remove it for the apple targets. (Might be worth reporting upstream?)

Here's my current set of changes for reference: modernize...Mrmaxmeier:stacker:modernize
And a recent CI run: https://github.com/Mrmaxmeier/stacker/actions/runs/4379839287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants