Skip to content

Conversation

@rsuderman
Copy link
Contributor

@rsuderman rsuderman commented Jan 29, 2026

Add float16 and bfloat16 struct implementations in support/float_types.h that use int16_t storage and perform arithmetic in float32. These provide Windows compatibility where compiler extensions (_Float16, __bf16) are not available. On non-Windows platforms, the compiler extensions are still used.

@rsuderman rsuderman changed the title [Support] Add portable float16 and bfloat16 types for Windows compati… [Support] Add portable float16 and bfloat16 types for Windows Jan 29, 2026
rsuderman and others added 2 commits January 29, 2026 15:17
…bility

Add float16 and bfloat16 struct implementations in support/float_types.h
that use int16_t storage and perform arithmetic in float32. These provide
Windows compatibility where compiler extensions (_Float16, __bf16) are not
available. On non-Windows platforms, the compiler extensions are still used.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: Rob Suderman <[email protected]>
…rsions

Use std::bit_cast for constexpr support, remove ambiguous int16_t
constructor (use fromBits() instead), and use implicit conversions
to/from float to avoid operator ambiguity. Remove member binary
operators since arithmetic works through float conversion.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: Rob Suderman <[email protected]>
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.

1 participant