This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add PowerPC vec_extract, vec_insert, vec_mergeh, vec_mergel, vec_perm and ver_permi intrinsic
ClosedPublic

Authored by kkwli0 on Jul 24 2023, 7:54 PM.

Details

Summary

This patch adds support for PowerPC vec_extract, vec_insert, vec_mergeh, vec_mergel, vec_perm and ver_permi intrinsic. It also includes the semantic check for the argument of vec_permi.

Co-authored-by: Paul Scoropan <1paulscoropan@gmail.com>
Co-authored-by: Mark Danial <Mark.Danial@ibm.com>

Diff Detail

Event Timeline

kkwli0 created this revision.Jul 24 2023, 7:54 PM
kkwli0 requested review of this revision.Jul 24 2023, 7:54 PM
kkwli0 updated this revision to Diff 547398.Aug 4 2023, 4:35 PM

Changes:

  • add element order handling and tests
  • rebase
DanielCChen added inline comments.Aug 10 2023, 7:31 AM
flang/module/__ppc_intrinsics.f90
202

The order seems not quite consistent with the nested level.

204

ELEM_FUNC_RVII

205

ELEM_FUNC_IVII

305

Should flip the order with the next line.

DanielCChen added inline comments.Aug 10 2023, 7:34 AM
flang/module/__ppc_intrinsics.f90
204

Sorry, should be ELEM_FUNC_RVRI

kkwli0 updated this revision to Diff 549043.Aug 10 2023, 7:53 AM
kkwli0 marked 4 inline comments as done.

Address review comments.

DanielCChen added inline comments.Aug 10 2023, 8:01 AM
flang/module/__ppc_intrinsics.f90
130

I don't see this macro is undef(ed).

146

Same as above.

kkwli0 marked 2 inline comments as done.Aug 10 2023, 8:10 AM
kkwli0 added inline comments.
flang/module/__ppc_intrinsics.f90
130

Oops, line 225 should be #undef ELEM_FUNC_IVII. I will update it.

146

Line 223 should be #undef ELEM_FUNC_RVRI. I will update it.

kkwli0 marked 2 inline comments as done.Aug 10 2023, 8:14 AM
kkwli0 added inline comments.
flang/module/__ppc_intrinsics.f90
305

Is it a preference? Is there a reason to have the suggested order?

DanielCChen added inline comments.Aug 10 2023, 8:21 AM
flang/module/__ppc_intrinsics.f90
305

ELEM_FUNC_VRRVRI is defined later than ELEM_FUNC_VIIVII. It should be undef(ed) first if we impose the nesting rule.

kkwli0 marked 2 inline comments as done.Aug 10 2023, 8:24 AM
kkwli0 added inline comments.
flang/module/__ppc_intrinsics.f90
305

Sure. I will order all the undefs below (line 313-324) in the next update. Thanks.

kkwli0 updated this revision to Diff 549054.Aug 10 2023, 8:30 AM
kkwli0 marked an inline comment as done.

Thanks. I address the last few review comments on the order of undef's.

kkwli0 updated this revision to Diff 549084.Aug 10 2023, 9:42 AM

Fix the ordering of undefs in the abstract interface

DanielCChen accepted this revision.Aug 10 2023, 12:33 PM

Thanks for keeping the ordering consistent. LGTM now.

This revision is now accepted and ready to land.Aug 10 2023, 12:33 PM
This revision was landed with ongoing or failed builds.Aug 10 2023, 1:20 PM
This revision was automatically updated to reflect the committed changes.