libode port for wii - Open Dynamics Engine for wii May 07, 2011 05:12PM | Registered: 13 years ago Posts: 1 |
/bin/bash ../../libtool --tag=CXX --mode=compile /opt/devkitpro/devkitPPC/bin/powerpc-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../OPCODE -I../../OPCODE/Ice -DdTRIMESH_ENABLED -DdTRIMESH_OPCODE -DdSINGLE -g -O2 -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c -o timer.lo timer.cpp libtool: compile: /opt/devkitpro/devkitPPC/bin/powerpc-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../OPCODE -I../../OPCODE/Ice -DdTRIMESH_ENABLED -DdTRIMESH_OPCODE -DdSINGLE -g -O2 -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c timer.cpp -o timer.o timer.cpp: In function 'void dStopwatchStart(dStopwatch*)': timer.cpp:134:43: error: unknown register name '%edx' in 'asm' timer.cpp:134:43: error: unknown register name '%ecx' in 'asm' timer.cpp:134:43: error: unknown register name '%eax' in 'asm' timer.cpp:115:45: error: unknown register name '%edx' in 'asm' timer.cpp:115:45: error: unknown register name '%eax' in 'asm' timer.cpp: In function 'void dStopwatchStop(dStopwatch*)': timer.cpp:134:43: error: unknown register name '%edx' in 'asm' timer.cpp:134:43: error: unknown register name '%ecx' in 'asm' timer.cpp:134:43: error: unknown register name '%eax' in 'asm' timer.cpp:115:45: error: unknown register name '%edx' in 'asm' timer.cpp:115:45: error: unknown register name '%eax' in 'asm' timer.cpp: In function 'void dTimerStart(const char*)': timer.cpp:134:43: error: unknown register name '%edx' in 'asm' timer.cpp:134:43: error: unknown register name '%ecx' in 'asm' timer.cpp:134:43: error: unknown register name '%eax' in 'asm' timer.cpp:115:45: error: unknown register name '%edx' in 'asm' timer.cpp:115:45: error: unknown register name '%eax' in 'asm' timer.cpp: In function 'void dTimerNow(const char*)': timer.cpp:115:45: error: unknown register name '%edx' in 'asm' timer.cpp:115:45: error: unknown register name '%eax' in 'asm' timer.cpp: In function 'void dTimerEnd()': timer.cpp:134:43: error: unknown register name '%edx' in 'asm' timer.cpp:134:43: error: unknown register name '%ecx' in 'asm' timer.cpp:134:43: error: unknown register name '%eax' in 'asm' timer.cpp:115:45: error: unknown register name '%edx' in 'asm' timer.cpp:115:45: error: unknown register name '%eax' in 'asm' make[2]: *** [timer.lo] Error 1 make[2]: Leaving directory `/home/ton/src/wii/ode/ode-0.11.1/ode/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ton/src/wii/ode/ode-0.11.1/ode/src' make: *** [all] Error 2
static inline void getClockCount (unsigned long cc[2]) { #ifndef X86_64_SYSTEM asm volatile ( "rdtsc\n" "movl %%eax,(%%esi)\n" "movl %%edx,4(%%esi)\n" : : "S" (cc) : "%eax","%edx","cc","memory"); #else asm volatile ( "rdtsc\n" "movl %%eax,(%%rsi)\n" "movl %%edx,4(%%rsi)\n" : : "S" (cc) : "%eax","%edx","cc","memory"); #endif } static inline void serialize() { #ifndef X86_64_SYSTEM asm volatile ( "mov $0,%%eax\n" "push %%ebx\n" "cpuid\n" "pop %%ebx\n" : : : "%eax","%ecx","%edx","cc","memory"); #else asm volatile ( "mov $0,%%rax\n" "push %%rbx\n" "cpuid\n" "pop %%rbx\n" : : : "%rax","%rcx","%rdx","cc","memory"); #endif }
Re: libode port for wii - Open Dynamics Engine for wii May 07, 2011 10:01PM | Registered: 13 years ago Posts: 99 |
u64 timer_gettime() { u32 tb_upper; u32 tb_upper1; u32 tb_lower; u64 time; do { __asm__ __volatile__ ("mftbu %0" : "=r"(tb_upper)); __asm__ __volatile__ ("mftb %0" : "=r"(tb_lower)); __asm__ __volatile__ ("mftbu %0" : "=r"(tb_upper1)); } while (tb_upper != tb_upper1); time = (((u64)tb_upper) << 32) | tb_lower; return time; } // calling example //u64 microsecs = ticks_to_microsecs(gettime()); // ticks macro is part of devkitPPC .. more like this one can be found
Re: libode port for wii - Open Dynamics Engine for wii May 08, 2011 10:49AM | Moderator Registered: 15 years ago Posts: 703 |
Re: libode port for wii - Open Dynamics Engine for wii May 11, 2011 03:38AM | Registered: 15 years ago Posts: 686 |