[RISCV] Return false from isShuffleMaskLegal except for splats.

We don't support any other shuffles currently.

This changes the bswap/bitreverse tests that check for this in
their expansion code. Previously we expanded a byte swapping
shuffle through memory. Now we're scalarizing and doing bit
operations on scalars to swap bytes.

In the future we can probably use vrgather.vx to do a byte swap
shuffle.
This commit is contained in:
Craig Topper 2021-03-11 16:21:42 -08:00
parent 8ef69c66d5
commit 1d26bbcf9b
4 changed files with 3814 additions and 2487 deletions

View File

@ -1068,6 +1068,14 @@ bool RISCVTargetLowering::shouldExpandBuildVectorWithShuffles(
return false;
}
bool RISCVTargetLowering::isShuffleMaskLegal(ArrayRef<int> M, EVT VT) const {
// Only splats are currently supported.
if (ShuffleVectorSDNode::isSplatMask(M.data(), VT))
return true;
return false;
}
static SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
const RISCVSubtarget &Subtarget) {
MVT VT = Op.getSimpleValueType();

View File

@ -250,6 +250,10 @@ public:
bool isFPImmLegal(const APFloat &Imm, EVT VT,
bool ForCodeSize) const override;
/// Return true if the given shuffle mask can be codegen'd directly, or if it
/// should be stack expanded.
bool isShuffleMaskLegal(ArrayRef<int> M, EVT VT) const override;
bool hasBitPreservingFPLogic(EVT VT) const override;
bool
shouldExpandBuildVectorWithShuffles(EVT VT,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff