Skip to content

[RISCV] Teach fillUpExtensionSupportForSplat to handle nxvXi64 VMV_V_X_VL on RV32. #99251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14503,10 +14503,21 @@ struct NodeExtensionHelper {
// widening opcode by splatting to smaller element size.
unsigned EltBits = VT.getScalarSizeInBits();
unsigned ScalarBits = Op.getValueSizeInBits();
// Make sure we're getting all element bits from the scalar register.
// FIXME: Support implicit sign extension of vmv.v.x?
if (ScalarBits < EltBits)
// If we're not getting all bits from the element, we need special handling.
if (ScalarBits < EltBits) {
// This should only occur on RV32.
assert(Opc == RISCVISD::VMV_V_X_VL && EltBits == 64 && ScalarBits == 32 &&
!Subtarget.is64Bit() && "Unexpected splat");
// vmv.v.x sign extends narrow inputs.
SupportsSExt = true;

// If the input is positive, then sign extend is also zero extend.
if (DAG.SignBitIsZero(Op))
SupportsZExt = true;

EnforceOneUse = false;
return;
}

unsigned NarrowSize = EltBits / 2;
// If the narrow type cannot be expressed with a legal VMV,
Expand Down
Loading
Loading