rust-lang / stdarch

Rust's standard library vendor-specific APIs and run-time feature detection
https://doc.rust-lang.org/stable/core/arch/
Apache License 2.0
605 stars 267 forks source link

f16/half-float support #344

Open gnzlbg opened 6 years ago

gnzlbg commented 6 years ago

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:

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

alexcrichton commented 6 years ago

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

gnzlbg commented 6 years ago

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

tgross35 commented 3 months ago

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