1 //===-- SIProgramInfo.cpp ----------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 /// The SIProgramInfo tracks resource usage and hardware flags for kernels and
14 //===----------------------------------------------------------------------===//
17 #include "SIProgramInfo.h"
18 #include "SIDefines.h"
19 #include "Utils/AMDGPUBaseInfo.h"
23 uint64_t SIProgramInfo::getComputePGMRSrc1() const {
24 return S_00B848_VGPRS(VGPRBlocks
) | S_00B848_SGPRS(SGPRBlocks
) |
25 S_00B848_PRIORITY(Priority
) | S_00B848_FLOAT_MODE(FloatMode
) |
26 S_00B848_PRIV(Priv
) | S_00B848_DX10_CLAMP(DX10Clamp
) |
27 S_00B848_DEBUG_MODE(DebugMode
) | S_00B848_IEEE_MODE(IEEEMode
) |
28 S_00B848_WGP_MODE(WgpMode
) | S_00B848_MEM_ORDERED(MemOrdered
);
31 uint64_t SIProgramInfo::getPGMRSrc1(CallingConv::ID CC
) const {
32 if (AMDGPU::isCompute(CC
)) {
33 return getComputePGMRSrc1();
35 uint64_t Reg
= S_00B848_VGPRS(VGPRBlocks
) | S_00B848_SGPRS(SGPRBlocks
) |
36 S_00B848_PRIORITY(Priority
) | S_00B848_FLOAT_MODE(FloatMode
) |
37 S_00B848_PRIV(Priv
) | S_00B848_DX10_CLAMP(DX10Clamp
) |
38 S_00B848_DEBUG_MODE(DebugMode
) | S_00B848_IEEE_MODE(IEEEMode
);
40 case CallingConv::AMDGPU_PS
:
41 Reg
|= S_00B028_MEM_ORDERED(MemOrdered
);
43 case CallingConv::AMDGPU_VS
:
44 Reg
|= S_00B128_MEM_ORDERED(MemOrdered
);
46 case CallingConv::AMDGPU_GS
:
47 Reg
|= S_00B228_WGP_MODE(WgpMode
) | S_00B228_MEM_ORDERED(MemOrdered
);
49 case CallingConv::AMDGPU_HS
:
50 Reg
|= S_00B428_WGP_MODE(WgpMode
) | S_00B428_MEM_ORDERED(MemOrdered
);