This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Define vsadd/vsaddu/vssub/vssubu intrinsics.
ClosedPublic

Authored by monkchiang on Dec 15 2020, 9:28 PM.

Details

Summary
We work with @rogfer01 from BSC to come out this patch.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>

Diff Detail

Event Timeline

monkchiang created this revision.Dec 15 2020, 9:28 PM
monkchiang requested review of this revision.Dec 15 2020, 9:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2020, 9:28 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

rebase main branch.

craig.topper added inline comments.Dec 16 2020, 10:54 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1083

You can use Op.getVTList() here to get the original VTs without needing to recreate it.

craig.topper added inline comments.Dec 16 2020, 10:59 PM
llvm/include/llvm/IR/IntrinsicsRISCV.td
188

Can we make this ExtendOperand = 2 and add 1 when we use it in LowerIntrinsic_W_CHAIN? It's a little confusing to have to account for the chain operand of the SelectionDAG representation here.

It's already a little confusing that we're accounting for the intrinsic number operand of SelectionDAG but at least that's a consistent rule.

Let ExtendOperand direct really need to extend a operand.
Correct get operands when we use it in LowerIntrinsic_W_CHAIN

craig.topper added inline comments.Dec 17 2020, 10:24 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1076

I think this if needs to be based on II->ExtendedOperand before adding 1 to it. Otherwise its guaranteed to always be true.

Use II->ExtendedOperand be condition for if statement.

This revision is now accepted and ready to land.Dec 17 2020, 2:15 PM
This revision was landed with ongoing or failed builds.Dec 17 2020, 6:24 PM
This revision was automatically updated to reflect the committed changes.