This is an archive of the discontinued LLVM Phabricator instance.

[Power9] [LLVM] Add __float128 exponent GET and SET builtins
ClosedPublic

Authored by stefanp on Jun 14 2018, 11:58 AM.

Details

Summary

Added

__builtin_vsx_scalar_extract_expq
__builtin_vsx_scalar_insert_exp_qp

Builtins should behave the same way as in GCC.

Diff Detail

Event Timeline

stefanp created this revision.Jun 14 2018, 11:58 AM
lei added inline comments.Jun 26 2018, 9:04 AM
lib/Target/PowerPC/PPCInstrVSX.td
2686

indent by 2 here.

test/CodeGen/PowerPC/builtins-ppc-p9-f128.ll
103

register?

Can you put a link in the description of the patch as to where the GCC builtins are documented (if such a document exists). The naming seems inconsistent and I don't see it at https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/PowerPC-Built-in-Functions.html.

I looked into the naming of those builtins.
GCC does document the overloaded versions of those functions:
scalar_extract_exp for __builtin_vsx_scalar_extract_expq
scalar_insert_exp for __builtin_vsx_scalar_insert_exp_qp

We could add wrappers to these builtins the way that they do or we could (at least for now) just put in the __builtin versions.

nemanjai requested changes to this revision.Aug 13 2018, 7:40 AM
nemanjai added inline comments.
test/CodeGen/PowerPC/builtins-ppc-p9-f128.ll
103

Not only that, but we should check that the sequence with the register move is part of the emitted sequence (both tests).

This revision now requires changes to proceed.Aug 13 2018, 7:40 AM
stefanp updated this revision to Diff 164737.Sep 10 2018, 1:24 PM

Update patch based on reviewer comments.

This revision is now accepted and ready to land.Sep 11 2018, 10:55 AM
This revision was automatically updated to reflect the committed changes.