Commit graph

3504 commits

Author SHA1 Message Date
Dragios
7d74f8cf47 CPU JIT Part 2 (#20)
* ARM/Decoder: Initial implementation

* JitX64: Implement register allocator

* JitX64: Initial implementation of JitX64 compiler

* JitX64: Add accessors for ARMul_State::exclusive_tag and ARMul_State::exclusive_state

* JitX64: Implement ARM_Jit

ARM_Jit is the ARM_Interface for the x64 recompiler.

* tests: Infrastructure for unit tests

* dyncom: Implement Arm_DynCom::ClearCache()

* tests/JitX64: Fuzz ARM data processing instructions

* JitX64: Implement ARM_Jit::ClearCache()

* JitX64: Implement ADC_imm

* JitX64: Implement immediate data processing instructions

* fixup! Arm/ArmDecoder: Address comments regarding the arm decoder and check versions of all arm instructions

* fixup! Builds on OS X now

* fixup! Fix bugs in thumb decoder & have it use boost::optional

* JitX64/RegAlloc: Improve documentation and improve method names

* tests/JitX64: Improve tests

* tests/JitX64: Add tests for testing data processing instructions with Rd=R15

* fixup! JitX64/RegAlloc: Rename member functions to (Lock|Bind)ArmFor(Read|ReadWrite|Write).

* fixup! Addressed comments regarding JitX64::JitX64

* fixup! tests/JitX64: Address comments

* tests/JitX64: Initial thumb tests

* Common: Add MathUtil::SignExtend

* ARM_Disasm: Disassemble BLX

* JitX64: Implement branch instructions

* JitX64: Implement 32-bit thumb BL(X) instruction

* JitX64: Data Processing: Implement shift-by-immediate (_reg) instructions

* JitX64: Data Processing: Implement shift-by-register (_rsr) instructions

* x64 ABI: Be explicit about Gen:: namespace

* MMIO: UnmapRegion

* JitX64: Implement load/store instructions

* JitX64: Implement load and store multiple

* JitX64: Implement SETEND

* tests/JitX64: Improve thumb instruction test coverage

* fixup! Fix non-MSVC builds

* JitX64: Load/Store: Add UNPREDICTABLE ASSERTs, correct LDR R15 behavior

* tests/JitX64: Fix thumb tests

* JitX64: Implement synchronisation instructions

* JitX64: Implement exception-generating instructions

* ARM_Jit: ClearCache upon construct

* ARM/Decoder: Fill out more instructions

* JitX64: Removed old page table code

* fixup! ARM/Decoder: Various fixes

* Use C++14 std::integer_sequence.
* Split ArmDecoder::Instruction into ArmInstruction and ThumbInstruction
* Make Cond, Register, ShiftType and SignExtendRotation enum classes.
* ThumbMatcher is no longer allocated on the heap.
* JitX64::CondManager now uses Cond instead of SkyEye's ConditionCode.
* Add utility functions IsArmRegValid and MakeArmRegList.

* fixup! ARM/Decoder: Misc fixes

* fixup! Common: Move SignExtend and bits into BitUtil

* fixup! arm_dyncom_interpreter

* fixup! JitState: Should be final and should have initial values

* fixup! Make JitX64::CondManager::CurrentCond() const

* fixup! JitX64: Move thumb_BLX_* variables below ArmDecoder::Visitor functions

* fixup! RegAlloc: Simplify code

* fixup! MMIO: UnmapRegion

* fixup! Tests/JitX64: Use std::generate_n and factor pass-testing into DoesBehaviorMatch

* fixup! JitX64::LocationDescriptorHash: Use static_cast

* fixup! JitX64: Default values for primitive members

* fixup! JitX64: Add const to relevant member functions, add initialisers to members of CondManager

* fixup! Jit: Remove unnecessary headers

* fixup! RunJittedCode: Remove C-style casts

* fixup! Common: Common::make_unique -> std::make_unique

* fixup! BitUtils

* fixup! JitX64: reinterpret_cast<const void* const> -> reinterpret_cast<const void*>

* fixup! static -> inline in headers, moved instruction/helper/load_store.h function bodies into .cpp file

* fixup! Move public interface of JitX64 class to the top

* fixup! Rename JitX64::UpdateFlags* so flag names are in order (N, Z, C, V)

* fixup! BitUtil: Correct error messages, independent impl of Bit, correct SignExtend logic
2016-04-16 01:49:30 +08:00
Dragios
58934192df Implement one variant of pipe 3 (#19) 2016-04-16 01:48:49 +08:00
Dragios
a9c502c972 Audio Core (#18)
* DSP: Implement Pipe 2

Pipe 2 is a DSP pipe that is used to initialize both the DSP hardware (the
application signals to the DSP to initialize) and the application (the DSP
provides the memory location of structures in the shared memory region).

* AudioCore: Implement codecs (DecodeADPCM, DecodePCM8, DecodePCM16)

* DSP Pipes: Implement as FIFO

* AudioCore: File structure

* AudioCore: More structure

* AudioCore: Buffer management

* DSP/Source: Reorganise Source's AdvanceFrame.

* Audio Output

* lolidk

* huh?

* interp

* More interp stuff

* oops

* Zero State

* Don't mix Source frame if it's not enabled

* DSP: Forgot to zero a buffer, adjusted thread synchronisation, adjusted format spec for buffers

* asdf

* Get it to compile and tweak stretching a bit.

* revert stretch test

* deleted accidental partial catch submodule commit

* new audio stretching algorithm

* update .gitmodule

* fix OS X build

* remove getopt from rubberband

* #include <stddef> to audio_core.h

* typo

* -framework Accelerate

* OptionTransientsSmooth -> OptionTransientsCrisp

* tweak stretch tempo smoothing coefficient. also switch back to smooth.

* tweak mroe

* remove printf

* sola

* #include <cmath>

* VERY QUICK MERGE TO GET IT WORKING DOESN'T ACTIVATE AUDIO FILTERS

* Reminder to self

* fix comparison

* common/thread: Correct code style

* Thread: Make Barrier reusable

* fix threading synchonisation code

* add profiling code

* print error to console when audio clips

* fix metallic sound

* reduce logspam
2016-04-16 01:48:14 +08:00
Dragios
d159f43cf3 WIP (#17) 2016-04-16 01:43:46 +08:00
Dragios
074ad7e9ef Y2R PR cleanup (#16)
* Update the code of service y2r!

* Cleanup
2016-04-16 01:41:08 +08:00
Dragios
47ce9f29f3 OpenGL: Implement color combiner Operation::Dot3_RGB (#15) 2016-04-16 01:40:22 +08:00
Dragios
d6c9d5b4f1 New GS refactor (#14)
* Turn ShaderSetup into a class

* Cleanup ShaderSetup

* Replace logic in shader.cpp with loop

* Rename 'VertexLoaded' breakpoint to 'Vertex shader invocation'

* Prepare Pica regs for GS

* Make shader code less VS-specific

* Only check for enabled JIT in Setup() to avoid race conditions

* Write shader registers in functions

* Write GS registers

* Implement EMIT and SETEMIT

* Implement 4 shader units and geometry shaders
2016-04-16 01:39:34 +08:00
Dragios
c7032066b8 Implement w-buffer (#13)
* Pica: Implement W-Buffer in SW rasterizer

* OpenGL: Implement W-Buffers and fix depth-mapping
2016-04-16 01:38:13 +08:00
Dragios
28f64f98f7 Revert "Audio Core (#2)"
This reverts commit a8d0c51c69.
2016-04-16 01:32:48 +08:00
Dragios
69effbcb6e Revert "Implement one variant of pipe 3 (#3)"
This reverts commit 6f91fef9f1.
2016-04-16 01:32:45 +08:00
Dragios
5d6f907e57 Revert "CPU JIT Part 2 (#4)"
This reverts commit 468a001a81.
2016-04-16 01:32:42 +08:00
Dragios
8c0256d95c Revert "WIP (#5)"
This reverts commit 8cecbb5231.
2016-04-16 01:32:38 +08:00
Dragios
373a925693 Revert "Buffer allow read (#7)"
This reverts commit e2f444394f.
2016-04-16 01:32:36 +08:00
Dragios
1108438607 Revert "New GS refactor (#8)"
This reverts commit 10272dd541.
2016-04-16 01:32:33 +08:00
Dragios
8be067ae29 Revert "OpenGL: Implement color combiner Operation::Dot3_RGB (#10)"
This reverts commit 9e5e2cca88.
2016-04-16 01:32:25 +08:00
Dragios
40074584ca Revert "Y2R PR cleanup (#11)"
This reverts commit be43acf3d3.
2016-04-16 01:32:18 +08:00
Dragios
be43acf3d3 Y2R PR cleanup (#11)
* Update the code of service y2r!

* Cleanup
2016-04-16 01:20:07 +08:00
Dragios
9e5e2cca88 OpenGL: Implement color combiner Operation::Dot3_RGB (#10) 2016-04-16 01:19:05 +08:00
Dragios
10272dd541 New GS refactor (#8)
* Turn ShaderSetup into a class

* Cleanup ShaderSetup

* Replace logic in shader.cpp with loop

* Rename 'VertexLoaded' breakpoint to 'Vertex shader invocation'

* Prepare Pica regs for GS

* Make shader code less VS-specific

* Only check for enabled JIT in Setup() to avoid race conditions

* Write shader registers in functions

* Write GS registers

* Implement EMIT and SETEMIT

* Implement 4 shader units and geometry shaders
2016-04-16 01:17:59 +08:00
Dragios
e2f444394f Buffer allow read (#7)
* Rasterizer: Implement W-Buffer

* Fix ftoi and disable VFPv3

* removeme-debug-hw-depth-print

* GL: Fix HW depth-buffering

* Rasterizer: Respect buffer-read allow registers

* OpenGL: Respect color-read allow register

* OpenGL: Respect depth-read allow register

* OpenGL: Respect stencil-read allow register
2016-04-16 01:17:00 +08:00
Dragios
8cecbb5231 WIP (#5) 2016-04-16 01:15:29 +08:00
Dragios
468a001a81 CPU JIT Part 2 (#4)
* ARM/Decoder: Initial implementation

* JitX64: Implement register allocator

* JitX64: Initial implementation of JitX64 compiler

* JitX64: Add accessors for ARMul_State::exclusive_tag and ARMul_State::exclusive_state

* JitX64: Implement ARM_Jit

ARM_Jit is the ARM_Interface for the x64 recompiler.

* tests: Infrastructure for unit tests

* dyncom: Implement Arm_DynCom::ClearCache()

* tests/JitX64: Fuzz ARM data processing instructions

* JitX64: Implement ARM_Jit::ClearCache()

* JitX64: Implement ADC_imm

* JitX64: Implement immediate data processing instructions

* fixup! Arm/ArmDecoder: Address comments regarding the arm decoder and check versions of all arm instructions

* fixup! Builds on OS X now

* fixup! Fix bugs in thumb decoder & have it use boost::optional

* JitX64/RegAlloc: Improve documentation and improve method names

* tests/JitX64: Improve tests

* tests/JitX64: Add tests for testing data processing instructions with Rd=R15

* fixup! JitX64/RegAlloc: Rename member functions to (Lock|Bind)ArmFor(Read|ReadWrite|Write).

* fixup! Addressed comments regarding JitX64::JitX64

* fixup! tests/JitX64: Address comments

* tests/JitX64: Initial thumb tests

* Common: Add MathUtil::SignExtend

* ARM_Disasm: Disassemble BLX

* JitX64: Implement branch instructions

* JitX64: Implement 32-bit thumb BL(X) instruction

* JitX64: Data Processing: Implement shift-by-immediate (_reg) instructions

* JitX64: Data Processing: Implement shift-by-register (_rsr) instructions

* x64 ABI: Be explicit about Gen:: namespace

* MMIO: UnmapRegion

* JitX64: Implement load/store instructions

* JitX64: Implement load and store multiple

* JitX64: Implement SETEND

* tests/JitX64: Improve thumb instruction test coverage

* fixup! Fix non-MSVC builds

* JitX64: Load/Store: Add UNPREDICTABLE ASSERTs, correct LDR R15 behavior

* tests/JitX64: Fix thumb tests

* JitX64: Implement synchronisation instructions

* JitX64: Implement exception-generating instructions

* ARM_Jit: ClearCache upon construct

* ARM/Decoder: Fill out more instructions

* JitX64: Removed old page table code

* fixup! ARM/Decoder: Various fixes

* Use C++14 std::integer_sequence.
* Split ArmDecoder::Instruction into ArmInstruction and ThumbInstruction
* Make Cond, Register, ShiftType and SignExtendRotation enum classes.
* ThumbMatcher is no longer allocated on the heap.
* JitX64::CondManager now uses Cond instead of SkyEye's ConditionCode.
* Add utility functions IsArmRegValid and MakeArmRegList.

* fixup! ARM/Decoder: Misc fixes

* fixup! Common: Move SignExtend and bits into BitUtil

* fixup! arm_dyncom_interpreter

* fixup! JitState: Should be final and should have initial values

* fixup! Make JitX64::CondManager::CurrentCond() const

* fixup! JitX64: Move thumb_BLX_* variables below ArmDecoder::Visitor functions

* fixup! RegAlloc: Simplify code

* fixup! MMIO: UnmapRegion

* fixup! Tests/JitX64: Use std::generate_n and factor pass-testing into DoesBehaviorMatch

* fixup! JitX64::LocationDescriptorHash: Use static_cast

* fixup! JitX64: Default values for primitive members

* fixup! JitX64: Add const to relevant member functions, add initialisers to members of CondManager

* fixup! Jit: Remove unnecessary headers

* fixup! RunJittedCode: Remove C-style casts

* fixup! Common: Common::make_unique -> std::make_unique

* fixup! BitUtils

* fixup! JitX64: reinterpret_cast<const void* const> -> reinterpret_cast<const void*>

* fixup! static -> inline in headers, moved instruction/helper/load_store.h function bodies into .cpp file

* fixup! Move public interface of JitX64 class to the top

* fixup! Rename JitX64::UpdateFlags* so flag names are in order (N, Z, C, V)

* fixup! BitUtil: Correct error messages, independent impl of Bit, correct SignExtend logic
2016-04-16 01:12:27 +08:00
Dragios
6f91fef9f1 Implement one variant of pipe 3 (#3) 2016-04-16 01:11:38 +08:00
Dragios
a8d0c51c69 Audio Core (#2)
* DSP: Implement Pipe 2

Pipe 2 is a DSP pipe that is used to initialize both the DSP hardware (the
application signals to the DSP to initialize) and the application (the DSP
provides the memory location of structures in the shared memory region).

* AudioCore: Implement codecs (DecodeADPCM, DecodePCM8, DecodePCM16)

* DSP Pipes: Implement as FIFO

* AudioCore: File structure

* AudioCore: More structure

* AudioCore: Buffer management

* DSP/Source: Reorganise Source's AdvanceFrame.

* Audio Output

* lolidk

* huh?

* interp

* More interp stuff

* oops

* Zero State

* Don't mix Source frame if it's not enabled

* DSP: Forgot to zero a buffer, adjusted thread synchronisation, adjusted format spec for buffers

* asdf

* Get it to compile and tweak stretching a bit.

* revert stretch test

* deleted accidental partial catch submodule commit

* new audio stretching algorithm

* update .gitmodule

* fix OS X build

* remove getopt from rubberband

* #include <stddef> to audio_core.h

* typo

* -framework Accelerate

* OptionTransientsSmooth -> OptionTransientsCrisp

* tweak stretch tempo smoothing coefficient. also switch back to smooth.

* tweak mroe

* remove printf

* sola

* #include <cmath>

* VERY QUICK MERGE TO GET IT WORKING DOESN'T ACTIVATE AUDIO FILTERS

* Reminder to self

* fix comparison

* common/thread: Correct code style

* Thread: Make Barrier reusable

* fix threading synchonisation code

* add profiling code

* print error to console when audio clips

* fix metallic sound

* reduce logspam
2016-04-16 01:10:29 +08:00
bunnei
7805f66784 Merge pull request #1673 from MerryMage/config-minimumSize
Configure Dialog: Remove minimumSize property
2016-04-15 10:00:58 -04:00
Mathew Maidment
d496969c9c Merge pull request #1671 from lioncash/mem
debug_utils: use std::make_unique for initializing PicaTrace
2016-04-15 07:37:10 -04:00
MerryMage
fd771d7a87 Configure Dialog: Remove minimumSize property 2016-04-15 11:34:08 +01:00
JamePeng
8d5a6110f7 Y2R: num_tiles should be allowed when its value is 128 (#1669) 2016-04-14 21:36:07 -07:00
Lioncash
4501a9eb50 debug_utils: use std::make_unique for initializing PicaTrace 2016-04-14 22:05:28 -04:00
bunnei
23f967b0af Merge pull request #1666 from MerryMage/barrier
Thread: Correct Common::Barrier implementation
2016-04-14 22:03:17 -04:00
bunnei
aff35d3e58 Merge pull request #1665 from lioncash/file
IOFile: Minor API changes
2016-04-14 16:28:15 -04:00
MerryMage
3c710f9b10 Thread: Make Barrier reusable 2016-04-14 13:59:58 +01:00
MerryMage
8c50833445 common/thread: Correct code style 2016-04-14 13:58:28 +01:00
bunnei
d89e48679e Merge pull request #1546 from bunnei/refactor-shader-jit
Shader JIT Part 2
2016-04-13 23:36:39 -04:00
bunnei
d7fe2784cc shader_jit_x64: Rename RuntimeAssert to Compile_Assert. 2016-04-13 23:04:53 -04:00
bunnei
3f623b2561 shader_jit_x64.cpp: Rename JitCompiler to JitShader. 2016-04-13 23:04:53 -04:00
bunnei
847fb951e2 shader_jit_x64: Free memory that's no longer needed after compilation. 2016-04-13 23:04:52 -04:00
bunnei
60aa72e117 shader_jit_x64: Use a sorted vector instead of a set for keeping track of return addresses. 2016-04-13 23:04:52 -04:00
bunnei
60749f2cda shader_jit_x64: Use CALL/RET instead of JMP for subroutines. 2016-04-13 23:04:52 -04:00
bunnei
507e0b5989 emitter: Add CALL that can be fixed up. 2016-04-13 23:04:50 -04:00
bunnei
1d45b57939 shader_jit_x64: Separate initialization and code generation for readability. 2016-04-13 23:04:50 -04:00
bunnei
6e0319eec9 shader_jit_x64: Get rid of unnecessary last_program_counter variable. 2016-04-13 23:04:49 -04:00
bunnei
f3afe24594 shader_jit_x64: Execute certain asserts at runtime.
- This is because we compile the full shader code space, and therefore its common to compile malformed instructions.
2016-04-13 23:04:49 -04:00
bunnei
ffcf7ecee9 shader: Remove unused 'state' argument from 'Setup' function. 2016-04-13 23:04:48 -04:00
bunnei
a5a74eb121 shader_jit_x64: Specify shader main offset at runtime. 2016-04-13 23:04:47 -04:00
bunnei
c9d10de644 shader_jit_x64: Allocate each program independently and persist for emu session. 2016-04-13 23:04:47 -04:00
bunnei
4632791a40 shader_jit_x64: Rewrite flow control to support arbitrary CALL and JMP instructions. 2016-04-13 23:04:44 -04:00
bunnei
135aec7bea shader_jit_x64: Fix strict memory aliasing issues. 2016-04-13 23:04:43 -04:00
bunnei
e5d417213c emitter: Support arbitrary FixupBranch targets. 2016-04-13 23:04:42 -04:00
Lioncash
5f51622e9d file_util: In-class initialize data members 2016-04-13 20:17:24 -04:00