-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Add regression test for pclmulqdq inlining across target feature #157791
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?
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,29 @@ | ||||||||||||||
| //@ only-x86_64 | ||||||||||||||
| //@ compile-flags: -C opt-level=3 | ||||||||||||||
|
|
||||||||||||||
| //! Regression test for https://github.com/rust-lang/rust/issues/139029 | ||||||||||||||
| //! | ||||||||||||||
| //! pclmulqdq intrinsics should inline across target_feature | ||||||||||||||
|
|
||||||||||||||
| #![crate_type = "lib"] | ||||||||||||||
|
|
||||||||||||||
| use std::arch::x86_64 as arch; | ||||||||||||||
|
|
||||||||||||||
| // CHECK-LABEL: @reduce128_caller | ||||||||||||||
| // CHECK: call <2 x i64> @llvm.x86.pclmulqdq | ||||||||||||||
| // CHECK: call <2 x i64> @llvm.x86.pclmulqdq | ||||||||||||||
|
Comment on lines
+12
to
+14
Contributor
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. Currently this only tests that
But this doesn't test that |
||||||||||||||
| #[target_feature(enable = "pclmulqdq", enable = "sse2", enable = "sse4.1")] | ||||||||||||||
| #[no_mangle] | ||||||||||||||
| pub unsafe fn reduce128_caller( | ||||||||||||||
| a: arch::__m128i, | ||||||||||||||
| b: arch::__m128i, | ||||||||||||||
| keys: arch::__m128i, | ||||||||||||||
| ) -> arch::__m128i { | ||||||||||||||
| reduce128(a, b, keys) | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| unsafe fn reduce128(a: arch::__m128i, b: arch::__m128i, keys: arch::__m128i) -> arch::__m128i { | ||||||||||||||
|
Contributor
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.
Suggested change
With these additional checks the |
||||||||||||||
| let t1 = arch::_mm_clmulepi64_si128(a, keys, 0x00); | ||||||||||||||
| let t2 = arch::_mm_clmulepi64_si128(a, keys, 0x11); | ||||||||||||||
| arch::_mm_xor_si128(arch::_mm_xor_si128(b, t1), t2) | ||||||||||||||
| } | ||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.