[Mlir-commits] [mlir] [MLIR] Implement emulation of static indexing subbyte type vector stores (PR #115922)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Dec 5 11:05:24 PST 2024


================
@@ -309,6 +314,99 @@ emulatedVectorLoad(OpBuilder &rewriter, Location loc, Value base,
       newLoad);
 }
 
+/// Emits `memref.generic_atomic_rmw` op to store a subbyte-sized value to a
+/// byte in memory, with a mask. The `valueToStore` is a vector of subbyte-sized
+/// elements, with size of 8 bits, and the mask is used to select which elements
+/// to store.
+///
+/// Inputs:
+///   linearizedMemref = |a|b|c|d| : <4xi2> (<1xi8>)
+///   linearizedIndex = 2
+///   valueToStore = |e|f|g|h| : vector<4xi2>
----------------
banach-space wrote:

Note that `a`, `b`, `c`, `d` are valid hex values. I suggest using proper `i2` values, e.g. `2` and `3`. Two values should be sufficient to capture what you're trying to convey here:

```
///   linearizedMemref = |2|2|2|2| : <4xi2> (<1xi8>)
///   linearizedIndex = 2
///   valueToStore = |3|3|3|3| : vector<4xi2>
///
///   linearizedMemref = |2|2|3|3| : <4xi2> (<1xi8>)
```

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


More information about the Mlir-commits mailing list