Page MenuHomePhabricator

[VP][RISCV] Add vp.maxnum and vp.minnum intrinsics and RISC-V support.
ClosedPublic

Authored by fakepaper56 on Sep 26 2022, 6:05 AM.

Details

Summary

Add vp.maxnum and vp.minnum which are vector predicted intrinsics of llvm.maxnum
and llvm.minnum.

Diff Detail

Event Timeline

fakepaper56 created this revision.Sep 26 2022, 6:05 AM
fakepaper56 requested review of this revision.Sep 26 2022, 6:05 AM
craig.topper added inline comments.Sep 26 2022, 9:35 AM
llvm/docs/LangRef.rst
18901

There is no minnum instruction so this should be %t = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %b))

18950

same comment as minnum

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
1074–1075

Are there tests for this?

3927–3928

Are there tests for this?

Fix typos and add test cases for split vector and build vector.

fakepaper56 marked 4 inline comments as done.Sep 26 2022, 4:29 PM
fakepaper56 added inline comments.
llvm/docs/LangRef.rst
18901

Done.

18950

Done.

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
1074–1075

I added vfmin_vv_v32f64 and vfmax_vv_v32f64 to test that.

3927–3928

Thank your reminder. I added vfmin_vv_v15f64 and vfmax_vv_v15f64 to test that.

craig.topper added inline comments.Sep 26 2022, 5:34 PM
llvm/docs/LangRef.rst
18874

minimum has a different meaning according to IEEE-754. This is an "IEEE-754 minnum".

18923

"IEEE-754 maxnum"

fakepaper56 marked 4 inline comments as done.

Strengthen the description to address Craig's comment.

craig.topper added inline comments.Sep 26 2022, 6:16 PM
llvm/docs/LangRef.rst
18874

"minnum" not "minimum". "minimum" has a different meaning to IEEE-754

fakepaper56 added inline comments.Sep 26 2022, 6:17 PM
llvm/docs/LangRef.rst
18874

Good point. Done.

18923

Done.

craig.topper added inline comments.Sep 26 2022, 6:29 PM
llvm/docs/LangRef.rst
18874

minnum not minimum

18923

maxnum not maximum

Use right IEEE-754 terminology.

This revision is now accepted and ready to land.Sep 26 2022, 9:13 PM
fakepaper56 added inline comments.Sep 26 2022, 9:16 PM
llvm/docs/LangRef.rst
18874

Done. Sorry that I were aware of that minnum and maxnum are from IEEE754 a few minutes ago .

18923

Done.

This revision was landed with ongoing or failed builds.Sep 26 2022, 10:36 PM
This revision was automatically updated to reflect the committed changes.