Skip to content

Refactor AArch64 instruction #40

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

Closed
wants to merge 3 commits into from
Closed

Conversation

0xb-s
Copy link
Contributor

@0xb-s 0xb-s commented Jun 4, 2025

This PR refactor the AArch64 instruction emitters by replacing manual [bool; 32] construction with u32encoding.

Changes

  • Rewrote emit_ret, emit_ret_x30, emit_br, emit_movk, and emit_movz to use binary field.
  • Kept all original function names and output types.
  • All instruction encodings match official Armv8-A specifications.
  • Used helper functions.

@0xb-s
Copy link
Contributor Author

0xb-s commented Jun 4, 2025

@microsoft-github-policy-service agree

@mazong1123
Copy link
Collaborator

mazong1123 commented Jun 4, 2025

Thanks @0xb-s for helping this! Could you help to fix the CI failure?

@0xb-s
Copy link
Contributor Author

0xb-s commented Jun 4, 2025

Thanks @0xb-s for helping this! Could you help to fix the CI failure?

Done. Need CI approval

@mazong1123
Copy link
Collaborator

mazong1123 commented Jun 5, 2025

Thanks! I should find a way to auto approve the CI.

@0xb-s
Copy link
Contributor Author

0xb-s commented Jun 5, 2025

Thanks! I should find a way to auto approve the CI.

ci fail on aarch64-unknown-linux-gnu with SIGILL. We're manually encoding valid AArch64 instructions, but QEMU in CI likely doesn't support executing them directly. Any suggestion on how to handle this or maybe omdify the CI setup?

@mazong1123
Copy link
Collaborator

mazong1123 commented Jun 5, 2025

Thanks! I should find a way to auto approve the CI.

ci fail on aarch64-unknown-linux-gnu with SIGILL. We're manually encoding valid AArch64 instructions, but QEMU in CI likely doesn't support executing them directly. Any suggestion on how to handle this or maybe omdify the CI setup?

This sounds like a test failure and issue on the machine code written to the memory. Is it passing on your local Linux arm64 environment?

Caused by:
  process didn't exit successfully: `/linux-runner aarch64 /target/aarch64-unknown-linux-gnu/debug/deps/async-d3ca3d9cbabe31eb --nocapture` (signal: 4, SIGILL: illegal instruction)
test test_complex_struct_async_func_with_param_should_success ... 

@0xb-s
Copy link
Contributor Author

0xb-s commented Jun 6, 2025

This sounds like a test failure and issue on the machine code written to the memory. Is it passing on your local Linux arm64 environment?

Yes, it's passing on my local Linux arm64 environment.

@0xb-s 0xb-s closed this Jun 22, 2025
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.

2 participants