Hi :)
We've recently switched to the SNC compiler for our PS/3 project, and I'm encountering a few issues:
1. AS_MAX_PORTIBILITY is being defined - I've tracked this down to within as_config.h where #ifdef __SNC__, there's no processor defined. My attempt at a fix was to #define AS_PCC_64.
2. Based on the above statement being accurate, I'm getting a compile error in as_callfunc_ppc_64.cpp, compiling the assembly instructions within GetReturnedFloat() and GetReturnedDouble().
Our systems programmer pointed me towards some documentation that SNC frowns upon using asm instructions directly.
There's an intrisic defined in "ppu_asm_intrinsics.h", that expands
__stfs( double a, const short offset, void *p );
into:
#define __stfs( a, offset, p ) __extension__ ({ __asm__( "stfs %0, %1( %2 )" : : "f"( a ), "I"( offset ), "b"( p ) : "memory" ); })
So what I'm looking for, is either a the syntax correction for the error within GetReturnedFloat():
asm(" stfs 1, %0\n" : "=m"(f));
*or*, the correct set of parameters to pass to __stfs()... (e.g offset is probably 0, and the void* p is the address of f, but what is the "double a" first parameter?
Thoughts?
Thanks,
~Tim
SNC support
It's nice working with smart people - my lead helped me figure this out, so...
Changes I had to make to get AngelScript working with the SNC compiler:
1. as_config.h: My assumption was correct - #define AS_PPC_64 within the #ifdef __SNC__
2. in as_callfunc_ppc_64.cpp:
#ifdef __SNC__
#include "ppu_asm_intrinsics.h"
#endif
3. New implementations of:
static asDWORD GetReturnedFloat(void)
{
asDWORD f = 0;
#ifdef __SNC__
__stfs( __freg(1), 0, (void*)&f);
#else
asm(" stfs 1, %0\n" : "=m"(f));
#endif
return f;
}
static asQWORD GetReturnedDouble(void)
{
asQWORD f = 0;
#ifdef __SNC__
__stfd( __freg(1), 0, (void*)&f);
#else
asm(" stfd 1, %0\n" : "=m"(f));
#endif
return f;
}
Enjoy,
~Tim
Changes I had to make to get AngelScript working with the SNC compiler:
1. as_config.h: My assumption was correct - #define AS_PPC_64 within the #ifdef __SNC__
2. in as_callfunc_ppc_64.cpp:
#ifdef __SNC__
#include "ppu_asm_intrinsics.h"
#endif
3. New implementations of:
static asDWORD GetReturnedFloat(void)
{
asDWORD f = 0;
#ifdef __SNC__
__stfs( __freg(1), 0, (void*)&f);
#else
asm(" stfs 1, %0\n" : "=m"(f));
#endif
return f;
}
static asQWORD GetReturnedDouble(void)
{
asQWORD f = 0;
#ifdef __SNC__
__stfd( __freg(1), 0, (void*)&f);
#else
asm(" stfd 1, %0\n" : "=m"(f));
#endif
return f;
}
Enjoy,
~Tim
Cool! I'll add this to the SVN.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement