Skip to content

C++: Add basic Aarch64 Neon IR test #19715

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

Merged
merged 2 commits into from
Jun 10, 2025
Merged

C++: Add basic Aarch64 Neon IR test #19715

merged 2 commits into from
Jun 10, 2025

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Jun 10, 2025

This is just to check that the produced IR looks sensible, which it does.

@github-actions github-actions bot added the C++ label Jun 10, 2025
@jketema jketema marked this pull request as ready for review June 10, 2025 13:47
@Copilot Copilot AI review requested due to automatic review settings June 10, 2025 13:47
@jketema jketema requested a review from a team as a code owner June 10, 2025 13:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a simple ARM64 NEON test to verify that the extractor produces sensible IR for basic vector operations.

  • Implements three NEON-based functions (vadd_u8, vaddl_u8, arm_add) in arm.cpp
  • Updates raw_ir.expected, aliased_ir.expected, and PrintAST.expected to include the IR and AST outputs for the new functions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
cpp/ql/test/library-tests/ir/ir/arm.cpp New test file defining basic AArch64 NEON functions
cpp/ql/test/library-tests/ir/ir/raw_ir.expected Added expected raw IR for the new NEON functions
cpp/ql/test/library-tests/ir/ir/aliased_ir.expected Added expected aliased IR for the new NEON functions
cpp/ql/test/library-tests/ir/ir/PrintAST.expected Added expected AST dump for the new NEON functions
Comments suppressed due to low confidence (4)

cpp/ql/test/library-tests/ir/ir/arm.cpp:1

  • [nitpick] Add a brief file-level comment explaining that this file defines basic ARM64 NEON functions used for IR extraction tests.
// semmle-extractor-options: --edg --target --edg linux_arm64

cpp/ql/test/library-tests/ir/ir/arm.cpp:3

  • Avoid defining identifiers with double leading underscores, which are reserved by the language. Consider using a non-reserved name.
typedef __Uint8x8_t uint8x8_t;

cpp/ql/test/library-tests/ir/ir/arm.cpp:6

  • [nitpick] Unify function signature formatting by removing the space before the parenthesis to match the style used elsewhere (e.g., vaddl_u8 and arm_add).
uint8x8_t vadd_u8 (uint8x8_t __a, uint8x8_t __b)

cpp/ql/test/library-tests/ir/ir/arm.cpp:21

  • [nitpick] Indentation is inconsistent: this block is indented with 4 spaces while other functions use 2. Consider standardizing the indentation style.
    uint8x8_t c = vadd_u8(a, b);

@jketema jketema changed the title C++: Add basic Aarch64 Neon test C++: Add basic Aarch64 Neon IR test Jun 10, 2025
Copy link
Contributor

@IdrissRio IdrissRio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the IR and AST generated look good to me.

@jketema jketema merged commit 1bd6446 into github:main Jun 10, 2025
9 checks passed
@jketema jketema deleted the neon-ir-test branch June 10, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants