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

f16/half-float support #344

Open
gnzlbg opened this issue Mar 6, 2018 · 3 comments
Open

f16/half-float support #344

gnzlbg opened this issue Mar 6, 2018 · 3 comments
Labels

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Mar 6, 2018

I was implementing the v{min,max}v ARM and AArch64 intrinsics and ran into a couple of them that require passing <4 x half> vectors to llvm and returning half types:

  • pub unsafe fn vmaxv_f16 (a: f16x4_t a) -> f16
  • pub unsafe fn vmaxvq_f16 (a: f6x8_t a) -> f16
  • pub unsafe fn vminv_f16 (a: f16x4_t a) -> f16
  • pub unsafe fn vminvq_f16 (a: f16x8_t a) -> f16

For example, vmaxv_f16 should map to: call half @llvm.aarch64.neon.fminv.f16.v4f16(<4 x half>)

@alexcrichton
Copy link
Member

FWIW I think we've got basically no trans/language support for f16 right now, so I'd just leave them out

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Mar 9, 2018

The PowerPC 64 architecture also supports a vector _Float16 type, with 16 16-bit floats.

@tgross35
Copy link

tgross35 commented Jul 1, 2024

f16 and f128 are now unstably available, so these can be added. This extends to platforms beyond Arm, see rust-lang/rust#125440 for my primitive list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants