summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorGravatar ameerj2021-03-28 22:23:45 -0400
committerGravatar ameerj2021-07-22 21:51:25 -0400
commit6c51f496320f698e123207c09ca61e55180a31b5 (patch)
treec5ecbbce29797fd7ba3138e11f9c364899375e2b /src/shader_recompiler/frontend/ir
parentshader: Implement BRX (diff)
downloadyuzu-6c51f496320f698e123207c09ca61e55180a31b5.tar.gz
yuzu-6c51f496320f698e123207c09ca61e55180a31b5.tar.xz
yuzu-6c51f496320f698e123207c09ca61e55180a31b5.zip
shader: Implement FSWZADD
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp3
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h2
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 552472487..505fba46a 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -1602,4 +1602,7 @@ U32 IREmitter::ShuffleButterfly(const IR::U32& value, const IR::U32& index, cons
1602 const IR::U32& seg_mask) { 1602 const IR::U32& seg_mask) {
1603 return Inst<U32>(Opcode::ShuffleButterfly, value, index, clamp, seg_mask); 1603 return Inst<U32>(Opcode::ShuffleButterfly, value, index, clamp, seg_mask);
1604} 1604}
1605F32 IREmitter::FSwizzleAdd(const F32& a, const F32& b, const U32& swizzle, FpControl control) {
1606 return Inst<F32>(Opcode::FSwizzleAdd, Flags{control}, a, b, swizzle);
1607}
1605} // namespace Shader::IR 1608} // namespace Shader::IR
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 17bc32fc8..8f3325738 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -277,6 +277,8 @@ public:
277 const IR::U32& seg_mask); 277 const IR::U32& seg_mask);
278 [[nodiscard]] U32 ShuffleButterfly(const IR::U32& value, const IR::U32& index, 278 [[nodiscard]] U32 ShuffleButterfly(const IR::U32& value, const IR::U32& index,
279 const IR::U32& clamp, const IR::U32& seg_mask); 279 const IR::U32& clamp, const IR::U32& seg_mask);
280 [[nodiscard]] F32 FSwizzleAdd(const F32& a, const F32& b, const U32& swizzle,
281 FpControl control = {});
280 282
281private: 283private:
282 IR::Block::iterator insertion_point; 284 IR::Block::iterator insertion_point;
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index fb79e3d8d..717aa71ca 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -408,3 +408,4 @@ OPCODE(ShuffleIndex, U32, U32,
408OPCODE(ShuffleUp, U32, U32, U32, U32, U32, ) 408OPCODE(ShuffleUp, U32, U32, U32, U32, U32, )
409OPCODE(ShuffleDown, U32, U32, U32, U32, U32, ) 409OPCODE(ShuffleDown, U32, U32, U32, U32, U32, )
410OPCODE(ShuffleButterfly, U32, U32, U32, U32, U32, ) 410OPCODE(ShuffleButterfly, U32, U32, U32, U32, U32, )
411OPCODE(FSwizzleAdd, F32, F32, F32, U32, )