#18 CPU emulation optimization patch

open
nobody
None
5
2005-09-16
2005-09-16
Andrew Church
No

This patch, intended to be applied on top of my
previous ones (1287942 and 1290370), optimizes the
ARM/Thumb emulation, corrects a few minor bugs in the
emulation, and cleans up the code some more. The patch
gives a noticeable speed improvement, on the order of
10-15% depending on the code being run. I'm fairly
confident I haven't broken anything, but testing would
be appreciated.

Note that the patch takes advantage of a couple of GCC
features (function parameters in registers and branch
prediction hints). I've ifdef'd them for GCC, and also
modified the MS-style assembly to match the new C
wrappers, so the code should compile and run fine; but
additional work can probably be done (by someone who
has Visual Studio--I don't) to optimize further for
Windows.

Discussion

1 2 > >> (Page 1 of 2)
  • Andrew Church
    Andrew Church
    2005-09-16

    Logged In: YES
    user_id=527960

    Revised version of the patch, with comment/whitespace fixes
    (no code changes). Also attaching a diff containing all
    three CPU emulation patches, against 2005/9/11 CVS.

     
  • Pokemonhacker
    Pokemonhacker
    2005-09-27

    Logged In: YES
    user_id=785003

    Hi !
    I was wondering if you could post somewhere (or email me at
    my sourceforge address) all the files you changed/created so
    I can get a closer look at them (I'm asking that because I
    have no clue on how to apply a .diff file :/).
    And cheers for all your hard work ;)

     
  • Andrew Church
    Andrew Church
    2005-09-27

    Logged In: YES
    user_id=527960

    I've attached a zip of all the changed files (note that
    src/arm-new.h and src/thumb.h are zero bytes--the contents
    of those files have been moved to GBA-arm.cpp and
    GBA-thumb.cpp, so the empty files can be deleted).

    Incidentally, diff files can be applied using the "patch"
    program--if you're on Linux or another Unix system, it
    should be preinstalled, and here's one that looks like it
    works on Windows:
    http://sourceforge.net/project/shownotes.php?release_id=83227
    Decompress the patch file, start a command prompt, cd into
    the VBA top directory, and run "patch -p0 <armthumb.diff"
    (including the pathname to wherever you put the diff file).

     
  • Andrew Church
    Andrew Church
    2005-11-18

    Logged In: YES
    user_id=527960

    Attaching revised patch (fixing Win32 compilation and
    several cycle timing issues) against current (2005/11/18)
    CVS. Also eliminating the partial patch, since the full
    patch now works.

     
  • Rib Rdb
    Rib Rdb
    2006-05-11

    Logged In: YES
    user_id=518853

    You have thumbUI instead of thumbBP for the thumb breakpoint
    instruction

     
  • Andrew Church
    Andrew Church
    2006-05-15

    Logged In: YES
    user_id=527960

    Thanks, fixed.

     
  • krazydeath
    krazydeath
    2006-10-12

    Logged In: YES
    user_id=1618189

    how do i download this ?

     
  • Andrew Church
    Andrew Church
    2006-10-12

    Logged In: YES
    user_id=527960

    Scroll to the bottom of this page and click on the
    "Download" link next to "armthumb-files-2a.zip", then unpack
    the ZIP file in the same directory as the VBA source code
    and compile it as usual. Note that you will need to use the
    CVS source code, not the 1.7.2 distribution (and I haven't
    updated the patch for recent CVS changes, so I don't know if
    it will still work; it would be nice if the new code was
    merged into CVS).

     
  • Richard Quirk
    Richard Quirk
    2006-11-20

    Logged In: YES
    user_id=1244226
    Originator: NO

    The patch no longer applies to current CVS :(

     
  • Andrew Church
    Andrew Church
    2006-12-04

    Logged In: YES
    user_id=527960
    Originator: YES

    Updated patch for 2006/12/4 CVS, including all changes made to the original code (only lightly tested, but it seems to work). Note that if you try to apply this on top of my more recent ++ operator patch (1608454), the patch against src/arm-new.h will fail, but since the file is no longer used with this patch that is not a concern.

     
1 2 > >> (Page 1 of 2)