diff options
author | aroulin <andy.roulin@epfl.ch> | 2015-08-16 17:22:49 +0200 |
---|---|---|
committer | aroulin <andy.roulin@epfl.ch> | 2015-08-17 01:12:34 +0200 |
commit | 7d3a6016d64eea0e523fe35bb61070a0268900f7 (patch) | |
tree | b7ecaefd2c0dea92411bbeee4db22d30170a7040 /src/video_core/shader/shader_jit_x64.cpp | |
parent | Shader: implement EX2 and LG2 in interpreter (diff) | |
download | yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.gz yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.bz2 yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.lz yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.xz yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.zst yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/shader_jit_x64.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 836942c6b..93f608584 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -25,8 +25,8 @@ const JitFunction instr_table[64] = { &JitCompiler::Compile_DP4, // dp4 nullptr, // dph nullptr, // unknown - nullptr, // ex2 - nullptr, // lg2 + &JitCompiler::Compile_EX2, // ex2 + &JitCompiler::Compile_LG2, // lg2 nullptr, // unknown &JitCompiler::Compile_MUL, // mul nullptr, // lge @@ -331,6 +331,24 @@ void JitCompiler::Compile_DP4(Instruction instr) { Compile_DestEnable(instr, SRC1); } +void JitCompiler::Compile_EX2(Instruction instr) { + Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); + MOVSS(XMM0, R(SRC1)); + ABI_CallFunction(reinterpret_cast<const void*>(exp2f)); + SHUFPS(XMM0, R(XMM0), _MM_SHUFFLE(0, 0, 0, 0)); + MOVAPS(SRC1, R(XMM0)); + Compile_DestEnable(instr, SRC1); +} + +void JitCompiler::Compile_LG2(Instruction instr) { + Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); + MOVSS(XMM0, R(SRC1)); + ABI_CallFunction(reinterpret_cast<const void*>(log2f)); + SHUFPS(XMM0, R(XMM0), _MM_SHUFFLE(0, 0, 0, 0)); + MOVAPS(SRC1, R(XMM0)); + Compile_DestEnable(instr, SRC1); +} + void JitCompiler::Compile_MUL(Instruction instr) { Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); Compile_SwizzleSrc(instr, 2, instr.common.src2, SRC2); |