paulo@0: @ fixed fastfmul(fixed x, fixed y) paulo@0: @ Multiply two 16.16 fixed-point numbers. paulo@0: paulo@0: .ARM paulo@0: .ALIGN paulo@0: .GLOBL fastfmul paulo@0: paulo@0: fastfmul: paulo@0: smull r1,r2,r0,r1 paulo@0: mov r0,r2,LSL#16 paulo@0: orr r0,r0,r1,LSR#16 paulo@0: bx lr paulo@0: paulo@0: paulo@0: @ int dv(int num, int den) paulo@0: @ Divide two signed integers. paulo@0: paulo@0: .THUMB paulo@0: .THUMB_FUNC paulo@0: .ALIGN paulo@0: .GLOBL dv paulo@0: paulo@0: dv: paulo@0: cmp r1, #0 paulo@0: beq 0f paulo@0: swi 6 paulo@0: bx lr paulo@0: 0: paulo@0: ldr r0, =0x7fffffff paulo@0: bx lr paulo@0: paulo@0: paulo@0: @ int fracmul(signed int x, signed int frac) paulo@0: @ Multiply by a 0.32 fractional number between -0.5 and 0.5. paulo@0: @ Used for fast division by a constant. paulo@0: paulo@0: .ARM paulo@0: .ALIGN paulo@0: .GLOBL fracmul paulo@0: paulo@0: fracmul: paulo@0: smull r1,r2,r0,r1 paulo@0: mov r0, r2 paulo@0: bx lr paulo@0: paulo@0: paulo@0: @ int fracumul(unsigned int x, unsigned int frac) paulo@0: @ Multiply by a 0.32 fractional number between 0 and 1. paulo@0: @ Used for fast division by a constant. paulo@0: paulo@0: .ARM paulo@0: .ALIGN paulo@0: .GLOBL fracumul paulo@0: paulo@0: fracumul: paulo@0: umull r1,r2,r0,r1 paulo@0: mov r0, r2 paulo@0: bx lr paulo@0: paulo@0: paulo@0: @ void gblz_unpack(const void *src, void *dst) paulo@0: @ Unpack GB LZSS format data. paulo@0: paulo@0: .THUMB paulo@0: .THUMB_FUNC paulo@0: .ALIGN paulo@0: .GLOBL _gblz_unpack paulo@0: paulo@0: _gblz_unpack: paulo@0: swi 0x11 @ LZ77UnCompWRAM paulo@0: bx lr paulo@0: paulo@0: