diff options
| author | 2015-08-16 17:22:49 +0200 | |
|---|---|---|
| committer | 2015-08-17 01:12:34 +0200 | |
| commit | 7d3a6016d64eea0e523fe35bb61070a0268900f7 (patch) | |
| tree | b7ecaefd2c0dea92411bbeee4db22d30170a7040 /src | |
| parent | Shader: implement EX2 and LG2 in interpreter (diff) | |
| download | yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.gz yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.tar.xz yuzu-7d3a6016d64eea0e523fe35bb61070a0268900f7.zip | |
Shader: implement EX2 and LG2 in JIT
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_jit_x64.cpp | 22 | ||||
| -rw-r--r-- | src/video_core/shader/shader_jit_x64.h | 2 |
2 files changed, 22 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] = { | |||
| 25 | &JitCompiler::Compile_DP4, // dp4 | 25 | &JitCompiler::Compile_DP4, // dp4 |
| 26 | nullptr, // dph | 26 | nullptr, // dph |
| 27 | nullptr, // unknown | 27 | nullptr, // unknown |
| 28 | nullptr, // ex2 | 28 | &JitCompiler::Compile_EX2, // ex2 |
| 29 | nullptr, // lg2 | 29 | &JitCompiler::Compile_LG2, // lg2 |
| 30 | nullptr, // unknown | 30 | nullptr, // unknown |
| 31 | &JitCompiler::Compile_MUL, // mul | 31 | &JitCompiler::Compile_MUL, // mul |
| 32 | nullptr, // lge | 32 | nullptr, // lge |
| @@ -331,6 +331,24 @@ void JitCompiler::Compile_DP4(Instruction instr) { | |||
| 331 | Compile_DestEnable(instr, SRC1); | 331 | Compile_DestEnable(instr, SRC1); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | void JitCompiler::Compile_EX2(Instruction instr) { | ||
| 335 | Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); | ||
| 336 | MOVSS(XMM0, R(SRC1)); | ||
| 337 | ABI_CallFunction(reinterpret_cast<const void*>(exp2f)); | ||
| 338 | SHUFPS(XMM0, R(XMM0), _MM_SHUFFLE(0, 0, 0, 0)); | ||
| 339 | MOVAPS(SRC1, R(XMM0)); | ||
| 340 | Compile_DestEnable(instr, SRC1); | ||
| 341 | } | ||
| 342 | |||
| 343 | void JitCompiler::Compile_LG2(Instruction instr) { | ||
| 344 | Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); | ||
| 345 | MOVSS(XMM0, R(SRC1)); | ||
| 346 | ABI_CallFunction(reinterpret_cast<const void*>(log2f)); | ||
| 347 | SHUFPS(XMM0, R(XMM0), _MM_SHUFFLE(0, 0, 0, 0)); | ||
| 348 | MOVAPS(SRC1, R(XMM0)); | ||
| 349 | Compile_DestEnable(instr, SRC1); | ||
| 350 | } | ||
| 351 | |||
| 334 | void JitCompiler::Compile_MUL(Instruction instr) { | 352 | void JitCompiler::Compile_MUL(Instruction instr) { |
| 335 | Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); | 353 | Compile_SwizzleSrc(instr, 1, instr.common.src1, SRC1); |
| 336 | Compile_SwizzleSrc(instr, 2, instr.common.src2, SRC2); | 354 | Compile_SwizzleSrc(instr, 2, instr.common.src2, SRC2); |
diff --git a/src/video_core/shader/shader_jit_x64.h b/src/video_core/shader/shader_jit_x64.h index b88f2a0d2..104f9f466 100644 --- a/src/video_core/shader/shader_jit_x64.h +++ b/src/video_core/shader/shader_jit_x64.h | |||
| @@ -37,6 +37,8 @@ public: | |||
| 37 | void Compile_ADD(Instruction instr); | 37 | void Compile_ADD(Instruction instr); |
| 38 | void Compile_DP3(Instruction instr); | 38 | void Compile_DP3(Instruction instr); |
| 39 | void Compile_DP4(Instruction instr); | 39 | void Compile_DP4(Instruction instr); |
| 40 | void Compile_EX2(Instruction instr); | ||
| 41 | void Compile_LG2(Instruction instr); | ||
| 40 | void Compile_MUL(Instruction instr); | 42 | void Compile_MUL(Instruction instr); |
| 41 | void Compile_FLR(Instruction instr); | 43 | void Compile_FLR(Instruction instr); |
| 42 | void Compile_MAX(Instruction instr); | 44 | void Compile_MAX(Instruction instr); |