tcg: fix build on 32-bit hppa, ppc and sparc hosts
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
@@ -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
@@ -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
@@ -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" } },Quoted 26 lines · Jay Foad
The
qemu_ld32sop is only defined ifTCG_TARGET_REG_BITS== 64.Signed-off-by Jay Foad <[email protected]>--- 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@@ -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
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@@ -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
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.
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_BITSis always 32, isn't it?Thanks,
Jay.
Yes, you are right. Please excuse my wrong feedback.
Stefan
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
Quoted 1 line · Jay Foad
The
qemu_ld32sop is only defined ifTCG_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]