@@ -780,6 +780,53 @@ def ROCDL_PermlaneX16Op : ROCDL_IntrOp<"permlanex16", [], [0],
780
780
}];
781
781
}
782
782
783
+ class ROCDL_ConcretePair<Type elem0, Type elem1> :
784
+ Type<And<[
785
+ LLVM_AnyStruct.predicate,
786
+ SubstLeaves<
787
+ "$_self",
788
+ "::llvm::cast<::mlir::LLVM::LLVMStructType>($_self).getBody()[0]",
789
+ elem0.predicate>,
790
+ SubstLeaves<
791
+ "$_self",
792
+ "::llvm::cast<::mlir::LLVM::LLVMStructType>($_self).getBody()[1]",
793
+ elem1.predicate>
794
+ ]>,
795
+ "LLVM dialect-compatible struct of " # elem0.summary # "and" # elem1.summary,
796
+ "::mlir::LLVM::LLVMStructType">,
797
+ BuildableType<"::mlir::LLVM::LLVMStructType::getLiteral($_builder.getContext(), "
798
+ "{" # elem0.builderCall # ", " # elem1.builderCall # "})">;
799
+
800
+ // Permlane16 swap intrinsic operation
801
+ def ROCDL_Permlane16SwapOp : ROCDL_IntrOp<"permlane16.swap", [], [],
802
+ [], 1, 0, 0, 0,
803
+ [2, 3], ["fi", "boundControl"]>,
804
+ Arguments<(ins I32:$old, I32:$src, I1Attr:$fi, I1Attr:$boundControl)> {
805
+ let results = (outs ROCDL_ConcretePair<I32, I32>:$res);
806
+ let assemblyFormat = [{
807
+ attr-dict $old `,` $src `,` $fi `,` $boundControl `:` `(` type($old) `,` type($src) `)` `->` type($res)
808
+ }];
809
+ let description = [{
810
+ Performs a `permlane16.swap` operation with the given operands, applying the
811
+ permutation specified by $fi to the provided inputs.
812
+ }];
813
+ }
814
+
815
+ // Permlane32 swap intrinsic operation
816
+ def ROCDL_Permlane32SwapOp : ROCDL_IntrOp<"permlane32.swap", [], [],
817
+ [], 1, 0, 0, 0,
818
+ [2, 3], ["fi", "boundControl"]>,
819
+ Arguments<(ins I32:$old, I32:$src, I1Attr:$fi, I1Attr:$boundControl)> {
820
+ let results = (outs ROCDL_ConcretePair<I32, I32>:$res);
821
+ let assemblyFormat = [{
822
+ attr-dict $old `,` $src `,` $fi `,` $boundControl `:` `(` type($old) `,` type($src) `)` `->` type($res)
823
+ }];
824
+ let description = [{
825
+ Performs a `permlane32.swap` operation with the given operands, applying the
826
+ permutation specified by $fi to the provided inputs.
827
+ }];
828
+ }
829
+
783
830
class ROCDL_ConcreteVector<Type elem, int length> :
784
831
FixedVectorOfLengthAndType<[length], [elem]>,
785
832
BuildableType<
0 commit comments