00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 __asm__ (
00029 ".section .text\n\t"
00030 ".global ___modsi3\n"
00031 "___modsi3:\n\t"
00032 "push r4\n\t"
00033 "push r5\n\t"
00034 "push r6\n\t"
00035 "push r0\n\t"
00036 "mov.w r1,r6\n\t"
00037 "mov.w r0,r5\n\t"
00038 "mov.w r3,r4\n\t"
00039 "mov.w r2,r3\n\t"
00040 "jsr @@88\n\t"
00041 "mov.w r4,r1\n\t"
00042 "mov.w r3,r0\n\t"
00043 "# negate remainder if numerator was less than zero\n\t"
00044 "btst #0x7,@r7\n\t"
00045 "beq skipnegate\n\t"
00046 "not.b r0l\n\t"
00047 "not.b r0h\n\t"
00048 "not.b r1l\n\t"
00049 "not.b r1h\n\t"
00050 "add.b #0x1,r1l\n\t"
00051 "addx #0x0,r1h\n\t"
00052 "addx #0x0,r0l\n\t"
00053 "addx #0x0,r0h\n"
00054 "skipnegate:\n\t"
00055 "adds #0x2,r7\n\t"
00056 "pop r6\n\t"
00057 "pop r5\n\t"
00058 "pop r4\n\t"
00059 "rts"
00060 );