This is an archive of the discontinued LLVM Phabricator instance.

[Power9] Add remaining __flaot128 builtin support for FMA round to odd
ClosedPublic

Authored by stefanp on Jun 15 2018, 6:58 AM.

Details

Summary

Implement this as it is done on GCC:

__float128 a, b, c, d;
a = __builtin_fmaf128_round_to_odd (b, c, d);                      // generates xsmaddqpo
a = __builtin_fmaf128_round_to_odd (b, c, -d);                     // generates xsmsubqpo
a = - __builtin_fmaf128_round_to_odd (b, c, d);                    // generates xsnmaddqpo
a = - __builtin_fmaf128_round_to_odd (b, c, -d);                   // generates xsnmsubpqp

Diff Detail

Repository
rL LLVM

Event Timeline

lei added inline comments.Jun 26 2018, 6:36 AM
lib/Target/PowerPC/PPCInstrVSX.td
2488 ↗(On Diff #151502)

indentation for these patterns are wrong.

2496 ↗(On Diff #151502)

Same issue with indentation. See XSNMADDQP for reference.

test/CodeGen/PowerPC/builtins-ppc-p9-f128.ll
51 ↗(On Diff #151502)

Might be good to actually have the registers stated here to ensure we are acting on the proper values.

nemanjai accepted this revision.Jul 4 2018, 4:52 AM

Once Lei's comments are addressed, this LGTM. Feel free to add the updates on the commit.

test/CodeGen/PowerPC/builtins-ppc-p9-f128.ll
51 ↗(On Diff #151502)

+1

This revision is now accepted and ready to land.Jul 4 2018, 4:52 AM
This revision was automatically updated to reflect the committed changes.