@@ -187,6 +187,78 @@ def XeVM_StoreCacheControlAttr
187187 let assemblyFormat = "`<` $value `>`";
188188}
189189
190+ def XeVM_BlockLoadOp
191+ : XeVM_Op<"blockload">,
192+ Results<(outs FixedVectorOfRankAndType<[1], [XeVM_ElemType]>:$res)>,
193+ Arguments<(ins Arg<LLVM_AnyPointer, "", [MemRead]>:$ptr,
194+ OptionalAttr<XeVM_LoadCacheControlAttr>:$cache_control)> {
195+ let summary = "subgroup block load";
196+ let description = [{
197+ Reads one or more components of Result data for each invocation
198+ in the subgroup from the specified `ptr` as a block operation.
199+ The data is read strided, so the first value read is:
200+ ```
201+ ptr[ SubgroupLocalInvocationId ]
202+ ```
203+ and the second value read is:
204+ ```
205+ ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ]
206+ ```
207+ Result type may be a scalar or vector type of scalar element type.
208+
209+ The parameters are:
210+ * `ptr` - the base address to load from
211+ * `cache_control` - an enumerator that sets the cache behaviour
212+
213+ Example:
214+ ```mlir
215+ %loaded_a = xevm.blockload %src,
216+ <{cache_control=#xevm.load_cache_control<L1uc_L2uc_L3uc>}>
217+ : (!llvm.ptr<1>) -> vector<4xi16>
218+ ```
219+ }];
220+ let assemblyFormat = [{
221+ operands prop-dict attr-dict `:` functional-type(operands, results)
222+ }];
223+ }
224+
225+ def XeVM_BlockStoreOp
226+ : XeVM_Op<"blockstore">,
227+ Arguments<(ins Arg<LLVM_AnyPointer, "", [MemWrite]>:$ptr,
228+ FixedVectorOfRankAndType<[1], [XeVM_ElemType]>:$val,
229+ OptionalAttr<XeVM_StoreCacheControlAttr>:$cache_control)> {
230+ let summary = "subgroup block store";
231+ let description = [{
232+ Writes one or more components of `val` for each invocation
233+ in the subgroup to the specified `ptr` as a block operation.
234+ The data is written strided, so the first value is written to:
235+ ```
236+ ptr[ SubgroupLocalInvocationId ]
237+ ```
238+ and the second value is written to:
239+ ```
240+ ptr[ SubgroupLocalInvocationId + SubgroupMaxSize ]
241+ ```
242+ `val` type may be a scalar or vector type of scalar element type.
243+
244+ The parameters are:
245+ * `ptr` - the base address to store to
246+ * `val` - the value to store
247+ * `cache_control` - an enumerator that sets the cache behaviour
248+
249+ Example:
250+ ```mlir
251+ xevm.blockstore %ptr, %val
252+ <{cache_control=#xevm.store_cache_control<L1uc_L2uc_L3uc>}>
253+ : (!llvm.ptr<1>, vector<4xi16>)
254+ ```
255+ }];
256+
257+ let assemblyFormat = [{
258+ operands prop-dict attr-dict `:` `(` type(operands) `)`
259+ }];
260+ }
261+
190262def XeVM_BlockLoad2dOp
191263 : XeVM_Op<"blockload2d">,
192264 Results<(outs FixedVectorOfRankAndType<[1], [XeVM_ElemType]>:$res)>,
0 commit comments