Files
Triforce-Source/gpu/vk/eden/shader_recompiler/frontend/ampere/instruction.h
ruckus7382sfgsgdf 34b3683441 Triforce v0.2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:32:48 -06:00

21 lines
600 B
C++

// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <array>
#include "common/common_types.h"
namespace Shader::Ampere {
struct Instruction {
std::array<u32, 4> words;
u32 Bits(u32 offset, u32 count) const {
u64 bits = words[offset / 32];
if (offset / 32 + 1 < words.size())
bits |= u64{words[offset / 32 + 1]} << 32;
return static_cast<u32>((bits >> (offset % 32)) & ((u64{1} << count) - 1));
}
};
static_assert(sizeof(Instruction) == 16);
} // namespace Shader::Ampere