-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Clang][LLVM][AArch64]Add support for svrint{32|64}{z|x} intrinsics #169661
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
base: main
Are you sure you want to change the base?
Conversation
|
@llvm/pr-subscribers-llvm-ir Author: None (CarolineConcatto) ChangesThis patch add supports in Clang for these assembly intrinsics: FRINT32X By adding support for these intrinsics: // Variant is available for _f64 // Variant is available for _f64 // Variant is available for _f64 // Variant is available for _f64 |
|
@llvm/pr-subscribers-backend-aarch64 Author: None (CarolineConcatto) ChangesThis patch add supports in Clang for these assembly intrinsics: FRINT32X By adding support for these intrinsics: // Variant is available for _f64 // Variant is available for _f64 // Variant is available for _f64 // Variant is available for _f64 |
There was a problem hiding this 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 support for four new SVE2.2 floating-point rounding intrinsics (FRINT32X, FRINT32Z, FRINT64X, FRINT64Z) to both Clang and LLVM. These intrinsics round floating-point values to integer ranges while maintaining floating-point representation.
- Adds LLVM intrinsic definitions and corresponding backend instruction selection
- Adds Clang ACLE builtin definitions for all variants (_m, _x, _z)
- Includes comprehensive test coverage for both LLVM codegen and Clang frontend
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| llvm/test/CodeGen/AArch64/sve2p2-intrinsics-fp-arith.ll | Adds LLVM codegen tests for all four intrinsic variants across float32 and float64 types |
| llvm/lib/Target/AArch64/SVEInstrFormats.td | Updates instruction format definitions to include pattern matching for the new intrinsics |
| llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td | Defines instruction encodings and links them to the SDNode operations |
| llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | Adds intrinsic lowering logic to map LLVM intrinsics to backend operations |
| llvm/include/llvm/IR/IntrinsicsAArch64.td | Declares the four new LLVM intrinsics |
| clang/test/CodeGen/AArch64/sve2p2-intrinsics/acle_sve_rintx.c | Adds Clang frontend tests verifying intrinsic code generation |
| clang/include/clang/Basic/arm_sve.td | Declares the Clang ACLE builtins with proper target guards |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
914f3f2 to
0d398d5
Compare
This patch add supports in Clang for these assembly intrinsics: FRINT32X FRINT32Z FRINT64X FRINT64Z By adding support for these intrinsics: // Variant is available for _f64 svfloat32_t svrint32x[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint32x[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint32x[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint32z[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint32z[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint32z[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint64x[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint64x[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint64x[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint64z[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint64z[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64 svfloat32_t svrint64z[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn); ``` according to the ACLE[1] [1]ARM-software/acle#412
0d398d5 to
da39b98
Compare
This patch add supports in Clang for these assembly intrinsics:
FRINT32X
FRINT32Z
FRINT64X
FRINT64Z
By adding support for these intrinsics:
// Variant is available for _f64
svfloat32_t svrint32x[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint32x[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint32x[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn);
// Variant is available for _f64
svfloat32_t svrint32z[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint32z[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint32z[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn);
// Variant is available for _f64
svfloat32_t svrint64x[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint64x[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint64x[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn);
// Variant is available for _f64
svfloat32_t svrint64z[_f32]_z(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint64z[_f32]_x(svbool_t pg, svfloat32_t zn); // Variant is available for _f64
svfloat32_t svrint64z[_f32]_m(svfloat32_t inactive, svbool_t pg, svfloat32_t zn);