Skip to content

Re-organize intrinsic-test to enable seamless addition of behaviour testing for more architectures #1758

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

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

Conversation

madhav-madhusoodanan
Copy link

@madhav-madhusoodanan madhav-madhusoodanan commented Mar 24, 2025

Updates so far

  1. Moved the ARM-specific testing to the arm module, exposing only a test function at src/main.rs
  2. Created a SupportedArchitectureTest trait that has been implemented for arm and should be implemented for other architectures too. Allows us to expose functionality like building C/Rust test files and comparing outputs.
  3. Moved common functionality (CLI parsing, create files, compilations, compare outputs) into the common module for reuse by other architectures too.
  4. Implemented a match block for selection of architectures using the target CLI variable.

Reasoning

  1. The Intrinsic type may be specific to architectures, hence the implementation of a trait helps us to abstract the usage of such data types within the architecture-specific module

New architecture of intrinsic-test

IMG_9057

@rustbot
Copy link
Collaborator

rustbot commented Mar 24, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch 2 times, most recently from 9900e81 to 546554d Compare March 24, 2025 19:10
@Amanieu
Copy link
Member

Amanieu commented Mar 25, 2025

The module should be called arm rather than aarch.

@Amanieu
Copy link
Member

Amanieu commented Mar 25, 2025

@JamieCunliffe feel free to have a look at this since you are the original author of intrinsic-test. This is part of a GSoC project to extend intrinsic-test to other architectures.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch 6 times, most recently from 5dce230 to 7ff8497 Compare March 26, 2025 15:32
@madhav-madhusoodanan
Copy link
Author

madhav-madhusoodanan commented Mar 26, 2025

Are we using the --a32 flag in the CLI of intrinsic-test anywhere? I was unable to find its usage.
Would it be alright if I remove it, or is there some reasoning that I may be missing?

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch 2 times, most recently from a12b4a4 to ff10311 Compare March 27, 2025 15:49
@Amanieu
Copy link
Member

Amanieu commented Mar 27, 2025

--a32 is not currently tested in CI, but it is used for 32-bit ARM targets (arm* and thumb*). Some ARM intrinsics are only available on 64-bit ARM targets and this flag skips those.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch 9 times, most recently from 6e8851b to a2ce02c Compare March 27, 2025 19:19
@madhav-madhusoodanan madhav-madhusoodanan changed the title [DRAFT] Re-organize intrinsic-test to enable seamless addition of behaviour testing for more architectures Re-organize intrinsic-test to enable seamless addition of behaviour testing for more architectures Mar 27, 2025
@madhav-madhusoodanan madhav-madhusoodanan marked this pull request as ready for review March 27, 2025 19:29
@madhav-madhusoodanan madhav-madhusoodanan marked this pull request as draft March 28, 2025 08:51
@madhav-madhusoodanan madhav-madhusoodanan changed the title Re-organize intrinsic-test to enable seamless addition of behaviour testing for more architectures [DRAFT] Re-organize intrinsic-test to enable seamless addition of behaviour testing for more architectures Mar 28, 2025
@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch from 5123d1a to 2c7ef96 Compare April 28, 2025 14:18
@madhav-madhusoodanan
Copy link
Author

Just noticed that the i686-pc-windows-msvc target CI run is failing for some CI flows for PRs.

@madhav-madhusoodanan
Copy link
Author

Just in case you're surprised down the line - aarch64 big endian currently isn't tested in CI. #1785 or #1786 will fix that. It might be worth running that locally if you haven't already.

Got it, let me try doing that.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch 2 times, most recently from 90a2f59 to 2fdd183 Compare May 4, 2025 10:27
Reasoning:
1. Majority of code assumes the usage of `Intrinsic` and related types, which is derived from the JSON structure of the ARM intrinsics JSON source file
2. Further commits will start with extracting common parts of the code (eg: Create C/Rust file, Build C/Rust file, etc)
…ted for different architectures.

Next steps:
Move the existing ARM-specific implementation into one that fits well with this trait.
@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch 2 times, most recently from 9dfe061 to 9a221fe Compare May 4, 2025 17:23
@madhav-madhusoodanan madhav-madhusoodanan force-pushed the restructure-intrinsic-test-crate branch from 9a221fe to 5ac0c71 Compare May 4, 2025 17:45
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.

4 participants