emit_glasm_logical.cpp 842 B

1234567891011121314151617181920212223242526
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h"
  5. #include "shader_recompiler/backend/glasm/glasm_emit_context.h"
  6. namespace Shader::Backend::GLASM {
  7. void EmitLogicalOr(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) {
  8. ctx.Add("OR.S {},{},{};", inst, a, b);
  9. }
  10. void EmitLogicalAnd(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) {
  11. ctx.Add("AND.S {},{},{};", inst, a, b);
  12. }
  13. void EmitLogicalXor(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b) {
  14. ctx.Add("XOR.S {},{},{};", inst, a, b);
  15. }
  16. void EmitLogicalNot(EmitContext& ctx, IR::Inst& inst, ScalarS32 value) {
  17. ctx.Add("SEQ.S {},{},0;", inst, value);
  18. }
  19. } // namespace Shader::Backend::GLASM