gcc PowerPC supports 3 representations of long double:
- -mlong-double-64
long double has the same representation of double but is mangled as e. In clang, this is the default on AIX, FreeBSD and Linux musl.
- -mlong-double-128
long double has 2 possible 128-bit floating point representations:
+ -mabi=ibmlongdouble IBM extended double format. Mangled as g In clang, this is the default on Linux glibc. + -mabi=ieeelongdouble IEEE 754 quadruple-precision format. Mangled as u9__ieee128 (U10__float128 before gcc 8.2) This is currently unavailable.
This patch adds -mabi=ibmlongdouble and -mabi=ieeelongdouble, and thus
makes the IEEE 754 quadruple-precision long double available for
languages supported by clang.
This seems like an unintentional behavior change on top of the existing behavior (which may have also been not quite right). As best I can tell, we're trying to set ABIName equal to the last ABI type specified, unless that type is "altivec", in which case the ABI name should be its default value (either a nullptr or something like "elfv2"). With this change, we'll now take the first ABI name seen, not the last (as we'll get SeenOther to true after the first name).
Maybe we should loop over the list multiple times, once to get the long-double format, once to get the basic ABI name (where we save the default, and then if the last name found is "altivec", then reset to the default)?