diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/reg_alloc.cpp | 10 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/reg_alloc.h | 10 |
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 | ||
| 11 | namespace Shader::IR { | 12 | namespace Shader::IR { |
| @@ -18,9 +19,12 @@ namespace Shader::Backend::GLASM { | |||
| 18 | class EmitContext; | 19 | class EmitContext; |
| 19 | 20 | ||
| 20 | struct Id { | 21 | struct 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 | ||
| 26 | class RegAlloc { | 30 | class RegAlloc { |