summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-08 16:46:32 -0300
committerGravatar ameerj2021-07-22 21:51:30 -0400
commit3e841f6441903c6e97307dd49a2543ce82654044 (patch)
treed6fb26667d43589b17aba1c51017c420c5b2696c /src/shader_recompiler/backend
parentglasm: Remove unused argument in identity instructions on GLASM (diff)
downloadyuzu-3e841f6441903c6e97307dd49a2543ce82654044.tar.gz
yuzu-3e841f6441903c6e97307dd49a2543ce82654044.tar.xz
yuzu-3e841f6441903c6e97307dd49a2543ce82654044.zip
glasm: Use BitField instead of C bitfields
Diffstat (limited to 'src/shader_recompiler/backend')
-rw-r--r--src/shader_recompiler/backend/glasm/reg_alloc.cpp10
-rw-r--r--src/shader_recompiler/backend/glasm/reg_alloc.h10
2 files changed, 12 insertions, 8 deletions
diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.cpp b/src/shader_recompiler/backend/glasm/reg_alloc.cpp
index 55e8107e9..010ad0275 100644
--- a/src/shader_recompiler/backend/glasm/reg_alloc.cpp
+++ b/src/shader_recompiler/backend/glasm/reg_alloc.cpp
@@ -68,11 +68,11 @@ Id RegAlloc::Alloc() {
68 } 68 }
69 num_used_registers = std::max(num_used_registers, reg + 1); 69 num_used_registers = std::max(num_used_registers, reg + 1);
70 register_use[reg] = true; 70 register_use[reg] = true;
71 return Id{ 71 Id ret{};
72 .index = static_cast<u32>(reg), 72 ret.index.Assign(static_cast<u32>(reg));
73 .is_spill = 0, 73 ret.is_spill.Assign(0);
74 .is_condition_code = 0, 74 ret.is_condition_code.Assign(0);
75 }; 75 return ret;
76 } 76 }
77 throw NotImplementedException("Register spilling"); 77 throw NotImplementedException("Register spilling");
78} 78}
diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.h b/src/shader_recompiler/backend/glasm/reg_alloc.h
index 83d728d20..f73aa3348 100644
--- a/src/shader_recompiler/backend/glasm/reg_alloc.h
+++ b/src/shader_recompiler/backend/glasm/reg_alloc.h
@@ -6,6 +6,7 @@
6 6
7#include <bitset> 7#include <bitset>
8 8
9#include "common/bit_field.h"
9#include "common/common_types.h" 10#include "common/common_types.h"
10 11
11namespace Shader::IR { 12namespace Shader::IR {
@@ -18,9 +19,12 @@ namespace Shader::Backend::GLASM {
18class EmitContext; 19class EmitContext;
19 20
20struct Id { 21struct Id {
21 u32 index : 30; 22 union {
22 u32 is_spill : 1; 23 u32 raw;
23 u32 is_condition_code : 1; 24 BitField<0, 30, u32> index;
25 BitField<30, 1, u32> is_spill;
26 BitField<31, 1, u32> is_condition_code;
27 };
24}; 28};
25 29
26class RegAlloc { 30class RegAlloc {