stdarch icon indicating copy to clipboard operation
stdarch copied to clipboard

Implement AVX512_FP16

Open sayantn opened this issue 1 year ago • 3 comments

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:

  • [x] Set intrinsics
  • [ ] Arithmetic operations (Addition, Multiplication, Complex Multiplication)
  • [ ] FMA
  • [x] Cast
  • [x] Compare
  • [ ] Convert
  • [ ] Math (Reciprocal, Sqrt, RSqrt, Max, Min, Reduce)
  • [ ] FP-Support (FPClass, getexp, getmant, scale)
  • [x] Load-Store
  • [ ] Complex number operations

Unsolved Questions

  • The LLVM intrinsics for cmp operations need i1. Can we implement these without inline asm?
  • Some set intrinsics input the C type _Float16 _Complex. How do we represent that in Rust?

sayantn avatar Jul 02 '24 11:07 sayantn

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

rustbot avatar Jul 02 '24 11:07 rustbot

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)

tgross35 avatar Jul 04 '24 20:07 tgross35

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.

sayantn avatar Jul 04 '24 20:07 sayantn

:umbrella: The latest upstream changes (presumably 3dd9579da33db7fc9db68eb36969d387dd706517) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Jul 06 '24 09:07 bors

cc @tgross35 @beetrees

sayantn avatar Jul 17 '24 13:07 sayantn