Skip to contentSkip to conversation

tcg: fix build on 32-bit hppa, ppc and sparc hosts

PATCH In review Jay Foad 4 participants 6 messages Feb 22, 2010 – Mar 3, 2010

lore
Share & tools
lore

Jay Foad

author
#0 lore raw

PATCH 1/1 tcg: fix build on 32-bit hppa, ppc and sparc hosts

The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64.

---
 tcg/hppa/tcg-target.c  |    1 -
 tcg/ppc/tcg-target.c   |    2 --
 tcg/sparc/tcg-target.c |    4 ++++
 3 files changed, 4 insertions(+), 3 deletions(-)
tcg/hppa/tcg-target.c +0 -1
index ddce60c..4677971 100644
@@ -936,7 +936,6 @@ static const TCGTargetOpDef hppa_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld64, { "r", "r", "L", "L" } },
 
     { INDEX_op_qemu_st8, { "L", "L", "L" } },
tcg/ppc/tcg-target.c +0 -2
index 903b69f..15d8b85 100644
@@ -1693,7 +1693,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L" } },
     { INDEX_op_qemu_ld64, { "r", "r", "L" } },
 
     { INDEX_op_qemu_st8, { "K", "K" } },
@@ -1706,7 +1705,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld64, { "r", "L", "L", "L" } },
 
     { INDEX_op_qemu_st8, { "K", "K", "K" } },
tcg/sparc/tcg-target.c +0 -0
index 891b8c4..d4ddaa7 100644
@@ -1319,9 +1319,11 @@ static inline void tcg_out_op(TCGContext *s,

int opc, const TCGArg *args,

     case INDEX_op_qemu_ld32u:
         tcg_out_qemu_ld(s, args, 2);
         break;
+#if TCG_TARGET_REG_BITS == 64
     case INDEX_op_qemu_ld32s:
         tcg_out_qemu_ld(s, args, 2 | 4);
         break;
+#endif
     case INDEX_op_qemu_st8:
         tcg_out_qemu_st(s, args, 0);
         break;
@@ -1471,7 +1473,9 @@ static const TCGTargetOpDef sparc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L" } },
+#if TCG_TARGET_REG_BITS == 64
     { INDEX_op_qemu_ld32s, { "r", "L" } },

+#endif

     { INDEX_op_qemu_st8, { "L", "L" } },
     { INDEX_op_qemu_st16, { "L", "L" } },
#1 lore raw
Quoted 26 lines · Jay Foad

The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64.

---
 tcg/hppa/tcg-target.c  |    1 -
 tcg/ppc/tcg-target.c   |    2 --
 tcg/sparc/tcg-target.c |    4 ++++
 3 files changed, 4 insertions(+), 3 deletions(-)
tcg/hppa/tcg-target.c +0 -1
index ddce60c..4677971 100644
@@ -936,7 +936,6 @@ static const TCGTargetOpDef hppa_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld64, { "r", "r", "L", "L" } },
 
     { INDEX_op_qemu_st8, { "L", "L", "L" } },
tcg/ppc/tcg-target.c +0 -0
index 903b69f..15d8b85 100644

tcg/ppc/tcg-target.c static const TCGTargetOpDef ppc_op_defs[] = { · line 1696

Quoted 5 lines
tcg/ppc/tcg-target.c +0 -1
@@ -1693,7 +1693,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L" } },
 

No. As I wrote in the original thread, conditional compilation is needed here (or you will get new compile errors).

tcg/ppc/tcg-target.c static const TCGTargetOpDef ppc_op_defs[] = { · line 1708

Quoted 9 lines
tcg/ppc/tcg-target.c +0 -0
     { INDEX_op_qemu_ld64, { "r", "r", "L" } },
 
     { INDEX_op_qemu_st8, { "K", "K" } },
tcg/ppc/tcg-target.c +0 -1
@@ -1706,7 +1705,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L", "L" } },
 

dto.

Quoted 25 lines
tcg/ppc/tcg-target.c +0 -0
     { INDEX_op_qemu_ld64, { "r", "L", "L", "L" } },
 
     { INDEX_op_qemu_st8, { "K", "K", "K" } },
tcg/sparc/tcg-target.c +2 -0
index 891b8c4..d4ddaa7 100644
@@ -1319,9 +1319,11 @@ static inline void tcg_out_op(TCGContext *s,
 int opc, const TCGArg *args,
     case INDEX_op_qemu_ld32u:
         tcg_out_qemu_ld(s, args, 2);
         break;
+#if TCG_TARGET_REG_BITS == 64
     case INDEX_op_qemu_ld32s:
         tcg_out_qemu_ld(s, args, 2 | 4);
         break;
+#endif
     case INDEX_op_qemu_st8:
         tcg_out_qemu_st(s, args, 0);
         break;

tcg/sparc/tcg-target.c static const TCGTargetOpDef sparc_op_defs[] = { · line 1481

Quoted 9 lines
tcg/sparc/tcg-target.c +2 -0
@@ -1471,7 +1473,9 @@ static const TCGTargetOpDef sparc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L" } },
     { INDEX_op_qemu_ld16s, { "r", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L" } },
+#if TCG_TARGET_REG_BITS == 64
     { INDEX_op_qemu_ld32s, { "r", "L" } },
+#endif
 
     { INDEX_op_qemu_st8, { "L", "L" } },
     { INDEX_op_qemu_st16, { "L", "L" } },

Maybe my comment applies also to the change in tcg/hppa/tcg-target.c, but I tested only ppc (using cross compilation).

Regards,
Stefan

author
#2 lore raw
Quoted 4 lines
Quoted 4 lines
tcg/ppc/tcg-target.c +0 -0
@@ -1693,7 +1693,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {
      { INDEX_op_qemu_ld16u, { "r", "L" } },
Quoted 8 lines

tcg/ppc/tcg-target.c static const TCGTargetOpDef ppc_op_defs[] = { · line 1697

Quoted 4 lines
tcg/ppc/tcg-target.c +0 -1
      { INDEX_op_qemu_ld16s, { "r", "L" } },
      { INDEX_op_qemu_ld32u, { "r", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L" } },
 

No. As I wrote in the original thread,
conditional compilation is needed here
(or you will get new compile errors).

In tcg/ppc/, TCG_TARGET_REG_BITS is always 32, isn't it?

Thanks,
Jay.

#3 lore raw
Quoted 14 lines · Jay Foad
Quoted 4 lines
Quoted 4 lines
tcg/ppc/tcg-target.c +0 -0
@@ -1693,7 +1693,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {
     { INDEX_op_qemu_ld16u, { "r", "L" } },
Quoted 9 lines

tcg/ppc/tcg-target.c static const TCGTargetOpDef ppc_op_defs[] = {

Quoted 5 lines
tcg/ppc/tcg-target.c +0 -1
     { INDEX_op_qemu_ld16s, { "r", "L" } },
     { INDEX_op_qemu_ld32u, { "r", "L" } },
-    { INDEX_op_qemu_ld32s, { "r", "L" } },
 
 

No. As I wrote in the original thread,
conditional compilation is needed here
(or you will get new compile errors).

Quoted 5 lines

In tcg/ppc/, TCG_TARGET_REG_BITS is always 32, isn't it?

Thanks,
Jay.

Yes, you are right. Please excuse my wrong feedback.

Stefan

#4 lore raw
In reply to Stefan Weil
Quoted 3 lines · Stefan Weil

Maybe my comment applies also to the change in
tcg/hppa/tcg-target.c, but I tested only ppc
(using cross compilation).

HPPA host support is 32-bit only for the time being, as there isn't even a 64-bit userspace for HPPA, yet, and that's unlikely to change soon.

Signature · 3 lines
Cheers,

Stuart Brady
#5 lore raw
In reply to Jay Foad
Quoted 1 line · Jay Foad

The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64.

Your mail client mangled the patch.

[..snip..]

Review static inline void tcg_out_op(TCGContext *s, · line 1319

Quoted 2 lines
(quoted diff) +0 -0
@@ -1319,9 +1319,11 @@ static inline void tcg_out_op(TCGContext *s,
 int opc, const TCGArg *args,

Here.

[..snip..]

Fixed and applied.

Signature · 1 line
mailto:[email protected]