This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Power10] Implement low-order Vector Modulus Builtins, and add Vector Multiply/Divide/Modulus Builtins Tests
ClosedPublic

Authored by amyk on Jun 25 2020, 9:25 AM.

Details

Summary

In Power10, there are new instructions for the following:

  1. mul of two v2i64
  2. div of two v4i32 and of two v2i64
  3. mod of two v4i32 and of two v2i64

This patch aims to add the following function prototypes to account for vec_mod (since 1) and 2) have already
been previously implemented in altivec.h as vec_mul and vec_div respectively. In Power10, these
functions will use the instructions introduced in D82510.

This patch also adds the following front end tests:

  • vec_mul for v2i64
  • vec_div for v4i32 and v2i64
  • vec_mod for v4i32 and v2i64

Depends on D82584.

Diff Detail

Event Timeline

amyk created this revision.Jun 25 2020, 9:25 AM
bsaleil added inline comments.
clang/test/CodeGen/builtins-ppc-p10vector.c
27

Are the tests for vec_mul with v4i32 missing ?

amyk marked an inline comment as done.Jul 16 2020, 8:14 AM
amyk added inline comments.
clang/test/CodeGen/builtins-ppc-p10vector.c
27

I should probably reword the description. So for Power10, we actually have new instructions for:

  • mul with v2i64
  • div with v4i32 and v2i64
  • mod with v4i32 and v2i64

Which is why I have only added vec_mul for v4i32 here. All of those functions exist in altivec.h already except for vec_mod, which I have added.

amyk edited the summary of this revision. (Show Details)Jul 16 2020, 8:56 AM
bsaleil accepted this revision.Jul 16 2020, 9:09 AM

Thanks for the explanation. LGTM.

This revision is now accepted and ready to land.Jul 16 2020, 9:09 AM
amyk edited the summary of this revision. (Show Details)Jul 27 2020, 3:41 PM
This revision was landed with ongoing or failed builds.Jul 31 2020, 9:15 AM
This revision was automatically updated to reflect the committed changes.