From d6434e1042f3b0a6dfe1b1f615af369486f9b1fa Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 9 Oct 1999 00:00:47 +0000 Subject: Merge with 2.3.19. --- arch/sh/lib/Makefile | 14 + arch/sh/lib/checksum.c | 170 ++++++ arch/sh/lib/csum_partial_copy.c | 75 +++ arch/sh/lib/delay.c | 21 + arch/sh/lib/memcpy.S | 131 ++++ arch/sh/lib/memmove.S | 422 +++++++++++++ arch/sh/lib/memset.S | 72 +++ arch/sh/lib/old-checksum.c | 19 + arch/sh/lib/wordcopy.S | 1289 +++++++++++++++++++++++++++++++++++++++ 9 files changed, 2213 insertions(+) create mode 100644 arch/sh/lib/Makefile create mode 100644 arch/sh/lib/checksum.c create mode 100644 arch/sh/lib/csum_partial_copy.c create mode 100644 arch/sh/lib/delay.c create mode 100644 arch/sh/lib/memcpy.S create mode 100644 arch/sh/lib/memmove.S create mode 100644 arch/sh/lib/memset.S create mode 100644 arch/sh/lib/old-checksum.c create mode 100644 arch/sh/lib/wordcopy.S (limited to 'arch/sh/lib') diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile new file mode 100644 index 000000000..a9010ddb2 --- /dev/null +++ b/arch/sh/lib/Makefile @@ -0,0 +1,14 @@ +# +# Makefile for SuperH-specific library files.. +# + +.S.o: + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + +L_TARGET = lib.a +# L_OBJS = checksum.o old-checksum.o semaphore.o delay.o \ +# usercopy.o getuser.o putuser.o +L_OBJS = delay.o memcpy.o memset.o memmove.o csum_partial_copy.o \ + wordcopy.o checksum.o # usercopy.o getuser.o putuser.o + +include $(TOPDIR)/Rules.make diff --git a/arch/sh/lib/checksum.c b/arch/sh/lib/checksum.c new file mode 100644 index 000000000..f076bd3c6 --- /dev/null +++ b/arch/sh/lib/checksum.c @@ -0,0 +1,170 @@ +/* + * Taken from: + * arch/alpha/lib/checksum.c + * + * This file contains network checksum routines that are better done + * in an architecture-specific manner due to speed.. + */ + +#include + +#include + +static inline unsigned short from64to16(unsigned long long x) +{ + /* add up 32-bit words for 33 bits */ + x = (x & 0xffffffff) + (x >> 32); + /* add up 16-bit and 17-bit words for 17+c bits */ + x = (x & 0xffff) + (x >> 16); + /* add up 16-bit and 2-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +/* + * computes the checksum of the TCP/UDP pseudo-header + * returns a 16-bit checksum, already complemented. + */ +unsigned short int csum_tcpudp_magic(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) +{ + return ~from64to16(saddr + daddr + sum + + ((unsigned long) ntohs(len) << 16) + + ((unsigned long) proto << 8)); +} + +unsigned int csum_tcpudp_nofold(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) +{ + unsigned long long result; + + result = (saddr + daddr + sum + + ((unsigned long) ntohs(len) << 16) + + ((unsigned long) proto << 8)); + + /* Fold down to 32-bits so we don't loose in the typedef-less + network stack. */ + /* 64 to 33 */ + result = (result & 0xffffffff) + (result >> 32); + /* 33 to 32 */ + result = (result & 0xffffffff) + (result >> 32); + return result; +} + +/* + * Do a 64-bit checksum on an arbitrary memory area.. + * + * This isn't a great routine, but it's not _horrible_ either. The + * inner loop could be unrolled a bit further, and there are better + * ways to do the carry, but this is reasonable. + */ +static inline unsigned long do_csum(const unsigned char * buff, int len) +{ + int odd, count; + unsigned long long result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { + result = *buff << 8; + len--; + buff++; + } + count = len >> 1; /* nr of 16-bit words.. */ + if (count) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + count--; + len -= 2; + buff += 2; + } + count >>= 1; /* nr of 32-bit words.. */ + if (count) { + if (4 & (unsigned long) buff) { + result += *(unsigned int *) buff; + count--; + len -= 4; + buff += 4; + } + count >>= 1; /* nr of 64-bit words.. */ + if (count) { + unsigned long carry = 0; + do { + unsigned long w = *(unsigned long *) buff; + count--; + buff += 8; + result += carry; + result += w; + carry = (w > result); + } while (count); + result += carry; + result = (result & 0xffffffff) + (result >> 32); + } + if (len & 4) { + result += *(unsigned int *) buff; + buff += 4; + } + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) + result += *buff; + result = from64to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) +{ + return ~do_csum(iph,ihl*4); +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) +{ + unsigned long long result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + /* 32+c bits -> 32 bits */ + result = (result & 0xffffffff) + (result >> 32); + return result; +} + +/* + * this routine is used for miscellaneous IP-like checksums, mainly + * in icmp.c + */ +unsigned short ip_compute_csum(unsigned char * buff, int len) +{ + return ~from64to16(do_csum(buff,len)); +} diff --git a/arch/sh/lib/csum_partial_copy.c b/arch/sh/lib/csum_partial_copy.c new file mode 100644 index 000000000..1fb36ab05 --- /dev/null +++ b/arch/sh/lib/csum_partial_copy.c @@ -0,0 +1,75 @@ +/* + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * MIPS specific IP/TCP/UDP checksumming routines + * + * Authors: Ralf Baechle, + * Lots of code moved from tcp.c and ip.c; see those files + * for more names. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * $Id: csum_partial_copy.c,v 1.2 1998/09/16 13:29:32 ralf Exp $ + */ +#include +#include +#include +#include +#include + +/* + * copy while checksumming, otherwise like csum_partial + */ +unsigned int csum_partial_copy(const char *src, char *dst, + int len, unsigned int sum) +{ + /* + * It's 2:30 am and I don't feel like doing it real ... + * This is lots slower than the real thing (tm) + */ + sum = csum_partial(src, len, sum); + memcpy(dst, src, len); + + return sum; +} + +/* + * Copy from userspace and compute checksum. If we catch an exception + * then zero the rest of the buffer. + */ +unsigned int csum_partial_copy_from_user (const char *src, char *dst, + int len, unsigned int sum, + int *err_ptr) +{ + int missing; + + missing = copy_from_user(dst, src, len); + if (missing) { + memset(dst + len - missing, 0, missing); + *err_ptr = -EFAULT; + } + + return csum_partial(dst, len, sum); +} + +/* + * Copy to userspace and compute checksum. + */ +unsigned int csum_partial_copy_to_user (const char *src, char *dst, + int len, unsigned int sum, + int *err_ptr) +{ + sum = csum_partial(src, len, sum); + + if (copy_to_user(dst, src, len)) { + *err_ptr = -EFAULT; + return sum; + } + + return sum; +} diff --git a/arch/sh/lib/delay.c b/arch/sh/lib/delay.c new file mode 100644 index 000000000..cadd7367e --- /dev/null +++ b/arch/sh/lib/delay.c @@ -0,0 +1,21 @@ +/* + * Precise Delay Loops for SuperH + * + * Copyright (C) 1999 Niibe Yutaka + */ + +#include +#include + +inline void __const_udelay(unsigned long xloops) +{ + xloops *= current_cpu_data.loops_per_sec; + __delay(xloops); +} + +#if 0 +void __udelay(unsigned long usecs) +{ + __const_udelay(usecs * 0x000010c6); /* 2**32 / 1000000 */ +} +#endif diff --git a/arch/sh/lib/memcpy.S b/arch/sh/lib/memcpy.S new file mode 100644 index 000000000..3a4aca919 --- /dev/null +++ b/arch/sh/lib/memcpy.S @@ -0,0 +1,131 @@ +! Taken from newlib-1.8.0 + +! +! Fast SH memcpy +! +! by Toshiyasu Morita (tm@netcom.com) +! hacked by J"orn Rernnecke (amylaar@cygnus.co.uk) ("o for o-umlaut) +! +! Entry: r4: destination pointer +! r5: source pointer +! r6: byte count +! +! Exit: r0: destination pointer +! r1-r7: trashed +! +! Notes: Usually one wants to do small reads and write a longword, but +! unfortunately it is difficult in some cases to concatanate bytes +! into a longword on the SH, so this does a longword read and small +! writes. +! +! This implementation makes two assumptions about how it is called: +! +! 1.: If the byte count is nonzero, the address of the last byte to be +! copied is unsigned greater than the address of the first byte to +! be copied. This could be easily swapped for a signed comparison, +! but the algorithm used needs some comparison. +! +! 2.: When there are two or three bytes in the last word of an 11-or-bore +! bytes memory chunk to b copied, the rest of the word can be read +! without size effects. +! This could be easily changed by increasing the minumum size of +! a fast memcpy and the amount subtracted from r7 before L_2l_loop be 2, +! however, this would cost a few extra cyles on average. +! + +#include +ENTRY(memcpy) + ! Big endian version copies with decreasing addresses. + mov r4,r0 + add r6,r0 + sub r4,r5 + mov #11,r1 + cmp/hs r1,r6 + bf/s L_small + add #-1,r5 + mov r5,r3 + add r0,r3 + shlr r3 + bt/s L_even + mov r4,r7 + mov.b @(r0,r5),r2 + add #-1,r3 + mov.b r2,@-r0 +L_even: + tst #1,r0 + add #-1,r5 + bf/s L_odddst + add #8,r7 + tst #2,r0 + bt L_al4dst + add #-1,r3 + mov.w @(r0,r5),r1 + mov.w r1,@-r0 +L_al4dst: + shlr r3 + bt L_al4both + mov.w @(r0,r5),r1 + swap.w r1,r1 + add #4,r7 + add #-4,r5 + .align 2 +L_2l_loop: + mov.l @(r0,r5),r2 + xtrct r2,r1 + mov.l r1,@-r0 + cmp/hs r7,r0 + mov.l @(r0,r5),r1 + xtrct r1,r2 + mov.l r2,@-r0 + bt L_2l_loop + bra L_cleanup + add #5,r5 + + nop ! avoid nop in executed code. +L_al4both: + add #-2,r5 + .align 2 +L_al4both_loop: + mov.l @(r0,r5),r1 + cmp/hs r7,r0 + bt/s L_al4both_loop + mov.l r1,@-r0 + bra L_cleanup + add #3,r5 + + nop ! avoid nop in executed code. +L_odddst: + shlr r3 + bt L_al4src + mov.w @(r0,r5),r1 + mov.b r1,@-r0 + shlr8 r1 + mov.b r1,@-r0 +L_al4src: + add #-2,r5 + .align 2 +L_odd_loop: + mov.l @(r0,r5),r2 + cmp/hs r7,r0 + mov.b r2,@-r0 + shlr8 r2 + mov.w r2,@-r0 + shlr16 r2 + mov.b r2,@-r0 + bt L_odd_loop + + add #3,r5 +L_cleanup: +L_small: + cmp/eq r4,r0 + bt L_ready + add #1,r4 + .align 2 +L_cleanup_loop: + mov.b @(r0,r5),r2 + cmp/eq r4,r0 + mov.b r2,@-r0 + bf L_cleanup_loop +L_ready: + rts + nop diff --git a/arch/sh/lib/memmove.S b/arch/sh/lib/memmove.S new file mode 100644 index 000000000..e95dc3709 --- /dev/null +++ b/arch/sh/lib/memmove.S @@ -0,0 +1,422 @@ +#include +ENTRY(memmove) + mov.l r8,@-r15 + mov.l r9,@-r15 + mov.l r14,@-r15 + sts.l pr,@-r15 + add #-28,r15 + mov r15,r14 + mov.l r4,@r14 + mov.l r5,@(4,r14) + mov.l r6,@(8,r14) + mov.l @r14,r1 + mov.l r1,@(12,r14) + mov.l @(4,r14),r1 + mov.l r1,@(16,r14) + mov.l @(12,r14),r1 + mov.l @(16,r14),r2 + sub r2,r1 + mov.l @(8,r14),r2 + cmp/hs r2,r1 + bt .L54 + bra .L2 + nop +.L54: + mov.l @(8,r14),r1 + mov #15,r2 + cmp/gt r2,r1 + bt .LF100 + bra .L52 + nop +.LF100: + mov.l @(12,r14),r2 + neg r2,r1 + mov #3,r2 + and r1,r2 + mov.l @(8,r14),r1 + mov r1,r9 + sub r2,r9 + mov r9,r2 + mov.l r2,@(8,r14) +.L4: + mov.l @(12,r14),r2 + neg r2,r1 + mov #3,r2 + and r1,r2 + mov.l r2,@(20,r14) +.L7: + mov.l @(20,r14),r1 + cmp/pl r1 + bt .L9 + bra .L6 + nop + .align 2 +.L9: + mov r14,r2 + mov r14,r1 + add #24,r1 + mov.l @(16,r14),r2 + mov.b @r2,r3 + mov.b r3,@r1 + mov.l @(16,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(16,r14) + mov.l @(20,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(20,r14) + mov.l @(12,r14),r1 + mov r14,r2 + mov r14,r3 + add #24,r3 + mov.b @r3,r2 + mov.b r2,@r1 + mov.l @(12,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(12,r14) + bra .L7 + nop + .align 2 +.L8: +.L6: + bra .L5 + nop + .align 2 +.L10: + bra .L4 + nop + .align 2 +.L5: + nop +.L11: + mov.l @(16,r14),r1 + mov #3,r2 + and r1,r2 + tst r2,r2 + bf .L14 + mov r15,r2 + mov.l @(12,r14),r1 + mov.l @(16,r14),r2 + mov.l @(8,r14),r7 + mov r7,r3 + shlr2 r3 + mov r1,r4 + mov r2,r5 + mov r3,r6 + mov.l .L46,r8 + jsr @r8 + nop + bra .L15 + nop + .align 2 +.L14: + mov r15,r2 + mov.l @(12,r14),r1 + mov.l @(16,r14),r2 + mov.l @(8,r14),r7 + mov r7,r3 + shlr2 r3 + mov r1,r4 + mov r2,r5 + mov r3,r6 + mov.l .L47,r8 + jsr @r8 + nop +.L15: + mov.l @(8,r14),r1 + mov #-4,r2 + and r2,r1 + mov.l @(16,r14),r2 + add r2,r1 + mov.l r1,@(16,r14) + mov.l @(8,r14),r1 + mov #-4,r2 + and r2,r1 + mov.l @(12,r14),r2 + add r2,r1 + mov.l r1,@(12,r14) + mov.l @(8,r14),r1 + mov #3,r2 + and r1,r2 + mov.l r2,@(8,r14) +.L13: +.L52: + bra .L3 + nop + .align 2 +.L16: + bra .L11 + nop + .align 2 +.L12: +.L3: + nop +.L17: + mov.l @(8,r14),r1 + mov.l r1,@(20,r14) +.L20: + mov.l @(20,r14),r1 + cmp/pl r1 + bt .L22 + bra .L19 + nop + .align 2 +.L22: + mov r14,r2 + mov r14,r1 + add #24,r1 + mov.l @(16,r14),r2 + mov.b @r2,r3 + mov.b r3,@r1 + mov.l @(16,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(16,r14) + mov.l @(20,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(20,r14) + mov.l @(12,r14),r1 + mov r14,r2 + mov r14,r3 + add #24,r3 + mov.b @r3,r2 + mov.b r2,@r1 + mov.l @(12,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(12,r14) + bra .L20 + nop + .align 2 +.L21: +.L19: + bra .L18 + nop + .align 2 +.L23: + bra .L17 + nop + .align 2 +.L18: + bra .L24 + nop + .align 2 +.L2: + mov.l @(16,r14),r1 + mov.l @(8,r14),r2 + add r2,r1 + mov.l r1,@(16,r14) + mov.l @(12,r14),r1 + mov.l @(8,r14),r2 + add r2,r1 + mov.l r1,@(12,r14) + mov.l @(8,r14),r1 + mov #15,r2 + cmp/gt r2,r1 + bt .LF101 + bra .L53 + nop +.LF101: + mov.l @(12,r14),r1 + mov #3,r2 + and r1,r2 + mov.l @(8,r14),r1 + mov r1,r9 + sub r2,r9 + mov r9,r2 + mov.l r2,@(8,r14) +.L26: + mov.l @(12,r14),r1 + mov #3,r2 + and r1,r2 + mov.l r2,@(20,r14) +.L29: + mov.l @(20,r14),r1 + cmp/pl r1 + bt .L31 + bra .L28 + nop + .align 2 +.L31: + mov.l @(16,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(16,r14) + mov r14,r2 + mov r14,r1 + add #24,r1 + mov.l @(16,r14),r2 + mov.b @r2,r3 + mov.b r3,@r1 + mov.l @(12,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(12,r14) + mov.l @(20,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(20,r14) + mov.l @(12,r14),r1 + mov r14,r2 + mov r14,r3 + add #24,r3 + mov.b @r3,r2 + mov.b r2,@r1 + bra .L29 + nop + .align 2 +.L30: +.L28: + bra .L27 + nop + .align 2 +.L32: + bra .L26 + nop + .align 2 +.L27: + nop +.L33: + mov.l @(16,r14),r1 + mov #3,r2 + and r1,r2 + tst r2,r2 + bf .L36 + mov r15,r2 + mov.l @(12,r14),r1 + mov.l @(16,r14),r2 + mov.l @(8,r14),r7 + mov r7,r3 + shlr2 r3 + mov r1,r4 + mov r2,r5 + mov r3,r6 + mov.l .L48,r8 + jsr @r8 + nop + bra .L37 + nop + .align 2 +.L36: + mov r15,r2 + mov.l @(12,r14),r1 + mov.l @(16,r14),r2 + mov.l @(8,r14),r7 + mov r7,r3 + shlr2 r3 + mov r1,r4 + mov r2,r5 + mov r3,r6 + mov.l .L49,r8 + jsr @r8 + nop +.L37: + mov.l @(8,r14),r1 + mov #-4,r2 + and r2,r1 + mov.l @(16,r14),r2 + mov r2,r9 + sub r1,r9 + mov r9,r1 + mov.l r1,@(16,r14) + mov.l @(8,r14),r1 + mov #-4,r2 + and r2,r1 + mov.l @(12,r14),r2 + mov r2,r9 + sub r1,r9 + mov r9,r1 + mov.l r1,@(12,r14) + mov.l @(8,r14),r1 + mov #3,r2 + and r1,r2 + mov.l r2,@(8,r14) +.L35: +.L53: + bra .L25 + nop + .align 2 +.L38: + bra .L33 + nop + .align 2 +.L34: +.L25: + nop +.L39: + mov.l @(8,r14),r1 + mov.l r1,@(20,r14) +.L42: + mov.l @(20,r14),r1 + cmp/pl r1 + bt .L44 + bra .L41 + nop + .align 2 +.L44: + mov.l @(16,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(16,r14) + mov r14,r2 + mov r14,r1 + add #24,r1 + mov.l @(16,r14),r2 + mov.b @r2,r3 + mov.b r3,@r1 + mov.l @(12,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(12,r14) + mov.l @(20,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(20,r14) + mov.l @(12,r14),r1 + mov r14,r2 + mov r14,r3 + add #24,r3 + mov.b @r3,r2 + mov.b r2,@r1 + bra .L42 + nop + .align 2 +.L43: +.L41: + bra .L24 + nop + .align 2 +.L45: + bra .L39 + nop + .align 2 +.L40: +.L24: + mov.l @r14,r1 + mov r1,r0 + bra .L1 + nop + .align 2 +.L1: + add #28,r14 + mov r14,r15 + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r9 + mov.l @r15+,r8 + rts + nop +.L50: + .align 2 +.L46: + .long __wordcopy_fwd_aligned +.L47: + .long __wordcopy_fwd_dest_aligned +.L48: + .long __wordcopy_bwd_aligned +.L49: + .long __wordcopy_bwd_dest_aligned +.Lfe1: diff --git a/arch/sh/lib/memset.S b/arch/sh/lib/memset.S new file mode 100644 index 000000000..c97648a4a --- /dev/null +++ b/arch/sh/lib/memset.S @@ -0,0 +1,72 @@ +! Taken from newlib-1.8.0 + +! +! Fast SH memset +! +! by Toshiyasu Morita (tm@netcom.com) +! +! Entry: r4: destination pointer +! r5: fill value +! r6: byte count +! +! Exit: r0-r3: trashed +! +#include + +ENTRY(memset) + mov r4,r3 ! Save return value + + mov r6,r0 ! Check explicitly for zero + cmp/eq #0,r0 + bt L_exit + + mov #12,r0 ! Check for small number of bytes + cmp/gt r6,r0 + bt L_store_byte_loop + + neg r4,r0 ! Align destination + add #4,r0 + and #3,r0 + tst r0,r0 + bt L_dup_bytes + .balignw 4,0x0009 +L_align_loop: + mov.b r5,@r4 + add #-1,r6 + add #1,r4 + dt r0 + bf L_align_loop + +L_dup_bytes: + extu.b r5,r5 ! Duplicate bytes across longword + swap.b r5,r0 + or r0,r5 + swap.w r5,r0 + or r0,r5 + + mov r6,r2 ! Calculate number of double longwords + shlr2 r2 + shlr r2 + + .balignw 4,0x0009 +L_store_long_loop: + mov.l r5,@r4 ! Store double longs to memory + dt r2 + mov.l r5,@(4,r4) + add #8,r4 + bf L_store_long_loop + + mov #7,r0 + and r0,r6 + tst r6,r6 + bt L_exit + .balignw 4,0x0009 +L_store_byte_loop: + mov.b r5,@r4 ! Store bytes to memory + add #1,r4 + dt r6 + bf L_store_byte_loop + +L_exit: + rts + mov r3,r0 diff --git a/arch/sh/lib/old-checksum.c b/arch/sh/lib/old-checksum.c new file mode 100644 index 000000000..ae3a38043 --- /dev/null +++ b/arch/sh/lib/old-checksum.c @@ -0,0 +1,19 @@ +/* + * FIXME: old compatibility stuff, will be removed soon. + */ + +#include + +unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum) +{ + int src_err=0, dst_err=0; + + sum = csum_partial_copy_generic ( src, dst, len, sum, &src_err, &dst_err); + + if (src_err || dst_err) + printk("old csum_partial_copy_fromuser(), tell mingo to convert me.\n"); + + return sum; +} + + diff --git a/arch/sh/lib/wordcopy.S b/arch/sh/lib/wordcopy.S new file mode 100644 index 000000000..c116623d0 --- /dev/null +++ b/arch/sh/lib/wordcopy.S @@ -0,0 +1,1289 @@ +#include +ENTRY(_wordcopy_fwd_aligned) + mov.l r14,@-r15 + add #-20,r15 + mov r15,r14 + mov.l r4,@r14 + mov.l r5,@(4,r14) + mov.l r6,@(8,r14) + mov.l @(8,r14),r2 + mov #7,r1 + and r2,r1 + mov #0,r2 + mov #7,r3 + sub r2,r1 + cmp/hi r3,r1 + bf .L29 + bra .L2 + nop +.L29: + mova .L22,r0 + add r1,r1 + mov.w @(r0,r1),r1 + add r0,r1 + jmp @r1 + nop + .align 2 + .align 2 +.L22: + .word .L15-.L22 + .word .L18-.L22 + .word .L3-.L22 + .word .L5-.L22 + .word .L7-.L22 + .word .L9-.L22 + .word .L11-.L22 + .word .L13-.L22 + .align 2 +.L3: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-24,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-28,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #6,r2 + mov.l r2,@(8,r14) + bra .L4 + nop + .align 2 +.L5: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-20,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-24,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #5,r2 + mov.l r2,@(8,r14) + bra .L6 + nop + .align 2 +.L7: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-20,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #4,r2 + mov.l r2,@(8,r14) + bra .L8 + nop + .align 2 +.L9: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #3,r2 + mov.l r2,@(8,r14) + bra .L10 + nop + .align 2 +.L11: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #2,r2 + mov.l r2,@(8,r14) + bra .L12 + nop + .align 2 +.L13: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(8,r14) + bra .L14 + nop + .align 2 +.L15: + bra .L16 + nop + bra .L1 + nop + .align 2 +.L16: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@r14 + bra .L17 + nop + .align 2 +.L18: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #4,r2 + mov.l r2,@(4,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(8,r14) + bra .L19 + nop + bra .L20 + nop + .align 2 +.L19: + bra .L21 + nop + .align 2 +.L23: +.L2: + nop +.L24: +.L21: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L17: + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #4,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 +.L14: + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #8,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L12: + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #12,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 +.L10: + mov.l @(4,r14),r2 + mov r2,r1 + add #16,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #16,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L8: + mov.l @(4,r14),r2 + mov r2,r1 + add #20,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #20,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 +.L6: + mov.l @(4,r14),r2 + mov r2,r1 + add #24,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #24,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L4: + mov.l @(4,r14),r2 + mov r2,r1 + add #28,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #28,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 + mov.l @(4,r14),r1 + mov r1,r2 + add #32,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #32,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@(8,r14) +.L26: + mov.l @(8,r14),r1 + tst r1,r1 + bf .L27 + bra .L25 + nop + .align 2 +.L27: + bra .L21 + nop + .align 2 +.L25: + nop +.L20: + mov.l @r14,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L1: + add #20,r14 + mov r14,r15 + mov.l @r15+,r14 + rts + nop +.Lfe1: + .size __wordcopy_fwd_aligned,.Lfe1-__wordcopy_fwd_aligned + .global ___lshrsi3 + .global ___ashlsi3 + .align 2 + .global __wordcopy_fwd_dest_aligned + .type __wordcopy_fwd_dest_aligned,@function +__wordcopy_fwd_dest_aligned: + mov.l r8,@-r15 + mov.l r9,@-r15 + mov.l r14,@-r15 + sts.l pr,@-r15 + add #-40,r15 + mov r15,r14 + mov.l r4,@r14 + mov.l r5,@(4,r14) + mov.l r6,@(8,r14) + mov.l @(4,r14),r1 + mov #3,r2 + and r1,r2 + mov r2,r1 + mov r1,r2 + shll2 r2 + add r2,r2 + mov.l r2,@(28,r14) + mov.l @(28,r14),r2 + neg r2,r1 + add #32,r1 + mov.l r1,@(32,r14) + mov.l @(4,r14),r1 + mov #-4,r2 + and r2,r1 + mov.l r1,@(4,r14) + mov.l @(8,r14),r2 + mov #3,r1 + and r2,r1 + mov #0,r2 + mov #3,r3 + sub r2,r1 + cmp/hi r3,r1 + bf .L53 + bra .L31 + nop +.L53: + mova .L43,r0 + add r1,r1 + mov.w @(r0,r1),r1 + add r0,r1 + jmp @r1 + nop + .align 2 + .align 2 +.L43: + .word .L36-.L43 + .word .L39-.L43 + .word .L32-.L43 + .word .L34-.L43 + .align 2 +.L32: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(20,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #2,r2 + mov.l r2,@(8,r14) + bra .L33 + nop + .align 2 +.L34: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(8,r14) + bra .L35 + nop + .align 2 +.L36: + bra .L37 + nop + bra .L30 + nop + .align 2 +.L37: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(24,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #4,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@r14 + bra .L38 + nop + .align 2 +.L39: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(20,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(24,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #8,r2 + mov.l r2,@(4,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(8,r14) + bra .L40 + nop + bra .L41 + nop + .align 2 +.L40: + bra .L42 + nop + .align 2 +.L44: +.L31: + nop +.L45: +.L42: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r8 + mov.l .L49,r1 + mov.l @(20,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L50,r1 + mov.l @(24,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L38: + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r1 + mov r1,r8 + add #4,r8 + mov.l .L49,r1 + mov.l @(24,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L50,r1 + mov.l @(12,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L35: + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(20,r14) + mov.l @r14,r1 + mov r1,r8 + add #8,r8 + mov.l .L49,r1 + mov.l @(12,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L50,r1 + mov.l @(16,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L33: + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(24,r14) + mov.l @r14,r1 + mov r1,r8 + add #12,r8 + mov.l .L49,r1 + mov.l @(16,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L50,r1 + mov.l @(20,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 + mov.l @(4,r14),r1 + mov r1,r2 + add #16,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #16,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@(8,r14) +.L47: + mov.l @(8,r14),r1 + tst r1,r1 + bf .L48 + bra .L46 + nop + .align 2 +.L48: + bra .L42 + nop + .align 2 +.L46: + nop +.L41: + mov.l @r14,r8 + mov.l .L49,r1 + mov.l @(20,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L50,r1 + mov.l @(24,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L30: + add #40,r14 + mov r14,r15 + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r9 + mov.l @r15+,r8 + rts + nop +.L51: + .align 2 +.L49: + .long ___lshrsi3 +.L50: + .long ___ashlsi3 +.Lfe2: + .size __wordcopy_fwd_dest_aligned,.Lfe2-__wordcopy_fwd_dest_aligned + .align 2 + .global __wordcopy_bwd_aligned + .type __wordcopy_bwd_aligned,@function +__wordcopy_bwd_aligned: + mov.l r14,@-r15 + add #-20,r15 + mov r15,r14 + mov.l r4,@r14 + mov.l r5,@(4,r14) + mov.l r6,@(8,r14) + mov.l @(8,r14),r2 + mov #7,r1 + and r2,r1 + mov #0,r2 + mov #7,r3 + sub r2,r1 + cmp/hi r3,r1 + bf .L82 + bra .L55 + nop +.L82: + mova .L75,r0 + add r1,r1 + mov.w @(r0,r1),r1 + add r0,r1 + jmp @r1 + nop + .align 2 + .align 2 +.L75: + .word .L68-.L75 + .word .L71-.L75 + .word .L56-.L75 + .word .L58-.L75 + .word .L60-.L75 + .word .L62-.L75 + .word .L64-.L75 + .word .L66-.L75 + .align 2 +.L56: + mov.l @(4,r14),r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #6,r2 + mov.l r2,@(8,r14) + bra .L57 + nop + .align 2 +.L58: + mov.l @(4,r14),r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #5,r2 + mov.l r2,@(8,r14) + bra .L59 + nop + .align 2 +.L60: + mov.l @(4,r14),r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #4,r2 + mov.l r2,@(8,r14) + bra .L61 + nop + .align 2 +.L62: + mov.l @(4,r14),r1 + mov r1,r2 + add #-20,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #16,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #3,r2 + mov.l r2,@(8,r14) + bra .L63 + nop + .align 2 +.L64: + mov.l @(4,r14),r1 + mov r1,r2 + add #-24,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-20,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #20,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #2,r2 + mov.l r2,@(8,r14) + bra .L65 + nop + .align 2 +.L66: + mov.l @(4,r14),r1 + mov r1,r2 + add #-28,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-24,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #24,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(8,r14) + bra .L67 + nop + .align 2 +.L68: + bra .L69 + nop + bra .L54 + nop + .align 2 +.L69: + mov.l @(4,r14),r1 + mov r1,r2 + add #-32,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-28,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #28,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + bra .L70 + nop + .align 2 +.L71: + mov.l @(4,r14),r1 + mov r1,r2 + add #-36,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-32,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #32,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(8,r14) + bra .L72 + nop + bra .L73 + nop + .align 2 +.L72: + bra .L74 + nop + .align 2 +.L76: +.L55: + nop +.L77: +.L74: + mov.l @(4,r14),r2 + mov r2,r1 + add #28,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #28,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L70: + mov.l @(4,r14),r2 + mov r2,r1 + add #24,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #24,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 +.L67: + mov.l @(4,r14),r2 + mov r2,r1 + add #20,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #20,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L65: + mov.l @(4,r14),r2 + mov r2,r1 + add #16,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #16,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 +.L63: + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #12,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L61: + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r2 + mov r2,r1 + add #8,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 +.L59: + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r2 + mov r2,r1 + add #4,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L57: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r1 + mov.l @(12,r14),r2 + mov.l r2,@r1 + mov.l @(4,r14),r1 + mov r1,r2 + add #-32,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-32,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@(8,r14) +.L79: + mov.l @(8,r14),r1 + tst r1,r1 + bf .L80 + bra .L78 + nop + .align 2 +.L80: + bra .L74 + nop + .align 2 +.L78: + nop +.L73: + mov.l @r14,r2 + mov r2,r1 + add #28,r1 + mov.l @(16,r14),r2 + mov.l r2,@r1 +.L54: + add #20,r14 + mov r14,r15 + mov.l @r15+,r14 + rts + nop +.Lfe3: + .size __wordcopy_bwd_aligned,.Lfe3-__wordcopy_bwd_aligned + .align 2 + .global __wordcopy_bwd_dest_aligned + .type __wordcopy_bwd_dest_aligned,@function +__wordcopy_bwd_dest_aligned: + mov.l r8,@-r15 + mov.l r9,@-r15 + mov.l r14,@-r15 + sts.l pr,@-r15 + add #-40,r15 + mov r15,r14 + mov.l r4,@r14 + mov.l r5,@(4,r14) + mov.l r6,@(8,r14) + mov.l @(4,r14),r1 + mov #3,r2 + and r1,r2 + mov r2,r1 + mov r1,r2 + shll2 r2 + add r2,r2 + mov.l r2,@(28,r14) + mov.l @(28,r14),r2 + neg r2,r1 + add #32,r1 + mov.l r1,@(32,r14) + mov.l @(4,r14),r1 + mov #-4,r2 + and r2,r1 + mov.l r1,@(4,r14) + mov.l @(4,r14),r1 + mov r1,r2 + add #4,r2 + mov.l r2,@(4,r14) + mov.l @(8,r14),r2 + mov #3,r1 + and r2,r1 + mov #0,r2 + mov #3,r3 + sub r2,r1 + cmp/hi r3,r1 + bf .L106 + bra .L84 + nop +.L106: + mova .L96,r0 + add r1,r1 + mov.w @(r0,r1),r1 + add r0,r1 + jmp @r1 + nop + .align 2 + .align 2 +.L96: + .word .L89-.L96 + .word .L92-.L96 + .word .L85-.L96 + .word .L87-.L96 + .align 2 +.L85: + mov.l @(4,r14),r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(20,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #2,r2 + mov.l r2,@(8,r14) + bra .L86 + nop + .align 2 +.L87: + mov.l @(4,r14),r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-8,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(24,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(20,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #1,r2 + mov.l r2,@(8,r14) + bra .L88 + nop + .align 2 +.L89: + bra .L90 + nop + bra .L83 + nop + .align 2 +.L90: + mov.l @(4,r14),r1 + mov r1,r2 + add #-20,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-12,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #16,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(24,r14) + bra .L91 + nop + .align 2 +.L92: + mov.l @(4,r14),r1 + mov r1,r2 + add #-24,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@r14 + mov.l @(4,r14),r2 + mov r2,r1 + add #20,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @(4,r14),r2 + mov r2,r1 + add #16,r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @(8,r14),r1 + mov r1,r2 + add #-1,r2 + mov.l r2,@(8,r14) + bra .L93 + nop + bra .L94 + nop + .align 2 +.L93: + bra .L95 + nop + .align 2 +.L97: +.L84: + nop +.L98: +.L95: + mov.l @(4,r14),r2 + mov r2,r1 + add #12,r1 + mov.l @r1,r2 + mov.l r2,@(24,r14) + mov.l @r14,r1 + mov r1,r8 + add #12,r8 + mov.l .L102,r1 + mov.l @(12,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L103,r1 + mov.l @(16,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L91: + mov.l @(4,r14),r2 + mov r2,r1 + add #8,r1 + mov.l @r1,r2 + mov.l r2,@(20,r14) + mov.l @r14,r1 + mov r1,r8 + add #8,r8 + mov.l .L102,r1 + mov.l @(24,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L103,r1 + mov.l @(12,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L88: + mov.l @(4,r14),r2 + mov r2,r1 + add #4,r1 + mov.l @r1,r2 + mov.l r2,@(16,r14) + mov.l @r14,r1 + mov r1,r8 + add #4,r8 + mov.l .L102,r1 + mov.l @(20,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L103,r1 + mov.l @(24,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L86: + mov.l @(4,r14),r1 + mov.l @r1,r2 + mov.l r2,@(12,r14) + mov.l @r14,r8 + mov.l .L102,r1 + mov.l @(16,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L103,r1 + mov.l @(20,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 + mov.l @(4,r14),r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@(4,r14) + mov.l @r14,r1 + mov r1,r2 + add #-16,r2 + mov.l r2,@r14 + mov.l @(8,r14),r1 + mov r1,r2 + add #-4,r2 + mov.l r2,@(8,r14) +.L100: + mov.l @(8,r14),r1 + tst r1,r1 + bf .L101 + bra .L99 + nop + .align 2 +.L101: + bra .L95 + nop + .align 2 +.L99: + nop +.L94: + mov.l @r14,r1 + mov r1,r8 + add #12,r8 + mov.l .L102,r1 + mov.l @(12,r14),r4 + mov.l @(28,r14),r5 + jsr @r1 + nop + mov r0,r9 + mov.l .L103,r1 + mov.l @(16,r14),r4 + mov.l @(32,r14),r5 + jsr @r1 + nop + mov.l r0,@(36,r14) + mov.l @(36,r14),r1 + or r9,r1 + mov.l r1,@r8 +.L83: + add #40,r14 + mov r14,r15 + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r9 + mov.l @r15+,r8 + rts + nop +.L104: + .align 2 +.L102: + .long ___lshrsi3 +.L103: + .long ___ashlsi3 +.Lfe4: -- cgit v1.2.3