xref: /llvm-project/flang/include/flang/Optimizer/Builder/Runtime/Transformational.h (revision 43eb96cab8f734a740b86c553f48f96fa9d19edc)
1 //===-- Transformational.h --------------------------------------*- C++ -*-===//
2 // Generate transformational intrinsic runtime API calls.
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TRANSFORMATIONAL_H
11 #define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TRANSFORMATIONAL_H
12 
13 #include "mlir/Dialect/Func/IR/FuncOps.h"
14 
15 namespace fir {
16 class ExtendedValue;
17 class FirOpBuilder;
18 } // namespace fir
19 
20 namespace fir::runtime {
21 
22 void genBesselJn(fir::FirOpBuilder &builder, mlir::Location loc,
23                  mlir::Value resultBox, mlir::Value n1, mlir::Value n2,
24                  mlir::Value x, mlir::Value bn2, mlir::Value bn2_1);
25 
26 void genBesselJnX0(fir::FirOpBuilder &builder, mlir::Location loc,
27                    mlir::Type xTy, mlir::Value resultBox, mlir::Value n1,
28                    mlir::Value n2);
29 
30 void genBesselYn(fir::FirOpBuilder &builder, mlir::Location loc,
31                  mlir::Value resultBox, mlir::Value n1, mlir::Value n2,
32                  mlir::Value x, mlir::Value bn1, mlir::Value bn1_1);
33 
34 void genBesselYnX0(fir::FirOpBuilder &builder, mlir::Location loc,
35                    mlir::Type xTy, mlir::Value resultBox, mlir::Value n1,
36                    mlir::Value n2);
37 
38 void genCshift(fir::FirOpBuilder &builder, mlir::Location loc,
39                mlir::Value resultBox, mlir::Value arrayBox,
40                mlir::Value shiftBox, mlir::Value dimBox);
41 
42 void genCshiftVector(fir::FirOpBuilder &builder, mlir::Location loc,
43                      mlir::Value resultBox, mlir::Value arrayBox,
44                      mlir::Value shiftBox);
45 
46 void genEoshift(fir::FirOpBuilder &builder, mlir::Location loc,
47                 mlir::Value resultBox, mlir::Value arrayBox,
48                 mlir::Value shiftBox, mlir::Value boundBox, mlir::Value dimBox);
49 
50 void genEoshiftVector(fir::FirOpBuilder &builder, mlir::Location loc,
51                       mlir::Value resultBox, mlir::Value arrayBox,
52                       mlir::Value shiftBox, mlir::Value boundBox);
53 
54 void genMatmul(fir::FirOpBuilder &builder, mlir::Location loc,
55                mlir::Value matrixABox, mlir::Value matrixBBox,
56                mlir::Value resultBox);
57 
58 void genMatmulTranspose(fir::FirOpBuilder &builder, mlir::Location loc,
59                         mlir::Value matrixABox, mlir::Value matrixBBox,
60                         mlir::Value resultBox);
61 
62 void genPack(fir::FirOpBuilder &builder, mlir::Location loc,
63              mlir::Value resultBox, mlir::Value arrayBox, mlir::Value maskBox,
64              mlir::Value vectorBox);
65 
66 void genReshape(fir::FirOpBuilder &builder, mlir::Location loc,
67                 mlir::Value resultBox, mlir::Value sourceBox,
68                 mlir::Value shapeBox, mlir::Value padBox, mlir::Value orderBox);
69 
70 void genSpread(fir::FirOpBuilder &builder, mlir::Location loc,
71                mlir::Value resultBox, mlir::Value sourceBox, mlir::Value dim,
72                mlir::Value ncopies);
73 
74 void genTranspose(fir::FirOpBuilder &builder, mlir::Location loc,
75                   mlir::Value resultBox, mlir::Value sourceBox);
76 
77 void genUnpack(fir::FirOpBuilder &builder, mlir::Location loc,
78                mlir::Value resultBox, mlir::Value vectorBox,
79                mlir::Value maskBox, mlir::Value fieldBox);
80 
81 } // namespace fir::runtime
82 
83 #endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TRANSFORMATIONAL_H
84