summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-08 16:28:52 -0300
committerGravatar ameerj2021-07-22 21:51:30 -0400
commit6fd190d1ae4275a06ed2e488401e1d63912954be (patch)
treeece4681d18c7b0b5bcb6b540ea4a21b32c19b363 /src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp
parentglasm: Changes to GLASM register allocator and emit context (diff)
downloadyuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.tar.gz
yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.tar.xz
yuzu-6fd190d1ae4275a06ed2e488401e1d63912954be.zip
glasm: Implement basic GLASM instructions
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp228
1 files changed, 228 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp
index e69de29bb..e228fa072 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp
@@ -0,0 +1,228 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <string_view>
6
7#include "shader_recompiler/backend/glasm/emit_context.h"
8#include "shader_recompiler/backend/glasm/emit_glasm_instructions.h"
9#include "shader_recompiler/frontend/ir/value.h"
10
11namespace Shader::Backend::GLASM {
12
13void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
14 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
15 throw NotImplementedException("GLASM instruction");
16}
17
18void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
19 [[maybe_unused]] std::string_view b) {
20 throw NotImplementedException("GLASM instruction");
21}
22
23void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
24 [[maybe_unused]] std::string_view b) {
25 throw NotImplementedException("GLASM instruction");
26}
27
28void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
29 [[maybe_unused]] std::string_view b) {
30 throw NotImplementedException("GLASM instruction");
31}
32
33void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
34 [[maybe_unused]] std::string_view b) {
35 throw NotImplementedException("GLASM instruction");
36}
37
38void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
39 throw NotImplementedException("GLASM instruction");
40}
41
42void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
43 throw NotImplementedException("GLASM instruction");
44}
45
46void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
47 throw NotImplementedException("GLASM instruction");
48}
49
50void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
51 throw NotImplementedException("GLASM instruction");
52}
53
54void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx,
55 [[maybe_unused]] std::string_view base,
56 [[maybe_unused]] std::string_view shift) {
57 throw NotImplementedException("GLASM instruction");
58}
59
60void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx,
61 [[maybe_unused]] std::string_view base,
62 [[maybe_unused]] std::string_view shift) {
63 throw NotImplementedException("GLASM instruction");
64}
65
66void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx,
67 [[maybe_unused]] std::string_view base,
68 [[maybe_unused]] std::string_view shift) {
69 throw NotImplementedException("GLASM instruction");
70}
71
72void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx,
73 [[maybe_unused]] std::string_view base,
74 [[maybe_unused]] std::string_view shift) {
75 throw NotImplementedException("GLASM instruction");
76}
77
78void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx,
79 [[maybe_unused]] std::string_view base,
80 [[maybe_unused]] std::string_view shift) {
81 throw NotImplementedException("GLASM instruction");
82}
83
84void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx,
85 [[maybe_unused]] std::string_view base,
86 [[maybe_unused]] std::string_view shift) {
87 throw NotImplementedException("GLASM instruction");
88}
89
90void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
91 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
92 throw NotImplementedException("GLASM instruction");
93}
94
95void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
96 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
97 throw NotImplementedException("GLASM instruction");
98}
99
100void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
101 [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) {
102 throw NotImplementedException("GLASM instruction");
103}
104
105void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view base,
106 [[maybe_unused]] std::string_view insert,
107 [[maybe_unused]] std::string_view offset,
108 [[maybe_unused]] std::string_view count) {
109 throw NotImplementedException("GLASM instruction");
110}
111
112void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
113 [[maybe_unused]] std::string_view base,
114 [[maybe_unused]] std::string_view offset,
115 [[maybe_unused]] std::string_view count) {
116 throw NotImplementedException("GLASM instruction");
117}
118
119void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
120 [[maybe_unused]] std::string_view base,
121 [[maybe_unused]] std::string_view offset,
122 [[maybe_unused]] std::string_view count) {
123 throw NotImplementedException("GLASM instruction");
124}
125
126void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
127 throw NotImplementedException("GLASM instruction");
128}
129
130void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
131 throw NotImplementedException("GLASM instruction");
132}
133
134void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
135 throw NotImplementedException("GLASM instruction");
136}
137
138void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
139 throw NotImplementedException("GLASM instruction");
140}
141
142void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view value) {
143 throw NotImplementedException("GLASM instruction");
144}
145
146void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
147 [[maybe_unused]] std::string_view b) {
148 throw NotImplementedException("GLASM instruction");
149}
150
151void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
152 [[maybe_unused]] std::string_view b) {
153 throw NotImplementedException("GLASM instruction");
154}
155
156void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
157 [[maybe_unused]] std::string_view b) {
158 throw NotImplementedException("GLASM instruction");
159}
160
161void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view a,
162 [[maybe_unused]] std::string_view b) {
163 throw NotImplementedException("GLASM instruction");
164}
165
166void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
167 [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min,
168 [[maybe_unused]] std::string_view max) {
169 throw NotImplementedException("GLASM instruction");
170}
171
172void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
173 [[maybe_unused]] std::string_view value, [[maybe_unused]] std::string_view min,
174 [[maybe_unused]] std::string_view max) {
175 throw NotImplementedException("GLASM instruction");
176}
177
178void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
179 [[maybe_unused]] std::string_view rhs) {
180 throw NotImplementedException("GLASM instruction");
181}
182
183void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
184 [[maybe_unused]] std::string_view rhs) {
185 throw NotImplementedException("GLASM instruction");
186}
187
188void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
189 [[maybe_unused]] std::string_view rhs) {
190 throw NotImplementedException("GLASM instruction");
191}
192
193void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
194 [[maybe_unused]] std::string_view rhs) {
195 throw NotImplementedException("GLASM instruction");
196}
197
198void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
199 [[maybe_unused]] std::string_view rhs) {
200 throw NotImplementedException("GLASM instruction");
201}
202
203void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
204 [[maybe_unused]] std::string_view rhs) {
205 throw NotImplementedException("GLASM instruction");
206}
207
208void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
209 [[maybe_unused]] std::string_view rhs) {
210 throw NotImplementedException("GLASM instruction");
211}
212
213void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
214 [[maybe_unused]] std::string_view rhs) {
215 throw NotImplementedException("GLASM instruction");
216}
217
218void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
219 [[maybe_unused]] std::string_view rhs) {
220 throw NotImplementedException("GLASM instruction");
221}
222
223void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view lhs,
224 [[maybe_unused]] std::string_view rhs) {
225 throw NotImplementedException("GLASM instruction");
226}
227
228} // namespace Shader::Backend::GLASM