CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
92 lines
3.6 KiB
C++
92 lines
3.6 KiB
C++
//===- AMDGPULaneMaskUtils.h - Exec/lane mask helper functions -*- C++ -*--===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPULANEMASKUTILS_H
|
|
#define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPULANEMASKUTILS_H
|
|
|
|
#include "GCNSubtarget.h"
|
|
#include "llvm/CodeGen/Register.h"
|
|
|
|
namespace llvm {
|
|
|
|
class GCNSubtarget;
|
|
|
|
namespace AMDGPU {
|
|
|
|
class LaneMaskConstants {
|
|
public:
|
|
const Register ExecReg;
|
|
const Register VccReg;
|
|
const unsigned AndOpc;
|
|
const unsigned AndTermOpc;
|
|
const unsigned AndN2Opc;
|
|
const unsigned AndN2SaveExecOpc;
|
|
const unsigned AndN2TermOpc;
|
|
const unsigned AndSaveExecOpc;
|
|
const unsigned AndSaveExecTermOpc;
|
|
const unsigned BfmOpc;
|
|
const unsigned CMovOpc;
|
|
const unsigned CSelectOpc;
|
|
const unsigned MovOpc;
|
|
const unsigned MovTermOpc;
|
|
const unsigned OrOpc;
|
|
const unsigned OrN2Opc;
|
|
const unsigned OrTermOpc;
|
|
const unsigned OrSaveExecOpc;
|
|
const unsigned XorOpc;
|
|
const unsigned XorTermOpc;
|
|
const unsigned WQMOpc;
|
|
|
|
constexpr LaneMaskConstants(bool IsWave32)
|
|
: ExecReg(IsWave32 ? AMDGPU::EXEC_LO : AMDGPU::EXEC),
|
|
VccReg(IsWave32 ? AMDGPU::VCC_LO : AMDGPU::VCC),
|
|
AndOpc(IsWave32 ? AMDGPU::S_AND_B32 : AMDGPU::S_AND_B64),
|
|
AndTermOpc(IsWave32 ? AMDGPU::S_AND_B32_term : AMDGPU::S_AND_B64_term),
|
|
AndN2Opc(IsWave32 ? AMDGPU::S_ANDN2_B32 : AMDGPU::S_ANDN2_B64),
|
|
AndN2SaveExecOpc(IsWave32 ? AMDGPU::S_ANDN2_SAVEEXEC_B32
|
|
: AMDGPU::S_ANDN2_SAVEEXEC_B64),
|
|
AndN2TermOpc(IsWave32 ? AMDGPU::S_ANDN2_B32_term
|
|
: AMDGPU::S_ANDN2_B64_term),
|
|
AndSaveExecOpc(IsWave32 ? AMDGPU::S_AND_SAVEEXEC_B32
|
|
: AMDGPU::S_AND_SAVEEXEC_B64),
|
|
AndSaveExecTermOpc(IsWave32 ? AMDGPU::S_AND_SAVEEXEC_B32_term
|
|
: AMDGPU::S_AND_SAVEEXEC_B64_term),
|
|
BfmOpc(IsWave32 ? AMDGPU::S_BFM_B32 : AMDGPU::S_BFM_B64),
|
|
CMovOpc(IsWave32 ? AMDGPU::S_CMOV_B32 : AMDGPU::S_CMOV_B64),
|
|
CSelectOpc(IsWave32 ? AMDGPU::S_CSELECT_B32 : AMDGPU::S_CSELECT_B64),
|
|
MovOpc(IsWave32 ? AMDGPU::S_MOV_B32 : AMDGPU::S_MOV_B64),
|
|
MovTermOpc(IsWave32 ? AMDGPU::S_MOV_B32_term : AMDGPU::S_MOV_B64_term),
|
|
OrOpc(IsWave32 ? AMDGPU::S_OR_B32 : AMDGPU::S_OR_B64),
|
|
OrN2Opc(IsWave32 ? AMDGPU::S_ORN2_B32 : AMDGPU::S_ORN2_B64),
|
|
OrTermOpc(IsWave32 ? AMDGPU::S_OR_B32_term : AMDGPU::S_OR_B64_term),
|
|
OrSaveExecOpc(IsWave32 ? AMDGPU::S_OR_SAVEEXEC_B32
|
|
: AMDGPU::S_OR_SAVEEXEC_B64),
|
|
XorOpc(IsWave32 ? AMDGPU::S_XOR_B32 : AMDGPU::S_XOR_B64),
|
|
XorTermOpc(IsWave32 ? AMDGPU::S_XOR_B32_term : AMDGPU::S_XOR_B64_term),
|
|
WQMOpc(IsWave32 ? AMDGPU::S_WQM_B32 : AMDGPU::S_WQM_B64) {}
|
|
|
|
static inline const LaneMaskConstants &get(const GCNSubtarget &ST);
|
|
};
|
|
|
|
static constexpr LaneMaskConstants LaneMaskConstants32 =
|
|
LaneMaskConstants(/*IsWave32=*/true);
|
|
static constexpr LaneMaskConstants LaneMaskConstants64 =
|
|
LaneMaskConstants(/*IsWave32=*/false);
|
|
|
|
inline const LaneMaskConstants &LaneMaskConstants::get(const GCNSubtarget &ST) {
|
|
unsigned WavefrontSize = ST.getWavefrontSize();
|
|
assert(WavefrontSize == 32 || WavefrontSize == 64);
|
|
return WavefrontSize == 32 ? LaneMaskConstants32 : LaneMaskConstants64;
|
|
}
|
|
|
|
} // end namespace AMDGPU
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPULANEMASKUTILS_H
|