2096 Commits

Author SHA1 Message Date
Lioncash
e5d77334f0
A32: Implement ARM-mode CRC32 instructions
Implements the ARM-mode variants of the CRC32 instructions introduced
within ARMv8. This is also one of the instruction cases where there is
UNPREDICTABLE behavior that is constrained (we must do one of the
options indicated by the reference manual).

In both documented cases of constrained unpredictable behavior, we treat
the instructions as unpredictable in order to allow library users to
hook the unpredictable exception to provide the intended behavior they
desire.
2019-05-02 16:22:10 -04:00
Lioncash
fc0ecdf3b1
travis: Make macOS builder use Xcode 10.2
Keeps it targeting the latest Xcode revision.
2019-05-02 11:40:54 -04:00
Lioncash
16a9e3c4d3
dynarmic_tests: Resolve CPSR discrepancies in tests
Unicorn internally checks if the LSB is set in order to determine
whether or not it should assume thumb mode internally. Clearing this
ourselves will always result in the incorrect PSR between runs.
2019-05-02 11:12:36 -04:00
Lioncash
469b6ad90e
A32: Rename vfp2-related files to vfp
Now that we fuzz against Unicorn, we aren't just restricted to VFPv2.
VFPv3 and VFPv4 facilities can now be implemented. This renames
constructs mentioning VFPv2 to just refer to VFP.
2019-05-02 10:25:43 -04:00
Lioncash
74cf752b2c
frontend/ir/ir_emitter: Amend arguments to conversion opcodes
Accidentally caused within 967d1fcc8d6f60749a162a96b997439450fed687.
That one's on me. My bad.
2019-05-02 10:24:26 -04:00
Lioncash
1634059618
{A32, A64}/types: Use std::array deduction guides where applicable
We also make the arrays static here, as MSVC tends to load the whole
array every time the function is called, instead of storing the data
within rodata.

This also line breaks the elements a little earlier for readability.
2019-05-02 09:28:31 -04:00
Lioncash
13e9d48720
frontend/ir/type: Generify std::array declaration
With deduction guides, we can eliminate the need to explicitly size the
array. Also newlines the elements based off their relation, making it
slightly nicer to read.
2019-05-02 09:08:43 -04:00
Lioncash
994f3cfa33
CMakeLists: Add a namespace to the export
Avoids potentially dumping boost, fmt, and xbyak targets into a
top-level namespace without any qualification, which can lead to build
errors in projects that already make use of them.
2019-05-02 08:39:11 -04:00
Lioncash
362dc5e350
frontend/A32/ir_emitter: Mark locals as const where applicable
Makes const usage consistent within the source file.
2019-05-02 00:07:13 -04:00
Lioncash
9b7a8547b9
frontend/A32/types: Use helper function in operator+ overload
Allows deduplicating an assert and a cast.
2019-05-02 00:03:13 -04:00
Lioncash
28eedda6ff
frontend/A64/types: Make RegNumber() and VecNumber() constexpr
Given they simply perform casting, they can be safely made constexpr.
2019-05-02 00:00:15 -04:00
Lioncash
455a7a0359
frontend/A64/types: Use helper functions in operator+ overloads
Allows us to get rid of another explicit cast.
2019-05-01 23:59:20 -04:00
Lioncash
08cd3f0385
frontend/ir/ir_emitter: Apply const to locals where applicable
Makes const usage consistent with all other functions in the source
file.
2019-05-01 23:54:22 -04:00
Lioncash
967d1fcc8d
frontend/ir/ir_emitter: Use switch constructs in floating point opcodes where applicable
This'll reduce the amount of noise necessary in changes implementing
half-precision instructions, as the type can just be prepended to the
switch cases, instead of rewriting the whole if/else branch.
2019-05-01 23:45:01 -04:00
Lioncash
63c22e9fcb
A32: Allow hooking of hint instructions in ARM mode.
Mirrors the hooking functionality from the AArch64 frontend to make the
behavior of both consistent.
2019-05-01 22:15:49 -04:00
Merry
98c01b0e1a
Merge pull request #489 from lioncash/imm
A32: Replace immediate type aliases with the Imm template
2019-05-01 16:02:44 +01:00
Lioncash
2bd54d6485
A32: Resolve parameter discrepancies discovered via use of the Imm template 2019-04-30 23:58:39 -04:00
Lioncash
17815bdda3
A32: Replace immediate type aliases with the Imm template
Replaces type aliases of raw integral types with the more type-safe Imm
template, like how the AArch64 frontend has been using it.

This makes the two frontends more consistent with one another.
2019-04-28 07:31:00 -04:00
Lioncash
f6a4aaef6e
externals: Update Catch to 2.7.2
Updates Catch from 2.7.0 to 2.7.2. Keeps the unit-testing library up to
date.
2019-04-27 17:36:14 -04:00
Lioncash
f17bf4a352
A32/barrier: Correct PC assignment within ISB
The SetRegister() IR function doesn't allow specifying the PC as a
register. This is a discrepancy that slipped through (my bad). Instead,
we can use BranchWritePC(), like how the other similar PC modifying
locations do it.
2019-04-27 17:22:32 -04:00
Mat M
055fab687d
Merge pull request #488 from lioncash/imm
frontend: Move imm.h to the top-level directory of the frontends
2019-04-27 15:01:12 -04:00
Lioncash
4ed37614c6
frontend: Move imm.h to the top-level directory of the frontends
Preparation to utilize the immediate type within the A32 backend as
well, which will allow eliminating numerous type aliases like Imm4,
Imm5, etc.
2019-04-27 14:53:33 -04:00
Lioncash
6201b0e32d
A32/disassembler_arm: Mark utility functions as static where applicable
These don't depend on class state and can be marked static to make that
explicit.
2019-04-27 09:45:15 -04:00
Mat M
d88e1d027d
Merge pull request #487 from lioncash/fuzz2
a32/fuzz_arm: Use same fuzzing mechanism as AArch64
2019-04-27 09:42:46 -04:00
Merry
19c59bbf26
Merge pull request #486 from lioncash/barrier
A32: Implement barrier instructions introduced in ARMv7
2019-04-27 14:40:06 +01:00
Lioncash
f3679e6278
A32: Implement barrier instructions introduced in ARMv7
Provides basic implementations of the barrier instruction introduced
within ARMv7. Currently these simply mirror the behavior of the AArch64
equivalents.
2019-04-27 08:29:49 -04:00
Lioncash
c32a10ca7e
a32/fuzz_arm: Use same fuzzing mechanism as AArch64
Introduces the same fuzzing mechanism used by the AArch64 code for
fuzzing instruction implementations, getting rid of the need to
manually specify the instruction generator sequences--replacing it with
an instruction blacklist instead.

Much of this change originates from a previous patch made by Mary. This
just makes it interact nicely with the alterations made to get Unicorn
to cooperate properly.
2019-04-27 06:11:55 -04:00
Mat M
b27fe43120
Merge pull request #485 from lioncash/a32
A32: Handle all ARM-mode arithmetic and data processing instructions added in ARMv6T2 and ARMv7
2019-04-26 06:51:24 -04:00
Lioncash
23571f99c5
A32: Implement ARM-mode MLS 2019-04-26 06:50:03 -04:00
Lioncash
adf04f6f9a
A32: Implement ARM-mode MOVT 2019-04-26 06:50:03 -04:00
Lioncash
b4429e7f55
A32: Implement ARM-mode SBFX 2019-04-26 06:50:03 -04:00
Lioncash
42964964ce
A32: Implement ARM-mode UBFX 2019-04-26 06:50:03 -04:00
Lioncash
745dfd5046
A32: Implement ARM-mode BFI 2019-04-26 06:50:02 -04:00
Lioncash
20e499d8d6
A32: Implement ARM-mode BFC 2019-04-26 06:50:02 -04:00
Lioncash
3b7b50b0c0
A32: Implement ARM-mode RBIT 2019-04-26 06:49:56 -04:00
Lioncash
c62b822937
A32: Implement ARM-mode SDIV/UDIV
Now that we have Unicorn in place, we can freely implement instructions
introduced in newer versions of the ARM architecture.
2019-04-21 21:30:29 -04:00
Lioncash
9110e70bd3
travis: Re-enable A32 tests 2019-04-20 06:02:32 -04:00
Lioncash
79af6c118c
a32_unicorn: Silence PC value assertions
Ensure the PC is properly masked off after a run.
2019-04-20 06:02:29 -04:00
Lioncash
43422bc106
travis: Amend build parameters
Currently just run the 64-bit tests.
2019-04-20 05:22:54 -04:00
Lioncash
0d3764569d
fuzz_arm: Tidy up existing tests
Now that we utilize C++17, we can use std::array's deduction guides to
avoid the need to explicitly specify the template arguments.

While we're at it, also use const where applicable.
2019-04-20 05:00:15 -04:00
Lioncash
27e8a41b7f
Merge branch 'fuzz' 2019-04-20 04:19:37 -04:00
Lioncash
bce91ff07b
dynarmic_tests: Remove skyeye interpreter
This is quite a messy interpreter and would require a large amount of
work to bring it up to speed to begin implementing newer portions of the
AArch32 instruction set into Dynarmic.

Given we already have fuzzing with Unicorn set up for
AArch64/AArch32, we can get rid of this and unify our testing
infrastructure.

This will also make building the tests much faster, given a whole
interpreter doesn't need to be built anymore as part of the project.
2019-04-20 04:19:22 -04:00
Lioncash
ad7d439ef5
A32: Fuzz instructions using unicorn
While skyeye was OK previously, now that we have an AArch64 backend,
this also means that we eventually have to support the AArch32
counterpart to it. Unfortunately, SkyEye is only compatible up to
ARMv6K, so we woud need to do a lot of work to bring the interpreter up
to speed with things to even begin testing new instruction
implementations.

For the AArch64 side of things, we already use Unicorn, so we can toss
out SkyEye in favor of it instead.
2019-04-20 04:17:18 -04:00
Lioncash
127efc592d
A32/translate_thumb: Clean up formatting
Performs a similar tidying up of the Thumb translator, like what was
done with the regular ARM translator to make it consistent with the rest
of the codebase.

The A32 backend (both Thumb and ARM), will likely see more changes to it
in the near future, so this just acts as a "dusting off".
2019-04-20 00:32:25 -04:00
Merry
7316ab18f6
Merge pull request #483 from lioncash/invert
frontend/ir/cond: Remove unused invert() function
2019-04-17 10:45:34 +01:00
Lioncash
66e3b1c1eb
common/fp/op/FPConvert: Remove unnecessary casts in FPConvert()
These were made unnecessary in 2c2fdb435cf8e358a0c5b907ce8131e434df3f22,
but were missed during the initial removal.
2019-04-16 21:53:22 -04:00
Lioncash
fe7c21b687
frontend/ir/cond: Remove unused invert() function
This is no longer used by anything in the codebase, so it can be
removed.
2019-04-16 21:37:12 -04:00
Merry
6377fd9866
Merge pull request #482 from lioncash/fixedfp
A64: Handle half-precision variants of FP->Fixed instructions
2019-04-15 20:08:01 +01:00
MerryMage
732215d68d emit_x64_data_processing: Remove INVALID_REG
INVALID_REG.cvt8() now throws
2019-04-15 16:59:39 +01:00
MerryMage
731aa2df8d externals: Update xbyak to 73ac586
Merge commit 'b0bc810667409c2fddd4e8c7a28ea4b1ffa76a03'
2019-04-15 16:18:43 +01:00