[PATCH 0/2] fix compilation on cell

View: New views
4 Messages — Rating Filter:   Alert me  

[PATCH 0/2] fix compilation on cell

by Marvin-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following two patches fix compilation on cell. I've tested them
on my ps3 and they seem to work. The first patch is a little special
and I'm not 100% sure if it's right - please take a look.

Thanks!

Marc

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[PATCH 1/2] fix cpu detection on ppc

by Marvin-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As we are compiling with -D_BSD_SOURCE, sigjmp_buf and siglongjmp
should be replaced by the non-sig functions (see man 3 setjmp).
Tested on linux/cell.
---
 src/gallium/auxiliary/util/u_cpu_detect.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index b94390a..7330d5d 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -131,7 +131,7 @@ win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
 
 
 #if defined(PIPE_ARCH_PPC) && !defined(PIPE_OS_DARWIN)
-static sigjmp_buf __lv_powerpc_jmpbuf;
+static jmp_buf  __lv_powerpc_jmpbuf;
 static volatile sig_atomic_t __lv_powerpc_canjump = 0;
 
 static void
@@ -143,9 +143,11 @@ sigill_handler(int sig)
    }
 
    __lv_powerpc_canjump = 0;
-   siglongjmp(__lv_powerpc_jmpbuf, 1);
+   longjmp(__lv_powerpc_jmpbuf, 1);
 }
+#endif
 
+#if defined(PIPE_ARCH_PPC)
 static void
 check_os_altivec_support(void)
 {
@@ -166,7 +168,7 @@ check_os_altivec_support(void)
    /* no Darwin, do it the brute-force way */
    /* this is borrowed from the libmpeg2 library */
    signal(SIGILL, sigill_handler);
-   if (sigsetjmp(__lv_powerpc_jmpbuf, 1)) {
+   if (setjmp(__lv_powerpc_jmpbuf)) {
       signal(SIGILL, SIG_DFL);
    } else {
       __lv_powerpc_canjump = 1;
@@ -180,9 +182,9 @@ check_os_altivec_support(void)
       signal(SIGILL, SIG_DFL);
       util_cpu_caps.has_altivec = 1;
    }
-#endif
+#endif /* PIPE_OS_DARWIN */
 }
-#endif
+#endif /* PIPE_ARCH_PPC */
 
 /* If we're running on a processor that can do SSE, let's see if we
  * are allowed to or not.  This will catch 2.4.0 or later kernels that
@@ -190,6 +192,7 @@ check_os_altivec_support(void)
  * and RedHat patched 2.2 kernels that have broken exception handling
  * support for user space apps that do SSE.
  */
+#if defined(PIPE_ARCH_X86) || defined (PIPE_ARCH_X86_64)
 static void
 check_os_katmai_support(void)
 {
@@ -370,6 +373,7 @@ cpuid(uint32_t ax, uint32_t *p)
 
    return ret;
 }
+#endif /* X86 or X86_64 */
 
 void
 util_cpu_detect(void)
--
1.6.4.2


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[PATCH 2/2] fix compilation on cell

by Marvin-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This one was left over.
---
 src/gallium/drivers/cell/ppu/cell_gen_fp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 312621f..b6b2f88 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -674,7 +674,7 @@ emit_MAD(struct codegen *gen, const struct tgsi_full_instruction *inst)
  * Emit linear interpolate.  See emit_ADD for comments.
  */
 static boolean
-emit_LERP(struct codegen *gen, const struct tgsi_full_instruction *inst)
+emit_LRP(struct codegen *gen, const struct tgsi_full_instruction *inst)
 {
    int ch, s1_reg[4], s2_reg[4], s3_reg[4], d_reg[4], tmp_reg[4];
 
@@ -1766,7 +1766,7 @@ emit_instruction(struct codegen *gen,
       return emit_binop(gen, inst);
    case TGSI_OPCODE_MAD:
       return emit_MAD(gen, inst);
-   case TGSI_OPCODE_LERP:
+   case TGSI_OPCODE_LRP:
       return emit_LRP(gen, inst);
    case TGSI_OPCODE_DP3:
       return emit_DP3(gen, inst);
--
1.6.4.2


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Re: [PATCH 0/2] fix compilation on cell

by Brian Paul-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marc Dietrich wrote:
> The following two patches fix compilation on cell. I've tested them
> on my ps3 and they seem to work. The first patch is a little special
> and I'm not 100% sure if it's right - please take a look.

Look OK to me.

I committed the first patch to master and the second one to the 7.6
branch (it'll get merged to master too).

-Brian

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@...
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev