[PATCH] D116016: [Clang] [PowerPC] Emit module flag for current float abi
Qiu Chaofan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 19 21:45:43 PST 2021
qiucf added a comment.
In D116016#3202148 <https://reviews.llvm.org/D116016#3202148>, @MaskRay wrote:
>> This is part of the efforts adding .gnu_attribute support for PowerPC. In Clang, an extra metadata field will be added as float-abi to show current long double format. So backend can emit .gnu_attribute section data from this metadata.
>
> How does .gnu_attribute work with the metadata?
Planned way to do is check the module flag in ASM printer, like
if (flt == "doubledouble")
OutStreamer->emitGNUAttribute(4, 5);
else if (flt == "ieeequad")
OutStreamer->emitGNUAttribute(4, 13);
else if (flt == "ieeedouble")
OutStreamer->emitGNUAttribute(4, 9);
Currently this doesn't look like the most elegant way, and doesn't fully match behavior of GCC. (In GCC, if no floating operations exist, the attributes won't be generated) But since the floating abi option applies to the whole module, adding them to module flags are more reasonable than function attributes.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116016/new/
https://reviews.llvm.org/D116016
More information about the cfe-commits
mailing list