-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Clang] [ARM] Ensure FPU Features are collected when using the Clang Assembler #134366
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// REQUIRES: arm-registered-target | ||
// Ensures that when targeting an ARM target with an Asm file, clang | ||
// collects the features from the FPU. This is critical in the | ||
// activation of NEON for supported targets. The Cortex-R52 will be | ||
// used and tested for VFP and NEON Support | ||
|
||
// RUN: %clang -target arm-none-eabi -mcpu=cortex-r52 -c %s -o /dev/null | count 0 | ||
// RUN: %clang -target arm-none-eabi -mcpu=cortex-r52 -c %s -o /dev/null -### 2>&1 | FileCheck --check-prefix=CHECK-TARGET-FEATURES %s | ||
|
||
// Check that NEON and VFPV5 have been activated when using Cortex-R52 when using cc1as | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+vfp2sp" | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+vfp3" | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+fp-armv8" | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+fp-armv8d16" | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+fp-armv8d16sp" | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+fp-armv8sp" | ||
// CHECK-TARGET-FEATURES: "-target-feature" "+neon" | ||
|
||
vadd.f32 s0, s1, s2 | ||
vadd.f64 d0, d1, d2 | ||
vcvt.u32.f32 s0, s0, #1 | ||
vcvt.u32.f64 d0, d0, #1 | ||
vcvtb.f32.f16 s0, s1 | ||
vcvtb.f64.f16 d0, s1 | ||
vfma.f32 s0, s1, s2 | ||
vfma.f64 d0, d1, d2 | ||
vcvta.u32.f32 s0, s1 | ||
vcvta.u32.f64 s0, d1 | ||
vadd.f32 q0, q1, q2 | ||
vcvt.f32.f16 q0, d1 | ||
vfma.f32 q0, q1, q2 | ||
vcvta.u32.f32 q0, q1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Ensure that we can assemble NEON by just specifying an armv7 | ||
// Apple or Windows target. | ||
|
||
// REQUIRES: arm-registered-target | ||
// RUN: %clang -c -target armv7-apple-darwin -o /dev/null %s | ||
// RUN: %clang -c -target armv7-windows -o /dev/null %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this test, and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, sure. FWIW, the prime motivation behind all this, is to make sure that these testcases still compile successfully in this form, when downstream applies patches like https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/19/debian/patches/clang-arm-default-vfp3-on-armv7a.patch?ref_type=heads. Previously, testing that was a bit hard as we didn't pass the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I expect the downstream patch you have listed there will need updating with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, the downstream patch doesn't need to update these tests; the whole point of the code added in #122095 is to make sure that NEON still does get enabled by default for the windows/darwin targets. (I just retested building your PR 134612 together with that downstream patch, and those tests still pass.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes ok I am with you. |
||
|
||
vadd.i32 q0, q0, q0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Ensure that we can assemble VFPv4 by just specifying an armv7s target. | ||
|
||
// REQUIRES: arm-registered-target | ||
// RUN: %clang -c -target armv7s-apple-darwin -o /dev/null %s | ||
|
||
vfma.f32 q1, q2, q3 |
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.
"Arch's" -> "Architecture's"
"this" seems to refer to "specific feature" but what you'd want to append is the option to disable that feature. Perhaps instead:
"If you wish not to use a specific feature, an option to disable it will need appending to the command line used."
And we assume folks know, or can find out, that "+no..." is probably what they want.