[mupen64plus-core] 271/310: Save link information in *AL(L) instructions unconditionally

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:58:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-core.

commit 03ef7b3e7b3cafc883fe5710ba92bc476f794afa
Author: Sven Eckelmann <sven at narfation.org>
Date:   Tue Jan 28 23:25:28 2014 +0100

    Save link information in *AL(L) instructions unconditionally
    
    All "Jump and link" and "Branch and link" like instructions save the PC in the
    target register unconditionally and not only when the branch/jump is taken.
    The specification is not clear whether the store is actually made before or
    after the delay slot and therefore the behavior of the dynarecs ("link" before
    delay slot) is used.
---
 debian/changelog                                   |  2 +
 .../interpreter_cmd_link_unconditionally.patch     | 89 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 92 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a59af49..c48bc28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ mupen64plus-core (2.0-5) UNRELEASED; urgency=medium
     - Add sdl2_no_surface.patch, Remove unused SDL2 surface in compat code
     - Add sdl2_destroywindow.patch, Close SDL2 window when quitting Video
       subsystem
+    - Add interpreter_cmd_link_unconditionally.patch, Save link information
+      in *AL(L) instructions unconditionally
   * debian/watch:
     - Change upstream check from bitbucket to github
   * debian/copyright:
diff --git a/debian/patches/interpreter_cmd_link_unconditionally.patch b/debian/patches/interpreter_cmd_link_unconditionally.patch
new file mode 100644
index 0000000..48ae443
--- /dev/null
+++ b/debian/patches/interpreter_cmd_link_unconditionally.patch
@@ -0,0 +1,89 @@
+Description: Save link information in *AL(L) instructions unconditionally
+ All "Jump and link" and "Branch and link" like instructions save the PC in the
+ target register unconditionally and not only when the branch/jump is taken.
+ The specification is not clear whether the store is actually made before or
+ after the delay slot and therefore the behavior of the dynarecs ("link" before
+ delay slot) is used.
+Author: Sven Eckelmann <sven at narfation.org>
+
+---
+diff --git a/src/r4300/pure_interp.c b/src/r4300/pure_interp.c
+index 0ddcf42c72190dac3c7e25c7f44a58de48cfde91..1348b1bf07455d7d1b9882d02db5d311518435f6 100644
+--- a/src/r4300/pure_interp.c
++++ b/src/r4300/pure_interp.c
+@@ -55,6 +55,11 @@ static void prefetch(void);
+       const unsigned int jump_target = (destination); \
+       long long int *link_register = (link); \
+       if (cop1 && check_cop1_unusable()) return; \
++      if (link_register != &reg[0]) \
++      { \
++          *link_register=interp_PC.addr + 8; \
++          sign_extended(*link_register); \
++      } \
+       if (!likely || take_jump) \
+       { \
+         interp_PC.addr += 4; \
+@@ -65,11 +70,6 @@ static void prefetch(void);
+         delay_slot=0; \
+         if (take_jump && !skip_jump) \
+         { \
+-          if (link_register != &reg[0]) \
+-          { \
+-              *link_register=interp_PC.addr; \
+-              sign_extended(*link_register); \
+-          } \
+           interp_PC.addr = jump_target; \
+         } \
+       } \
+diff --git a/src/r4300/r4300.c b/src/r4300/r4300.c
+index 5fbbf630c2934c890215fc9e34de6281e2367b97..0d36f43abc305ec519e36ff1e36137e7fc901865 100644
+--- a/src/r4300/r4300.c
++++ b/src/r4300/r4300.c
+@@ -88,6 +88,11 @@ int rounding_mode = 0x33F, trunc_mode = 0xF3F, round_mode = 0x33F,
+       const unsigned int jump_target = (destination); \
+       long long int *link_register = (link); \
+       if (cop1 && check_cop1_unusable()) return; \
++      if (link_register != &reg[0]) \
++      { \
++         *link_register=PC->addr + 8; \
++         sign_extended(*link_register); \
++      } \
+       if (!likely || take_jump) \
+       { \
+          PC++; \
+@@ -98,11 +103,6 @@ int rounding_mode = 0x33F, trunc_mode = 0xF3F, round_mode = 0x33F,
+          delay_slot=0; \
+          if (take_jump && !skip_jump) \
+          { \
+-            if (link_register != &reg[0]) \
+-            { \
+-               *link_register=PC->addr; \
+-               sign_extended(*link_register); \
+-            } \
+             PC=actual->block+((jump_target-actual->start)>>2); \
+          } \
+       } \
+@@ -120,6 +120,11 @@ int rounding_mode = 0x33F, trunc_mode = 0xF3F, round_mode = 0x33F,
+       const unsigned int jump_target = (destination); \
+       long long int *link_register = (link); \
+       if (cop1 && check_cop1_unusable()) return; \
++      if (link_register != &reg[0]) \
++      { \
++         *link_register=PC->addr + 8; \
++         sign_extended(*link_register); \
++      } \
+       if (!likely || take_jump) \
+       { \
+          PC++; \
+@@ -130,11 +135,6 @@ int rounding_mode = 0x33F, trunc_mode = 0xF3F, round_mode = 0x33F,
+          delay_slot=0; \
+          if (take_jump && !skip_jump) \
+          { \
+-            if (link_register != &reg[0]) \
+-            { \
+-               *link_register=PC->addr; \
+-               sign_extended(*link_register); \
+-            } \
+             jump_to(jump_target); \
+          } \
+       } \
diff --git a/debian/patches/series b/debian/patches/series
index 990490b..dea89d4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@ countperop_rominfo.patch
 countperop_romdb.patch
 sdl2_no_surface.patch
 sdl2_destroywindow.patch
+interpreter_cmd_link_unconditionally.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-core.git



More information about the Pkg-games-commits mailing list