This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add PowerPC vec_stxvp and vsx_stxvp intrinsic
ClosedPublic

Authored by kkwli0 on Aug 11 2023, 6:37 PM.

Details

Summary

This patch is to add PowerPC vec_stxvp and vsx_stxvp intrinsic.

Co-authored-by: @tislam

Diff Detail

Event Timeline

kkwli0 created this revision.Aug 11 2023, 6:37 PM
kkwli0 requested review of this revision.Aug 11 2023, 6:37 PM
kkwli0 retitled this revision from [flang] Add PowerPC vec_stxvp intrinsic to [flang] Add PowerPC vec_stxvp and vsx_stxvp intrinsic.Aug 11 2023, 6:39 PM
kkwli0 edited the summary of this revision. (Show Details)
DanielCChen added inline comments.Aug 14 2023, 6:24 AM
flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
1802

Is this change intentional?

flang/module/__ppc_intrinsics.f90
1413

It seems it is missing the 2 cases where arg3 is integer or real type.

1430

1430-14332 should reverse order.

flang/test/Lower/PowerPC/ppc-vec-store.f90
1208

I think this testing should be moved to ppc-pwr10-vec-intrinsics.f90 as it is Power10 only and that test file has the proper header.

kkwli0 marked 3 inline comments as done.Aug 14 2023, 11:06 AM
kkwli0 added inline comments.
flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
1802

Will restore it

flang/module/__ppc_intrinsics.f90
1430

The #define order is:

#define VP_I0_VI(NAME, VKIND) ...
#define VP_I0_VU(NAME, VKIND) ...
#define VP_I0_VR(NAME, VKIND) ...

#define VEC_VP_I0_VI(NAME, VKIND) ...
#define VEC_VP_I0_VU(NAME, VKIND) ...
#define VEC_VP_I0_VR(NAME, VKIND) ...

according to the convention, the #undef order is:

#undef VEC_VP_I0_VR
#undef VEC_VP_I0_VU
#undef VEC_VP_I0_VI
#undef VP_I0_VR
#undef VP_I0_VU
#undef VP_I0_VI
flang/test/Lower/PowerPC/ppc-vec-store.f90
1208

Will move to ppc-pwr10-vec-intrinsics.f90

DanielCChen accepted this revision.Aug 14 2023, 11:16 AM

LGTM.

flang/module/__ppc_intrinsics.f90
1430

Sorry. I mis-read it.

This revision is now accepted and ready to land.Aug 14 2023, 11:16 AM
DanielCChen added inline comments.Aug 14 2023, 11:18 AM
flang/test/Lower/PowerPC/ppc-vec-store.f90
1208

The patch looks good to me after move the testing of vec_stxvp and vsx_stxvp to the ppc-pwr10-vec-intrinsic.f90.

kkwli0 updated this revision to Diff 550037.Aug 14 2023, 11:32 AM
kkwli0 marked 2 inline comments as done.

Address review comments

  • move vec_stxvp and vsx_stxvp tests to ppc-pwr10-vec-instrinsics.f90
  • restore to llvm_unreachable
  • added the missing interfaces for arg3 of integer or real type
This revision was landed with ongoing or failed builds.Aug 14 2023, 12:39 PM
This revision was automatically updated to reflect the committed changes.