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

Restrict usage of assembly code to little endian for ARM & AAarch64. #2221

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

briansmith
Copy link
Owner

We have this in cpu/arm.rs to force the build to fail for big-endian ARM/AArch64 targets:

const _ASSUMED_ENDIANNESS: () = assert!(cfg!(target_endian = "little"));

As a step towards removing that restriction, change the cfg logic for ARM and Aarch64 to take the endianness into consideration.

Also, don't try to assembly any assembly language sources if the target isn't little endian.

@briansmith briansmith self-assigned this Jan 12, 2025
Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.03%. Comparing base (7476129) to head (ed4f33e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2221      +/-   ##
==========================================
- Coverage   97.03%   97.03%   -0.01%     
==========================================
  Files         161      161              
  Lines       20388    20415      +27     
  Branches      458      458              
==========================================
+ Hits        19784    19810      +26     
  Misses        495      495              
- Partials      109      110       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We have this in cpu/arm.rs to force the build to fail for big-endian
ARM/AArch64 targets:

```
const _ASSUMED_ENDIANNESS: () = assert!(cfg!(target_endian = "little"));
```

As a step towards removing that restriction, change the `cfg` logic for
ARM and Aarch64 to take the endianness into consideration.

Also, don't try to assembly any assembly language sources if the target
isn't little endian.
@briansmith briansmith merged commit 2985668 into main Jan 13, 2025
160 checks passed
@briansmith briansmith deleted the b/aarch64-be branch January 13, 2025 00:35
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.

1 participant