It appears that it was written for XLC. EDIT: It was compiled with gcc (read config.log)
When I try to compile it with spu-gcc, I get
Code: Select all
[root@ps3 spu]# make
/usr/bin/ccache /usr/bin/spu-gcc     -I. -I/opt/cell/sdk/usr/include -I/opt/cell/sdk/usr/spu/include -I/usr/spu/include   -W -Wall -Winline -Wno-main  -I.  -I/usr/spu/include -I/opt/cell/sdk/usr/spu/include  -O3 -c spu_direct.c
In file included from spu_utils.h:6,
                 from spu_direct.c:26:
spu_direct.h:19: error: expected specifier-qualifier-list before 'qword'
spu_direct.h:32: error: expected specifier-qualifier-list before 'qword'
spu_direct.c: In function 'SPU_PrepareCode':
spu_direct.c:47: warning: assignment makes integer from pointer without a cast
spu_direct.c: In function 'SPU_ReInitInterpreter':
spu_direct.c:69: error: 'SPU_Frame' has no member named 'ostack'
spu_direct.c:69: error: 'SPU_Frame' has no member named 'ostack'
spu_direct.c:69: error: 'qword' undeclared (first use in this function)
spu_direct.c:69: error: (Each undeclared identifier is reported only once
spu_direct.c:69: error: for each function it appears in.)
spu_direct.c:69: error: expected expression before ')' token
spu_direct.c:69: error: expected expression before ')' token
spu_direct.c:69: error: 'new_ostack' undeclared (first use in this function)
spu_direct.c:69: error: expected expression before ')' token
spu_direct.c:69: error: 'SPU_Frame' has no member named 'lvars'
spu_direct.c:69: error: expected expression before ')' token
spu_direct.c:69: error: 'SPU_Frame' has no member named 'ostack'
spu_direct.c:88: error: 'SPU_Frame' has no member named 'lvars'
spu_direct.c:88: warning: implicit declaration of function 'si_from_uint'
make: *** [spu_direct.o] Error 1
[root@ps3 spu]#
Code: Select all
[root@ps3 spu]# cat spu_direct.h
/* Macros for the direct threaded interpreter uncached */
#ifndef __spu_interp_direct_h__
#define __spu_interp_direct_h__
#include "spu_config.h"
/* -------------------- TYPEDEFS AND STRUCTS -------------------- */
typedef struct spu_frame {
    int dummy[8]; /* needed for correct size of structure for DMA transfer */
    int code_size;
    int access_flags;
    void* code_addr; /* the first two entries might be overwritten during return processing, don't use in methodReturn */
    int last_pc;
    int max_stack;
    struct spu_frame* prev;
    void* mb_addr;
    unsigned int* local_code_addr;
    qword* ostack;
    qword* lvars;
    int dummy1[2];
} SPU_Frame;
It seems to be referring to a file called spu_frame.h which reads as follows
Code: Select all
[root@ps3 spu]# cat spu_frame.h 
#ifndef __spu_frame_h__
#define __spu_frame_h__
#define CREATE_BOTTOM_FRAME(mb, top, stack) {                                         \
    mb = (MethodBlock*)stack;                                                         \
    top = (SPU_Frame*)(mb + 1);                                                       \
    mb->max_stack = 0;                                                                \
    top->mb_addr = mb;                                                                \
    top->ostack = (qword*)(top + 1);                                                  \
    top->prev = 0;                                                                    \
}
#define CREATE_TOP_FRAME(last, local_frame, max_locals, max_s, s_end, startup) {      \
    SPU_Frame* dummy = (SPU_Frame*)(last->ostack + max_s);                            \
    dummy->mb_addr = 0;                                                               \
    dummy->prev = last;                                                               \
    dummy->ostack = (qword*)(dummy + 1);                                              \
    local_frame = (SPU_Frame*)(((qword*)(dummy + 1)) + max_locals);                   \
    qword* new_ostack = (qword*)(local_frame + 1);                                    \
                                                                                      \
    if((char*)(new_ostack + max_s) > s_end)  {                                        \
        fprintf(stderr,"Fatal Stack OverFlow!\n"); }                                  \
                                                                                      \
    local_frame->lvars = (qword*)(dummy + 1);                                         \
    local_frame->ostack = new_ostack;                                                 \
    local_frame->mb_addr = startup.mb_addr;                                           \
    local_frame->access_flags = (startup.access_flags);                               \
    local_frame->code_addr = startup.code_addr;                                       \
    local_frame->code_size = startup.ins_len;                                         \
    local_frame->local_code_addr = NULL;                                              \
    local_frame->max_stack = (startup.max_stack);                                     \
    local_frame->prev = dummy;                                                        \
}
#endif /* __spu_frame_h__ */
[root@ps3 spu]# 
Maybe somebody can see what is wrong and what has to change. Maybe someone will become interested enough to want to work on it. If you can't find a copy of the program and want one, post a comment, I'll see what I can do.
