Float128 support

The arm64 ABI used by FreeBSD (perhaps Linux and Android too) has the C type 'long double' mapped to a 128-bit floating point type. Full interoperability between Swift and C on platforms with 128-bit floating point type cannot be achieved unless Swift has such a type.

What would it take to add Float128 to the Swift standard library?

  1. Is writing a Swift evolution proposal the first step one needs to take?
  2. How difficult would it be? Clang and LLVM already have support for 128-bit floating point.
  3. Can you have the type Float128 added to the standard library if it will be implemented on some platforms only?

I don't know how similar it would be, but the Float16 proposal and implementation may give you hints about how hard it is to add a new floating point type.

3 Likes