dwaite / swift-cyborg

CBOR tooling for the Swift programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Float16 support

dwaite opened this issue · comments

CBOR has native support for Float16, and Swift 5.2 added this type. Currently the Float16 type in cyborg-brain is simply stored in a UInt16, using Float16 directly here would be beneficial.

In addition, there are canonicalized modes (currently unsupported) where floating point numbers are represented as the smallest sized type with full fidelity. We could leverage the init(exactly:) initializer to do this check without writing our own bit manipulation.

MacOS support for Float16 is blocked. Intel and Apple are apparently still working (as of Swift 5.3 timeframe) on what the ABI for Float16 should look like on the non-Apple-Silicon Macs.