forked from OSchip/llvm-project
[RISCV][NFC] Remove `*=` operator for LMULType
LMULType always manipulate on Log2LMUL, let all manipulations go through LMULType::MulLog2LMUL. Reviewed By: khchen Differential Revision: https://reviews.llvm.org/D126042
This commit is contained in:
parent
86803008ea
commit
da201aa424
|
@ -156,7 +156,6 @@ struct LMULType {
|
||||||
std::string str() const;
|
std::string str() const;
|
||||||
llvm::Optional<unsigned> getScale(unsigned ElementBitwidth) const;
|
llvm::Optional<unsigned> getScale(unsigned ElementBitwidth) const;
|
||||||
void MulLog2LMUL(int Log2LMUL);
|
void MulLog2LMUL(int Log2LMUL);
|
||||||
LMULType &operator*=(uint32_t RHS);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RVVType;
|
class RVVType;
|
||||||
|
|
|
@ -77,12 +77,6 @@ VScaleVal LMULType::getScale(unsigned ElementBitwidth) const {
|
||||||
|
|
||||||
void LMULType::MulLog2LMUL(int log2LMUL) { Log2LMUL += log2LMUL; }
|
void LMULType::MulLog2LMUL(int log2LMUL) { Log2LMUL += log2LMUL; }
|
||||||
|
|
||||||
LMULType &LMULType::operator*=(uint32_t RHS) {
|
|
||||||
assert(isPowerOf2_32(RHS));
|
|
||||||
this->Log2LMUL = this->Log2LMUL + Log2_32(RHS);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
RVVType::RVVType(BasicType BT, int Log2LMUL,
|
RVVType::RVVType(BasicType BT, int Log2LMUL,
|
||||||
const PrototypeDescriptor &prototype)
|
const PrototypeDescriptor &prototype)
|
||||||
: BT(BT), LMUL(LMULType(Log2LMUL)) {
|
: BT(BT), LMUL(LMULType(Log2LMUL)) {
|
||||||
|
@ -628,17 +622,17 @@ void RVVType::applyModifier(const PrototypeDescriptor &Transformer) {
|
||||||
switch (static_cast<VectorTypeModifier>(Transformer.VTM)) {
|
switch (static_cast<VectorTypeModifier>(Transformer.VTM)) {
|
||||||
case VectorTypeModifier::Widening2XVector:
|
case VectorTypeModifier::Widening2XVector:
|
||||||
ElementBitwidth *= 2;
|
ElementBitwidth *= 2;
|
||||||
LMUL *= 2;
|
LMUL.MulLog2LMUL(1);
|
||||||
Scale = LMUL.getScale(ElementBitwidth);
|
Scale = LMUL.getScale(ElementBitwidth);
|
||||||
break;
|
break;
|
||||||
case VectorTypeModifier::Widening4XVector:
|
case VectorTypeModifier::Widening4XVector:
|
||||||
ElementBitwidth *= 4;
|
ElementBitwidth *= 4;
|
||||||
LMUL *= 4;
|
LMUL.MulLog2LMUL(2);
|
||||||
Scale = LMUL.getScale(ElementBitwidth);
|
Scale = LMUL.getScale(ElementBitwidth);
|
||||||
break;
|
break;
|
||||||
case VectorTypeModifier::Widening8XVector:
|
case VectorTypeModifier::Widening8XVector:
|
||||||
ElementBitwidth *= 8;
|
ElementBitwidth *= 8;
|
||||||
LMUL *= 8;
|
LMUL.MulLog2LMUL(3);
|
||||||
Scale = LMUL.getScale(ElementBitwidth);
|
Scale = LMUL.getScale(ElementBitwidth);
|
||||||
break;
|
break;
|
||||||
case VectorTypeModifier::MaskVector:
|
case VectorTypeModifier::MaskVector:
|
||||||
|
|
Loading…
Reference in New Issue