This is an archive of the discontinued LLVM Phabricator instance.

[VP][RISCV] Add vp.roundtozero and its RISC-V support
ClosedPublic

Authored by eopXD on Oct 4 2022, 6:30 PM.

Details

Summary

The scalar instruction of this is llvm.trunc. However the naming of
ISD::VP_TRUNC is already taken by trunc of the LLVM IR. Naming this as
vp.ftrunc would likely cause confusion with vp.fptrunc. So adding
vp.roundtozero that will look similar to vp.roundeven.

Diff Detail

Unit TestsFailed

Event Timeline

eopXD created this revision.Oct 4 2022, 6:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 6:30 PM
eopXD requested review of this revision.Oct 4 2022, 6:30 PM
craig.topper added inline comments.Oct 4 2022, 9:47 PM
llvm/docs/LangRef.rst
21647

This says roundeven

21659

this should be llvm.trunc

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
1049

Put this below FTRUNC since that is the non-VP equivalent.

eopXD updated this revision to Diff 465295.Oct 5 2022, 12:26 AM
eopXD marked 3 inline comments as done.

Address comments.

frasercrmck added inline comments.Oct 5 2022, 12:39 AM
llvm/docs/LangRef.rst
21649

is a poison value? See recent changes. I've opened D135244 to change the recent introductions of undef to poison.

21660

poison

eopXD updated this revision to Diff 465324.EditedOct 5 2022, 2:23 AM

Address comment

This revision is now accepted and ready to land.Oct 6 2022, 6:50 AM
eopXD updated this revision to Diff 465945.Oct 6 2022, 6:00 PM
eopXD marked 2 inline comments as done.

Rebase to latest main

eopXD updated this revision to Diff 465961.Oct 6 2022, 7:43 PM

Update test case due to landing of D135386.

This revision was automatically updated to reflect the committed changes.