[llvm] [RISCV][llvm-mca] Vector Unit Stride Loads and stores use EEW and EMU… (PR #69409)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 11:15:19 PDT 2023


================
@@ -185,6 +187,59 @@ RISCVInstrumentManager::createInstruments(const MCInst &Inst) {
   return SmallVector<UniqueInstrument>();
 }
 
+/// Return EMUL = (EEW / SEW) * LMUL
+inline static std::pair<unsigned, bool>
+getEMULEqualsEEWDivSEWTimesLMUL(unsigned EEW, unsigned SEW,
+                                RISCVII::VLMUL VLMUL) {
+  // Calculate (EEW/SEW)*LMUL preserving fractions less than 1. Use GCD
+  // to put fraction in simplest form.
+  auto [LMUL, Fractional] = RISCVVType::decodeVLMUL(VLMUL);
----------------
michaelmaitland wrote:

I have updated this function to no longer use GCD approach. However, I did not figure out how to do this calculation using fixed point. Please feel free to suggest an alternative solution to the one I am now proposing.

https://github.com/llvm/llvm-project/pull/69409


More information about the llvm-commits mailing list