Skip to contentSkip to conversation

tci: fix build breakage for target-sparc

PATCH Applied Michael Roth 4 participants 5 messages Oct 8, 2012 – Oct 19, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tci: fix build breakage for target-sparc

commit c28ae41 introduced GETPC() usage for sparc, which is currently not defined when building with --enable-tcg-interpreter. Add sparc to the list of targets we selectively define GETPC() for.

---
 exec-all.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
exec-all.h +2 -1
index 6516da0..f7f649e 100644
@@ -296,7 +296,8 @@ extern int tb_invalidated_flag;
 #if defined(CONFIG_TCG_INTERPRETER)
 /* Alpha and SH4 user mode emulations and Softmmu call GETPC().
    For all others, GETPC remains undefined (which makes TCI a little faster. */
-# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4)
+# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4) \
+     || defined(TARGET_SPARC)
 extern uintptr_t tci_tb_ptr;
 #  define GETPC() tci_tb_ptr
 # endif
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw

Am 08.10.2012 22:45, schrieb Michael Roth:

Quoted 14 lines

commit c28ae41 introduced GETPC() usage for sparc, which is currently not defined when building with --enable-tcg-interpreter. Add sparc to the list of targets we selectively define GETPC() for.

---
  exec-all.h |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
exec-all.h +0 -0
index 6516da0..f7f649e 100644

exec-all.h extern int tb_invalidated_flag; · line 303

Quoted 9 lines
exec-all.h +2 -1
@@ -296,7 +296,8 @@ extern int tb_invalidated_flag;
  #if defined(CONFIG_TCG_INTERPRETER)
  /* Alpha and SH4 user mode emulations and Softmmu call GETPC().
     For all others, GETPC remains undefined (which makes TCI a little faster. */
-# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4)
+# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4) \
+     || defined(TARGET_SPARC)
  extern uintptr_t tci_tb_ptr;
  #  define GETPC() tci_tb_ptr
  # endif

Maybe whoever commits that patch can fix the comment, too. I don't think we need a 2nd patch for that.

Regards

Stefan W.

#2 lore raw
In reply to Michael Roth

exec-all.h extern int tb_invalidated_flag; · line 302

Quoted 7 lines · Michael Roth

/* Alpha and SH4 user mode emulations and Softmmu call GETPC().
For all others, GETPC remains undefined (which makes TCI a little faster. */

exec-all.h +2 -1
-# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4)
+# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4) \
+     || defined(TARGET_SPARC)
 extern uintptr_t tci_tb_ptr;
 #  define GETPC() tci_tb_ptr

Why is this conditional? All targets probably ought to be using it when raising runtime exceptions -- particularly fp exceptions.

r~

#3 lore raw

Am 09.10.2012 00:19, schrieb Richard Henderson:

Quoted 12 lines · Michael Roth

exec-all.h extern int tb_invalidated_flag; · line 302

Quoted 7 lines

/* Alpha and SH4 user mode emulations and Softmmu call GETPC().
For all others, GETPC remains undefined (which makes TCI a little faster. */

exec-all.h +2 -1
-# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4)
+# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4) \
+     || defined(TARGET_SPARC)
  extern uintptr_t tci_tb_ptr;
  #  define GETPC() tci_tb_ptr

Why is this conditional? All targets probably ought to be using it when raising runtime exceptions -- particularly fp exceptions.

Quoted 2 lines

r~

See the comment: "which makes TCI a little faster".

When GETPC is undefined, tci.c saves an assignment to a global variable per interpreted TCG code which is a significant reduction.

Maybe there are better solutions, of course.

Regards
Stefan

#4 lore raw
In reply to Michael Roth
Quoted 26 lines · Michael Roth

commit c28ae41 introduced GETPC() usage for sparc, which is currently not defined when building with --enable-tcg-interpreter. Add sparc to the list of targets we selectively define GETPC() for.

---
 exec-all.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
exec-all.h +2 -1
index 6516da0..f7f649e 100644
@@ -296,7 +296,8 @@ extern int tb_invalidated_flag;
 #if defined(CONFIG_TCG_INTERPRETER)
 /* Alpha and SH4 user mode emulations and Softmmu call GETPC().
    For all others, GETPC remains undefined (which makes TCI a little faster. */
-# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4)
+# if defined(CONFIG_SOFTMMU) || defined(TARGET_ALPHA) || defined(TARGET_SH4) \
+     || defined(TARGET_SPARC)
 extern uintptr_t tci_tb_ptr;
 #  define GETPC() tci_tb_ptr
 # endif
Signature · 1 line
1.7.9.5

Thanks, applied.

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net