Skip to content
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

Implement AVX512_FP16 #1605

Merged
merged 11 commits into from
Jul 26, 2024
Merged

Implement AVX512_FP16 #1605

merged 11 commits into from
Jul 26, 2024

Conversation

sayantn
Copy link
Contributor

@sayantn sayantn commented Jul 2, 2024

This PR adds the AVX512_FP16 intrinsics in Rust. These intrinsics will be behind the feature gate #[feature(stdarch_x86_avx512_f16)] (rust-lang/rust#127213).

Progress:

  • Set intrinsics
  • Arithmetic operations (Add-Sub-Mul-Div on Real numbers)
  • FMA
  • Cast
  • Compare
  • Convert
  • Math (Reciprocal, Sqrt, RSqrt, Max, Min, Reduce)
  • FP-Support (FPClass, getexp, getmant, scale)
  • Load-Store
  • Complex number operations (mul-cmul-conj on Complex numbers)
  • AVX-NE-CONVERT

This also adds some missing inlining in avx512ifma and updates the x86-intel.xml file to v3.6.9

The set1_pch intrinsics were not implemented due to a lack of complex number type.
cmpph and fpclassph intrinsics use inline asm because of no i1 support yet.

@rustbot
Copy link
Collaborator

rustbot commented Jul 2, 2024

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

@tgross35
Copy link

tgross35 commented Jul 4, 2024

Have you run into any weird behavior with these, or do things seem to be working smoothly? (ignoring the ABI issue for system function calls, that is)

@sayantn
Copy link
Contributor Author

sayantn commented Jul 4, 2024

No problems yet, just that simd_fabs doesn't accept a f16 argument, so i will just use an and operation. I am actively avoiding doing f16 operations in rust, but that's not a blocker for sure.

@bors
Copy link
Contributor

bors commented Jul 6, 2024

☔ The latest upstream changes (presumably 3dd9579) made this pull request unmergeable. Please resolve the merge conflicts.

@sayantn sayantn force-pushed the fp16 branch 4 times, most recently from 91e0971 to 403897c Compare July 12, 2024 07:11
@sayantn sayantn force-pushed the fp16 branch 3 times, most recently from c9588c5 to e907eba Compare July 15, 2024 17:17
@sayantn sayantn marked this pull request as ready for review July 17, 2024 13:18
@sayantn
Copy link
Contributor Author

sayantn commented Jul 17, 2024

cc @tgross35 @beetrees

crates/core_arch/src/simd.rs Outdated Show resolved Hide resolved
crates/core_arch/src/x86/test.rs Outdated Show resolved Hide resolved
Add-Sub-Mul-Div, Load-Store-Move, `comi`, `set`
Reciprocal, RSqrt, Sqrt, Max, Min
`getexp`, `getmant`, `roundscale`, `scalef`, `reduce`
`cmpph`, `fpclass`, reduce, `blend`, `permutex`
Add `#[inline]` to avx512ifma intrinsics
Fix the test equality.
Remove the stability attributes in simd types and test functions
@Amanieu Amanieu merged commit fb90dfa into rust-lang:master Jul 26, 2024
30 checks passed
@sayantn sayantn deleted the fp16 branch July 27, 2024 11:06
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.

5 participants