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

Float16 support (WebGL, DataView, etc...) #10624

Closed
BlobTheKat opened this issue Sep 14, 2024 · 3 comments
Closed

Float16 support (WebGL, DataView, etc...) #10624

BlobTheKat opened this issue Sep 14, 2024 · 3 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@BlobTheKat
Copy link

What problem are you trying to solve?

WebGL supports the HALF_FLOAT type but while most CPUs support half float arithmetic, it is not exposed to the JS runtime

What solutions exist today?

Software encoding of values, very slow

How would you solve it?

A variety of self-explanatory APIs:

DataView.prototype.getFloat16(idx, little?)
DataView.prototype.setFloat16(idx, value, little?)
Float16Array
Math.f16round(value)
Math.toFloat16(value, endian = /*host*/) // Convert value to unsigned integer using 16 bits

// For parity
Math.toFloat32(value, endian = /*host*/) // Convert value to signed integer using 32 bits
Math.toFloat64BigInt(value, endian = /*host*/) // Convert value to unsigned BigInt using 64 bits

Anything else?

Let me know if I have missed anything!

@BlobTheKat BlobTheKat added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Sep 14, 2024
@BlobTheKat
Copy link
Author

#8708

@Kaiido
Copy link
Member

Kaiido commented Sep 15, 2024

This is handled by TC39 in https://github.com/tc39/proposal-float16array this is not something WHATWG would have authority upon.

@Kaiido Kaiido closed this as completed Sep 15, 2024
@BlobTheKat
Copy link
Author

This is handled by TC39 in https://github.com/tc39/proposal-float16array this is not something WHATWG would have authority upon.

oki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

2 participants