mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-20 08:39:58 -04:00
21 lines
600 B
C++
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
|