Remove Wii-specific ASM for scale(). Libdivide is likely faster; tests on a real Wii pending. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4683 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-10-25 10:17:04 +00:00
parent 5241070ab3
commit 0f62db298c

View file

@ -151,91 +151,6 @@ void copybufreverse(const void *S, void *D, int32_t c)
#elif defined(__GNUC__) && defined(GEKKO)
// naked function (no prolog/epilog)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wreturn-type"
int32_t scale(int32_t a, int32_t d, int32_t c) ATTRIBUTE((naked));
{
// return ((int64_t)a * d) / c;
__asm__ __volatile__ (
" mullw 6, 3, 4\n"
" mulhw 4, 3, 4\n"
" mr 3, 6\n"
" srawi. 0, 5, 31\n"
" cmpwi cr1, 4, 0\n"
" crxor 7, 0, 4\n"
" xor 5, 0, 5\n"
" subf. 5, 0, 5\n"
" beq DivByZero\n"
" bge cr1, Div64Common\n"
" subfic 3, 3, 0\n"
" subfze 4, 4\n"
"Div64Common:\n"
" cmplw 4, 5\n"
" cntlzw 6, 5\n"
" xor 4, 4, 3\n"
" slw 5, 5, 6\n"
" rotlw 4, 4, 6\n"
" slw 3, 3, 6\n"
" li 7, 2\n"
" xor 4, 4, 3\n"
" bge DivOverflow\n"
" mtctr 7\n"
"Div64Compute:\n"
" srwi 6, 5, 16\n"
" divwu 7, 4, 6\n"
" mullw 6, 7, 6\n"
" subf 4, 6, 4\n"
" slwi 4, 4, 16\n"
" inslwi 4, 3, 16, 16\n"
" slwi 3, 3, 16\n"
" clrlwi 6, 5, 16\n"
" mullw 6, 7, 6\n"
" subfc 4, 6, 4\n"
" subfe. 6, 6, 6\n"
" add 3, 3, 7\n"
" bge Div64Done\n"
"Div64Correct:\n"
" addc 4, 4, 5\n"
" addze. 6, 6\n"
" subi 3, 3, 1\n"
" blt Div64Correct\n"
"Div64Done:\n"
" bdnz Div64Compute\n"
" cmpwi 3, 0\n"
" bso cr1, Div64QuotientNeg\n"
" blt DivOverflow\n"
" blr\n"
"Div64QuotientNeg:\n"
" neg. 3, 3\n"
" blelr\n"
"DivOverflow:\n"
" cror 4, 7, 7\n"
"DivByZero:\n"
" lis 3, 0x8000\n"
" bltlr cr1\n"
" subi 3, 3, 1\n"
" blr\n"
);
}
#pragma GCC diagnostic pop
void clearbufbyte(void *d, int32_t c, int32_t a)
{
if (a==0) {