xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCKernelDescriptor.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1*0fca6ea1SDimitry Andric //===--- AMDGPUMCKernelDescriptor.h ---------------------------*- C++ -*---===//
2*0fca6ea1SDimitry Andric //
3*0fca6ea1SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0fca6ea1SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*0fca6ea1SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0fca6ea1SDimitry Andric //
7*0fca6ea1SDimitry Andric //===----------------------------------------------------------------------===//
8*0fca6ea1SDimitry Andric //
9*0fca6ea1SDimitry Andric /// \file
10*0fca6ea1SDimitry Andric /// AMDHSA kernel descriptor MCExpr struct for use in MC layer. Uses
11*0fca6ea1SDimitry Andric /// AMDHSAKernelDescriptor.h for sizes and constants.
12*0fca6ea1SDimitry Andric ///
13*0fca6ea1SDimitry Andric //
14*0fca6ea1SDimitry Andric //===----------------------------------------------------------------------===//
15*0fca6ea1SDimitry Andric 
16*0fca6ea1SDimitry Andric #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCKERNELDESCRIPTOR_H
17*0fca6ea1SDimitry Andric #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCKERNELDESCRIPTOR_H
18*0fca6ea1SDimitry Andric 
19*0fca6ea1SDimitry Andric #include "llvm/Support/AMDHSAKernelDescriptor.h"
20*0fca6ea1SDimitry Andric 
21*0fca6ea1SDimitry Andric namespace llvm {
22*0fca6ea1SDimitry Andric class MCExpr;
23*0fca6ea1SDimitry Andric class MCContext;
24*0fca6ea1SDimitry Andric class MCSubtargetInfo;
25*0fca6ea1SDimitry Andric namespace AMDGPU {
26*0fca6ea1SDimitry Andric 
27*0fca6ea1SDimitry Andric struct MCKernelDescriptor {
28*0fca6ea1SDimitry Andric   const MCExpr *group_segment_fixed_size = nullptr;
29*0fca6ea1SDimitry Andric   const MCExpr *private_segment_fixed_size = nullptr;
30*0fca6ea1SDimitry Andric   const MCExpr *kernarg_size = nullptr;
31*0fca6ea1SDimitry Andric   const MCExpr *compute_pgm_rsrc3 = nullptr;
32*0fca6ea1SDimitry Andric   const MCExpr *compute_pgm_rsrc1 = nullptr;
33*0fca6ea1SDimitry Andric   const MCExpr *compute_pgm_rsrc2 = nullptr;
34*0fca6ea1SDimitry Andric   const MCExpr *kernel_code_properties = nullptr;
35*0fca6ea1SDimitry Andric   const MCExpr *kernarg_preload = nullptr;
36*0fca6ea1SDimitry Andric 
37*0fca6ea1SDimitry Andric   static MCKernelDescriptor
38*0fca6ea1SDimitry Andric   getDefaultAmdhsaKernelDescriptor(const MCSubtargetInfo *STI, MCContext &Ctx);
39*0fca6ea1SDimitry Andric   // MCExpr for:
40*0fca6ea1SDimitry Andric   // Dst = Dst & ~Mask
41*0fca6ea1SDimitry Andric   // Dst = Dst | (Value << Shift)
42*0fca6ea1SDimitry Andric   static void bits_set(const MCExpr *&Dst, const MCExpr *Value, uint32_t Shift,
43*0fca6ea1SDimitry Andric                        uint32_t Mask, MCContext &Ctx);
44*0fca6ea1SDimitry Andric 
45*0fca6ea1SDimitry Andric   // MCExpr for:
46*0fca6ea1SDimitry Andric   // return (Src & Mask) >> Shift
47*0fca6ea1SDimitry Andric   static const MCExpr *bits_get(const MCExpr *Src, uint32_t Shift,
48*0fca6ea1SDimitry Andric                                 uint32_t Mask, MCContext &Ctx);
49*0fca6ea1SDimitry Andric };
50*0fca6ea1SDimitry Andric 
51*0fca6ea1SDimitry Andric } // end namespace AMDGPU
52*0fca6ea1SDimitry Andric } // end namespace llvm
53*0fca6ea1SDimitry Andric 
54*0fca6ea1SDimitry Andric #endif // LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCKERNELDESCRIPTOR_H
55