17c478bd9Sstevel@tonic-gate/*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
57257d1b4Sraf * Common Development and Distribution License (the "License").
67257d1b4Sraf * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate *
87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate * and limitations under the License.
127c478bd9Sstevel@tonic-gate *
137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate *
197c478bd9Sstevel@tonic-gate * CDDL HEADER END
207c478bd9Sstevel@tonic-gate */
217257d1b4Sraf
227c478bd9Sstevel@tonic-gate/*
23*1e49577aSRod Evans * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate */
257c478bd9Sstevel@tonic-gate
269a70fc3bSMark J. Nelson	.file	"memcmp.s"
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate/*
297c478bd9Sstevel@tonic-gate * memcmp(s1, s2, len)
307c478bd9Sstevel@tonic-gate *
317c478bd9Sstevel@tonic-gate * Compare n bytes:  s1>s2: >0  s1==s2: 0  s1<s2: <0
327c478bd9Sstevel@tonic-gate *
337c478bd9Sstevel@tonic-gate * Fast assembler language version of the following C-program for memcmp
347c478bd9Sstevel@tonic-gate * which represents the `standard' for the C-library.
357c478bd9Sstevel@tonic-gate *
367c478bd9Sstevel@tonic-gate *	int
377c478bd9Sstevel@tonic-gate *	memcmp(const void *s1, const void *s2, size_t n)
387c478bd9Sstevel@tonic-gate *	{
397c478bd9Sstevel@tonic-gate *		if (s1 != s2 && n != 0) {
407c478bd9Sstevel@tonic-gate *			const char *ps1 = s1;
417c478bd9Sstevel@tonic-gate *			const char *ps2 = s2;
427c478bd9Sstevel@tonic-gate *			do {
437c478bd9Sstevel@tonic-gate *				if (*ps1++ != *ps2++)
447c478bd9Sstevel@tonic-gate *					return(ps1[-1] - ps2[-1]);
457c478bd9Sstevel@tonic-gate *			} while (--n != 0);
467c478bd9Sstevel@tonic-gate *		}
477c478bd9Sstevel@tonic-gate *		return (0);
487c478bd9Sstevel@tonic-gate *	}
497c478bd9Sstevel@tonic-gate */
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gate#include <sys/asm_linkage.h>
527c478bd9Sstevel@tonic-gate#include <sys/sun4asi.h>
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate	ANSI_PRAGMA_WEAK(memcmp,function)
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate	ENTRY(memcmp)
577c478bd9Sstevel@tonic-gate	cmp	%o0, %o1		! s1 == s2?
587c478bd9Sstevel@tonic-gate	be	%ncc, .cmpeq
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gate	! for small counts byte compare immediately
617c478bd9Sstevel@tonic-gate	cmp	%o2, 48
627c478bd9Sstevel@tonic-gate	bleu,a 	%ncc, .bytcmp
637c478bd9Sstevel@tonic-gate	mov	%o2, %o3		! o3 <= 48
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate	! Count > 48. We will byte compare (8 + num of bytes to dbl align)
667c478bd9Sstevel@tonic-gate	! bytes. We assume that most miscompares will occur in the 1st 8 bytes
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate.chkdbl:
697c478bd9Sstevel@tonic-gate        and     %o0, 7, %o4             ! is s1 aligned on a 8 byte bound
707c478bd9Sstevel@tonic-gate	mov	8, %o3			! o2 > 48;  o3 = 8
717c478bd9Sstevel@tonic-gate        sub     %o4, 8, %o4		! o4 = -(num of bytes to dbl align)
727c478bd9Sstevel@tonic-gate	ba	%ncc, .bytcmp
737c478bd9Sstevel@tonic-gate        sub     %o3, %o4, %o3           ! o3 = 8 + (num of bytes to dbl align)
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate1:      ldub    [%o1], %o5        	! byte compare loop
777c478bd9Sstevel@tonic-gate        inc     %o1
787c478bd9Sstevel@tonic-gate        inc     %o0
797c478bd9Sstevel@tonic-gate	dec	%o2
807c478bd9Sstevel@tonic-gate        cmp     %o4, %o5
817c478bd9Sstevel@tonic-gate	bne	%ncc, .noteq
827c478bd9Sstevel@tonic-gate.bytcmp:
837c478bd9Sstevel@tonic-gate	deccc   %o3
847c478bd9Sstevel@tonic-gate	bgeu,a   %ncc, 1b
857c478bd9Sstevel@tonic-gate        ldub    [%o0], %o4
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate	! Check to see if there are more bytes to compare
887c478bd9Sstevel@tonic-gate	cmp	%o2, 0			! is o2 > 0
897c478bd9Sstevel@tonic-gate	bgu,a	%ncc, .blkchk		! we should already be dbl aligned
907c478bd9Sstevel@tonic-gate	cmp     %o2, 320                ! if cnt < 256 + 64 -  no Block ld/st
917c478bd9Sstevel@tonic-gate.cmpeq:
927c478bd9Sstevel@tonic-gate        retl                             ! strings compare equal
937c478bd9Sstevel@tonic-gate	sub	%g0, %g0, %o0
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gate.noteq:
967c478bd9Sstevel@tonic-gate	retl				! strings aren't equal
977c478bd9Sstevel@tonic-gate	sub	%o4, %o5, %o0		! return(*s1 - *s2)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate
1007c478bd9Sstevel@tonic-gate        ! Now src1 is Double word aligned
1017c478bd9Sstevel@tonic-gate.blkchk:
1027c478bd9Sstevel@tonic-gate        bgeu,a   %ncc, blkcmp                  ! do block cmp
1037c478bd9Sstevel@tonic-gate        andcc   %o0, 63, %o3            ! is src1 block aligned
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gate        ! double word compare - using ldd and faligndata. Compares upto
1067c478bd9Sstevel@tonic-gate        ! 8 byte multiple count and does byte compare for the residual.
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gate.dwcmp:
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gate        rd      %fprs, %o3              ! o3 = fprs
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
1137c478bd9Sstevel@tonic-gate        ! So set it anyway, without checking.
1147c478bd9Sstevel@tonic-gate        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gate        andn    %o2, 7, %o4             ! o4 has 8 byte aligned cnt
1177c478bd9Sstevel@tonic-gate	sub     %o4, 8, %o4
1187c478bd9Sstevel@tonic-gate        alignaddr %o1, %g0, %g1
1197c478bd9Sstevel@tonic-gate        ldd     [%g1], %d0
1207c478bd9Sstevel@tonic-gate4:
1217c478bd9Sstevel@tonic-gate        add     %g1, 8, %g1
1227c478bd9Sstevel@tonic-gate        ldd     [%g1], %d2
1237c478bd9Sstevel@tonic-gate	ldd	[%o0], %d6
1247c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d8
1257c478bd9Sstevel@tonic-gate	fcmpne32 %d6, %d8, %o5
1267c478bd9Sstevel@tonic-gate	fsrc1	%d6, %d6		! 2 fsrc1's added since o5 cannot
1277c478bd9Sstevel@tonic-gate	fsrc1	%d8, %d8		! be used for 3 cycles else we
1287c478bd9Sstevel@tonic-gate	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
1297c478bd9Sstevel@tonic-gate	brnz,a,pn %o5, 6f
1307c478bd9Sstevel@tonic-gate	sub     %o1, %o0, %o1           ! o1 gets the difference
1317c478bd9Sstevel@tonic-gate        subcc   %o4, 8, %o4
1327c478bd9Sstevel@tonic-gate        add     %o0, 8, %o0
1337c478bd9Sstevel@tonic-gate        add     %o1, 8, %o1
1347c478bd9Sstevel@tonic-gate        bgu,pt	%ncc, 4b
1357c478bd9Sstevel@tonic-gate        sub     %o2, 8, %o2
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gate.residcmp:
1387c478bd9Sstevel@tonic-gate        ba      6f
1397c478bd9Sstevel@tonic-gate	sub     %o1, %o0, %o1           ! o1 gets the difference
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gate5:      ldub    [%o0 + %o1], %o5        ! byte compare loop
1427c478bd9Sstevel@tonic-gate        inc     %o0
1437c478bd9Sstevel@tonic-gate        cmp     %o4, %o5
1447c478bd9Sstevel@tonic-gate        bne     %ncc, .dnoteq
1457c478bd9Sstevel@tonic-gate6:
1467c478bd9Sstevel@tonic-gate        deccc   %o2
1477c478bd9Sstevel@tonic-gate        bgeu,a	%ncc, 5b
1487c478bd9Sstevel@tonic-gate        ldub    [%o0], %o4
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gate	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
1517c478bd9Sstevel@tonic-gate	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
1527c478bd9Sstevel@tonic-gate	retl
1537c478bd9Sstevel@tonic-gate	sub	%g0, %g0, %o0		! strings compare equal
1547c478bd9Sstevel@tonic-gate
1557c478bd9Sstevel@tonic-gate.dnoteq:
1567c478bd9Sstevel@tonic-gate	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
1577c478bd9Sstevel@tonic-gate	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
1587c478bd9Sstevel@tonic-gate	retl
1597c478bd9Sstevel@tonic-gate	sub	%o4, %o5, %o0		! return(*s1 - *s2)
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gateblkcmp:
1637c478bd9Sstevel@tonic-gate	save    %sp, -SA(MINFRAME), %sp
1647c478bd9Sstevel@tonic-gate        rd      %fprs, %l5              ! l5 = fprs
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gate        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
1677c478bd9Sstevel@tonic-gate        ! So set it anyway, without checking.
1687c478bd9Sstevel@tonic-gate        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gate	bz,pn   %ncc, .blalign          ! now block aligned
1717c478bd9Sstevel@tonic-gate        sub     %i3, 64, %i3
1727c478bd9Sstevel@tonic-gate        neg     %i3                     ! bytes till block aligned
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate        ! Compare %i3 bytes till dst is block (64 byte) aligned. use
1757c478bd9Sstevel@tonic-gate        ! double word compares.
1767c478bd9Sstevel@tonic-gate
1777c478bd9Sstevel@tonic-gate        alignaddr %i1, %g0, %g1
1787c478bd9Sstevel@tonic-gate        ldd     [%g1], %d0
1797c478bd9Sstevel@tonic-gate7:
1807c478bd9Sstevel@tonic-gate        add     %g1, 8, %g1
1817c478bd9Sstevel@tonic-gate        ldd     [%g1], %d2
1827c478bd9Sstevel@tonic-gate        ldd     [%i0], %d6
1837c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d8
1847c478bd9Sstevel@tonic-gate        fcmpne32 %d6, %d8, %i5
1857c478bd9Sstevel@tonic-gate	fsrc1	%d6, %d6		! 2 fsrc1's added since i5 cannot
1867c478bd9Sstevel@tonic-gate	fsrc1	%d8, %d8		! be used for 3 cycles else we
1877c478bd9Sstevel@tonic-gate	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
1887c478bd9Sstevel@tonic-gate        brnz,a,pn  %i5, .remcmp
1897c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
1907c478bd9Sstevel@tonic-gate        subcc   %i3, 8, %i3
1917c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
1927c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
1937c478bd9Sstevel@tonic-gate        bgu,pt	%ncc, 7b
1947c478bd9Sstevel@tonic-gate        sub     %i2, 8, %i2
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate.blalign:
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gate	! src1 is block aligned
1997c478bd9Sstevel@tonic-gate        membar  #StoreLoad
2007c478bd9Sstevel@tonic-gate        srl     %i1, 3, %l6             ! bits 3,4,5 are now least sig in  %l6
2017c478bd9Sstevel@tonic-gate        andcc   %l6, 7, %l6             ! mask everything except bits 1,2 3
2027c478bd9Sstevel@tonic-gate        andn    %i2, 63, %i3            ! calc number of blocks
2037c478bd9Sstevel@tonic-gate        alignaddr %i1, %g0, %g0         ! gen %gsr
2047c478bd9Sstevel@tonic-gate        andn    %i1, 0x3F, %l7          ! blk aligned address
2057c478bd9Sstevel@tonic-gate        sub     %i2, %i3, %l2
2067c478bd9Sstevel@tonic-gate        andn    %l2, 7, %i4             ! calc doubles left after blkcpy
2077c478bd9Sstevel@tonic-gate
2087c478bd9Sstevel@tonic-gate	be,a	%ncc, 1f	! branch taken if src2 is 64-byte aligned
2097c478bd9Sstevel@tonic-gate	ldda	[%l7]ASI_BLK_P, %d0
2107c478bd9Sstevel@tonic-gate
2117c478bd9Sstevel@tonic-gate	call	.+8		! get the address of this instruction in %o7
2127c478bd9Sstevel@tonic-gate	sll	%l6, 2, %l4
2137c478bd9Sstevel@tonic-gate	add	%o7, %l4, %o7
2147c478bd9Sstevel@tonic-gate	jmp	%o7 + 16	! jump to the starting ldd instruction
2157c478bd9Sstevel@tonic-gate	nop
2167c478bd9Sstevel@tonic-gate	ldd	[%l7+8], %d2
2177c478bd9Sstevel@tonic-gate	ldd	[%l7+16], %d4
2187c478bd9Sstevel@tonic-gate	ldd	[%l7+24], %d6
2197c478bd9Sstevel@tonic-gate	ldd	[%l7+32], %d8
2207c478bd9Sstevel@tonic-gate	ldd	[%l7+40], %d10
2217c478bd9Sstevel@tonic-gate	ldd	[%l7+48], %d12
2227c478bd9Sstevel@tonic-gate	ldd	[%l7+56], %d14
2237c478bd9Sstevel@tonic-gate1:
2247c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
2257c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
2267c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
2277c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
2287c478bd9Sstevel@tonic-gate	sub     %i3, 128, %i3
2297c478bd9Sstevel@tonic-gate
2307c478bd9Sstevel@tonic-gate        ! switch statement to get us to the right 8 byte blk within a
2317c478bd9Sstevel@tonic-gate        ! 64 byte block
2327c478bd9Sstevel@tonic-gate
2337c478bd9Sstevel@tonic-gate        cmp      %l6, 4
2347c478bd9Sstevel@tonic-gate        bgeu,a	hlf
2357c478bd9Sstevel@tonic-gate        cmp      %l6, 6
2367c478bd9Sstevel@tonic-gate        cmp      %l6, 2
2377c478bd9Sstevel@tonic-gate        bgeu,a	sqtr
2387c478bd9Sstevel@tonic-gate        nop
2397c478bd9Sstevel@tonic-gate        cmp      %l6, 1
2407c478bd9Sstevel@tonic-gate        be,a     seg1
2417c478bd9Sstevel@tonic-gate        nop
2427c478bd9Sstevel@tonic-gate        ba       seg0
2437c478bd9Sstevel@tonic-gate        nop
2447c478bd9Sstevel@tonic-gatesqtr:
2457c478bd9Sstevel@tonic-gate        be,a     seg2
2467c478bd9Sstevel@tonic-gate        nop
2477c478bd9Sstevel@tonic-gate
2487c478bd9Sstevel@tonic-gate        ba,a     seg3
2497c478bd9Sstevel@tonic-gate        nop
2507c478bd9Sstevel@tonic-gate
2517c478bd9Sstevel@tonic-gatehlf:
2527c478bd9Sstevel@tonic-gate        bgeu,a	fqtr
2537c478bd9Sstevel@tonic-gate        nop
2547c478bd9Sstevel@tonic-gate        cmp      %l6, 5
2557c478bd9Sstevel@tonic-gate        be,a     seg5
2567c478bd9Sstevel@tonic-gate        nop
2577c478bd9Sstevel@tonic-gate        ba       seg4
2587c478bd9Sstevel@tonic-gate        nop
2597c478bd9Sstevel@tonic-gatefqtr:
2607c478bd9Sstevel@tonic-gate        be,a     seg6
2617c478bd9Sstevel@tonic-gate        nop
2627c478bd9Sstevel@tonic-gate        ba       seg7
2637c478bd9Sstevel@tonic-gate        nop
2647c478bd9Sstevel@tonic-gate
2657c478bd9Sstevel@tonic-gate! The fsrc1 instructions are to make sure that the results of the fcmpne32
2667c478bd9Sstevel@tonic-gate! are used 3 cycles later - else spitfire adds 9 bubbles.
2677c478bd9Sstevel@tonic-gate
2687c478bd9Sstevel@tonic-gate#define	FCMPNE32_D32_D48			\
2697c478bd9Sstevel@tonic-gate	fcmpne32	%d48, %d32, %l0		;\
2707c478bd9Sstevel@tonic-gate	fcmpne32	%d50, %d34, %l1		;\
2717c478bd9Sstevel@tonic-gate	fcmpne32	%d52, %d36, %l2		;\
2727c478bd9Sstevel@tonic-gate	fcmpne32	%d54, %d38, %l3		;\
2737c478bd9Sstevel@tonic-gate	brnz,a		%l0, add		;\
2747c478bd9Sstevel@tonic-gate	mov		0, %l4			;\
2757c478bd9Sstevel@tonic-gate	fcmpne32	%d56, %d40, %l0		;\
2767c478bd9Sstevel@tonic-gate	brnz,a		%l1, add		;\
2777c478bd9Sstevel@tonic-gate	mov		8, %l4			;\
2787c478bd9Sstevel@tonic-gate	fcmpne32	%d58, %d42, %l1		;\
2797c478bd9Sstevel@tonic-gate	brnz,a		%l2, add		;\
2807c478bd9Sstevel@tonic-gate	mov		16, %l4			;\
2817c478bd9Sstevel@tonic-gate	fcmpne32	%d60, %d44, %l2		;\
2827c478bd9Sstevel@tonic-gate	brnz,a		%l3, add		;\
2837c478bd9Sstevel@tonic-gate	mov		24, %l4			;\
2847c478bd9Sstevel@tonic-gate	fcmpne32	%d62, %d46, %l3		;\
2857c478bd9Sstevel@tonic-gate	brnz,a		%l0, add		;\
2867c478bd9Sstevel@tonic-gate	mov		32, %l4			;\
2877c478bd9Sstevel@tonic-gate        fsrc1           %d48, %d48              ;\
2887c478bd9Sstevel@tonic-gate	brnz,a		%l1, add		;\
2897c478bd9Sstevel@tonic-gate	mov		40, %l4			;\
2907c478bd9Sstevel@tonic-gate        fsrc1           %d48, %d48              ;\
2917c478bd9Sstevel@tonic-gate	brnz,a		%l2, add		;\
2927c478bd9Sstevel@tonic-gate	mov		48, %l4			;\
2937c478bd9Sstevel@tonic-gate        fsrc1           %d48, %d48              ;\
2947c478bd9Sstevel@tonic-gate	brnz,a		%l3, add		;\
2957c478bd9Sstevel@tonic-gate	mov		56, %l4
2967c478bd9Sstevel@tonic-gate
2977c478bd9Sstevel@tonic-gateadd:
2987c478bd9Sstevel@tonic-gate	add	%l4, %i0, %i0
2997c478bd9Sstevel@tonic-gate	add	%l4, %i1, %i1
3007c478bd9Sstevel@tonic-gate	ba	.remcmp
3017c478bd9Sstevel@tonic-gate	sub	%i1, %i0, %i1
3027c478bd9Sstevel@tonic-gate
3037c478bd9Sstevel@tonic-gate#define FALIGN_D0                       \
3047c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d48       ;\
3057c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d50       ;\
3067c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d52       ;\
3077c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d54       ;\
3087c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d56      ;\
3097c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d58     ;\
3107c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d60     ;\
3117c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d62
3127c478bd9Sstevel@tonic-gate
3137c478bd9Sstevel@tonic-gate#define FALIGN_D16                      \
3147c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d48     ;\
3157c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d50     ;\
3167c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d52     ;\
3177c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d54     ;\
3187c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d56     ;\
3197c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d58     ;\
3207c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d60     ;\
3217c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d62
3227c478bd9Sstevel@tonic-gate
3237c478bd9Sstevel@tonic-gateseg0:
3247c478bd9Sstevel@tonic-gate        FALIGN_D0
3257c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
3267c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
3277c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
3287c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
3297c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
3307c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
3317c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
3327c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
3337c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
3347c478bd9Sstevel@tonic-gate
3357c478bd9Sstevel@tonic-gate        FALIGN_D16
3367c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
3377c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
3387c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
3397c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
3407c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
3417c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
3427c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
3437c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
3447c478bd9Sstevel@tonic-gate
3457c478bd9Sstevel@tonic-gate        ba	%ncc, seg0
3467c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
3477c478bd9Sstevel@tonic-gate
3487c478bd9Sstevel@tonic-gate0:
3497c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
3507c478bd9Sstevel@tonic-gate	membar  #Sync
3517c478bd9Sstevel@tonic-gate	FALIGN_D0
3527c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
3537c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
3547c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
3557c478bd9Sstevel@tonic-gate	ba	%ncc, blkd16
3567c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
3577c478bd9Sstevel@tonic-gate
3587c478bd9Sstevel@tonic-gate1:
3597c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
3607c478bd9Sstevel@tonic-gate	membar  #Sync
3617c478bd9Sstevel@tonic-gate	FALIGN_D16
3627c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
3637c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
3647c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
3657c478bd9Sstevel@tonic-gate	ba	%ncc, blkd0
3667c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
3677c478bd9Sstevel@tonic-gate
3687c478bd9Sstevel@tonic-gate#define FALIGN_D2                       \
3697c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d48       ;\
3707c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d50       ;\
3717c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d52       ;\
3727c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d54      ;\
3737c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d56     ;\
3747c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d58     ;\
3757c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d60     ;\
3767c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d62
3777c478bd9Sstevel@tonic-gate
3787c478bd9Sstevel@tonic-gate#define FALIGN_D18                      \
3797c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d48     ;\
3807c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d50     ;\
3817c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d52     ;\
3827c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d54     ;\
3837c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d56     ;\
3847c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d58     ;\
3857c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d60      ;\
3867c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d62
3877c478bd9Sstevel@tonic-gate
3887c478bd9Sstevel@tonic-gate
3897c478bd9Sstevel@tonic-gateseg1:
3907c478bd9Sstevel@tonic-gate        FALIGN_D2
3917c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
3927c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
3937c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
3947c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
3957c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
3967c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
3977c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
3987c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
3997c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
4007c478bd9Sstevel@tonic-gate
4017c478bd9Sstevel@tonic-gate        FALIGN_D18
4027c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
4037c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
4047c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4057c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4067c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4077c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
4087c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
4097c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4107c478bd9Sstevel@tonic-gate
4117c478bd9Sstevel@tonic-gate        ba	%ncc, seg1
4127c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
4137c478bd9Sstevel@tonic-gate
4147c478bd9Sstevel@tonic-gate0:
4157c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
4167c478bd9Sstevel@tonic-gate	membar  #Sync
4177c478bd9Sstevel@tonic-gate	FALIGN_D2
4187c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4197c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4207c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4217c478bd9Sstevel@tonic-gate	ba	%ncc, blkd18
4227c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4237c478bd9Sstevel@tonic-gate
4247c478bd9Sstevel@tonic-gate1:
4257c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
4267c478bd9Sstevel@tonic-gate	membar  #Sync
4277c478bd9Sstevel@tonic-gate	FALIGN_D18
4287c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4297c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4307c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4317c478bd9Sstevel@tonic-gate	ba	%ncc, blkd2
4327c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4337c478bd9Sstevel@tonic-gate
4347c478bd9Sstevel@tonic-gate#define FALIGN_D4                       \
4357c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d48       ;\
4367c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d50       ;\
4377c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d52      ;\
4387c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d54     ;\
4397c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d56     ;\
4407c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d58     ;\
4417c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d60     ;\
4427c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d62
4437c478bd9Sstevel@tonic-gate
4447c478bd9Sstevel@tonic-gate#define FALIGN_D20                      \
4457c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d48     ;\
4467c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d50     ;\
4477c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d52     ;\
4487c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d54     ;\
4497c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d56     ;\
4507c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d58      ;\
4517c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d60       ;\
4527c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d62
4537c478bd9Sstevel@tonic-gate
4547c478bd9Sstevel@tonic-gateseg2:
4557c478bd9Sstevel@tonic-gate	FALIGN_D4
4567c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
4577c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
4587c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4597c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4607c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4617c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
4627c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
4637c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4647c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
4657c478bd9Sstevel@tonic-gate
4667c478bd9Sstevel@tonic-gate        FALIGN_D20
4677c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
4687c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
4697c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4707c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4717c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4727c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
4737c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
4747c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4757c478bd9Sstevel@tonic-gate
4767c478bd9Sstevel@tonic-gate        ba	%ncc, seg2
4777c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
4787c478bd9Sstevel@tonic-gate
4797c478bd9Sstevel@tonic-gate0:
4807c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
4817c478bd9Sstevel@tonic-gate	membar  #Sync
4827c478bd9Sstevel@tonic-gate	FALIGN_D4
4837c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4847c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4857c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4867c478bd9Sstevel@tonic-gate	ba	%ncc, blkd20
4877c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4887c478bd9Sstevel@tonic-gate
4897c478bd9Sstevel@tonic-gate1:
4907c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
4917c478bd9Sstevel@tonic-gate	membar  #Sync
4927c478bd9Sstevel@tonic-gate	FALIGN_D20
4937c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
4947c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
4957c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
4967c478bd9Sstevel@tonic-gate	ba	%ncc, blkd4
4977c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
4987c478bd9Sstevel@tonic-gate
4997c478bd9Sstevel@tonic-gate#define FALIGN_D6                       \
5007c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d48       ;\
5017c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d50      ;\
5027c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d52     ;\
5037c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d54     ;\
5047c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d56     ;\
5057c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d58     ;\
5067c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d60     ;\
5077c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d62
5087c478bd9Sstevel@tonic-gate
5097c478bd9Sstevel@tonic-gate#define FALIGN_D22                      \
5107c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d48     ;\
5117c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d50     ;\
5127c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d52     ;\
5137c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d54     ;\
5147c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d56      ;\
5157c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d58       ;\
5167c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d60       ;\
5177c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d62
5187c478bd9Sstevel@tonic-gate
5197c478bd9Sstevel@tonic-gate
5207c478bd9Sstevel@tonic-gateseg3:
5217c478bd9Sstevel@tonic-gate        FALIGN_D6
5227c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
5237c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
5247c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
5257c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
5267c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
5277c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
5287c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
5297c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
5307c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
5317c478bd9Sstevel@tonic-gate
5327c478bd9Sstevel@tonic-gate        FALIGN_D22
5337c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
5347c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
5357c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
5367c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
5377c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
5387c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
5397c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
5407c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
5417c478bd9Sstevel@tonic-gate
5427c478bd9Sstevel@tonic-gate        ba	%ncc, seg3
5437c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
5447c478bd9Sstevel@tonic-gate
5457c478bd9Sstevel@tonic-gate
5467c478bd9Sstevel@tonic-gate0:
5477c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
5487c478bd9Sstevel@tonic-gate	membar  #Sync
5497c478bd9Sstevel@tonic-gate	FALIGN_D6
5507c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
5517c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
5527c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
5537c478bd9Sstevel@tonic-gate	ba	%ncc, blkd22
5547c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
5557c478bd9Sstevel@tonic-gate
5567c478bd9Sstevel@tonic-gate1:
5577c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
5587c478bd9Sstevel@tonic-gate	membar  #Sync
5597c478bd9Sstevel@tonic-gate	FALIGN_D22
5607c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
5617c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
5627c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
5637c478bd9Sstevel@tonic-gate	ba	%ncc, blkd6
5647c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
5657c478bd9Sstevel@tonic-gate
5667c478bd9Sstevel@tonic-gate#define FALIGN_D8                       \
5677c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d48      ;\
5687c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d50     ;\
5697c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d52     ;\
5707c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d54     ;\
5717c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d56     ;\
5727c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d58     ;\
5737c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d60     ;\
5747c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d62
5757c478bd9Sstevel@tonic-gate
5767c478bd9Sstevel@tonic-gate#define FALIGN_D24                      \
5777c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d48     ;\
5787c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d50     ;\
5797c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d52     ;\
5807c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d54      ;\
5817c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d56       ;\
5827c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d58       ;\
5837c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d60       ;\
5847c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d62
5857c478bd9Sstevel@tonic-gate
5867c478bd9Sstevel@tonic-gate
5877c478bd9Sstevel@tonic-gateseg4:
5887c478bd9Sstevel@tonic-gate        FALIGN_D8
5897c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
5907c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
5917c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
5927c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
5937c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
5947c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
5957c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
5967c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
5977c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
5987c478bd9Sstevel@tonic-gate
5997c478bd9Sstevel@tonic-gate        FALIGN_D24
6007c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
6017c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
6027c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6037c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6047c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6057c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
6067c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
6077c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6087c478bd9Sstevel@tonic-gate
6097c478bd9Sstevel@tonic-gate        ba	%ncc, seg4
6107c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
6117c478bd9Sstevel@tonic-gate
6127c478bd9Sstevel@tonic-gate
6137c478bd9Sstevel@tonic-gate0:
6147c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
6157c478bd9Sstevel@tonic-gate	membar  #Sync
6167c478bd9Sstevel@tonic-gate	FALIGN_D8
6177c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6187c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6197c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6207c478bd9Sstevel@tonic-gate	ba	%ncc, blkd24
6217c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6227c478bd9Sstevel@tonic-gate
6237c478bd9Sstevel@tonic-gate1:
6247c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
6257c478bd9Sstevel@tonic-gate	membar  #Sync
6267c478bd9Sstevel@tonic-gate	FALIGN_D24
6277c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6287c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6297c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6307c478bd9Sstevel@tonic-gate	ba	%ncc, blkd8
6317c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6327c478bd9Sstevel@tonic-gate
6337c478bd9Sstevel@tonic-gate#define FALIGN_D10                      \
6347c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d48     ;\
6357c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d50     ;\
6367c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d52     ;\
6377c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d54     ;\
6387c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d56     ;\
6397c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d58     ;\
6407c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d60     ;\
6417c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d62
6427c478bd9Sstevel@tonic-gate
6437c478bd9Sstevel@tonic-gate#define FALIGN_D26                      \
6447c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d48     ;\
6457c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d50     ;\
6467c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d52      ;\
6477c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d54       ;\
6487c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d56       ;\
6497c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d58       ;\
6507c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d60       ;\
6517c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d62
6527c478bd9Sstevel@tonic-gate
6537c478bd9Sstevel@tonic-gate
6547c478bd9Sstevel@tonic-gateseg5:
6557c478bd9Sstevel@tonic-gate        FALIGN_D10
6567c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
6577c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
6587c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6597c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6607c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6617c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
6627c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
6637c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6647c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
6657c478bd9Sstevel@tonic-gate
6667c478bd9Sstevel@tonic-gate        FALIGN_D26
6677c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
6687c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
6697c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6707c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6717c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6727c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
6737c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
6747c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6757c478bd9Sstevel@tonic-gate
6767c478bd9Sstevel@tonic-gate        ba	%ncc, seg5
6777c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
6787c478bd9Sstevel@tonic-gate
6797c478bd9Sstevel@tonic-gate
6807c478bd9Sstevel@tonic-gate0:
6817c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
6827c478bd9Sstevel@tonic-gate	membar  #Sync
6837c478bd9Sstevel@tonic-gate	FALIGN_D10
6847c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6857c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6867c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6877c478bd9Sstevel@tonic-gate	ba	%ncc, blkd26
6887c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6897c478bd9Sstevel@tonic-gate
6907c478bd9Sstevel@tonic-gate1:
6917c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
6927c478bd9Sstevel@tonic-gate	membar  #Sync
6937c478bd9Sstevel@tonic-gate	FALIGN_D26
6947c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
6957c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
6967c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
6977c478bd9Sstevel@tonic-gate	ba	%ncc, blkd10
6987c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
6997c478bd9Sstevel@tonic-gate
7007c478bd9Sstevel@tonic-gate#define FALIGN_D12                      \
7017c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d48     ;\
7027c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d50     ;\
7037c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d52     ;\
7047c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d54     ;\
7057c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d56     ;\
7067c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d58     ;\
7077c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d60     ;\
7087c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d62
7097c478bd9Sstevel@tonic-gate
7107c478bd9Sstevel@tonic-gate#define FALIGN_D28                      \
7117c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d48     ;\
7127c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d50      ;\
7137c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d52       ;\
7147c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d54       ;\
7157c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d56       ;\
7167c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d58       ;\
7177c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d60      ;\
7187c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d62
7197c478bd9Sstevel@tonic-gate
7207c478bd9Sstevel@tonic-gate
7217c478bd9Sstevel@tonic-gateseg6:
7227c478bd9Sstevel@tonic-gate        FALIGN_D12
7237c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
7247c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
7257c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
7267c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
7277c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
7287c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
7297c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
7307c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
7317c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
7327c478bd9Sstevel@tonic-gate
7337c478bd9Sstevel@tonic-gate        FALIGN_D28
7347c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
7357c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
7367c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
7377c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
7387c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
7397c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
7407c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
7417c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
7427c478bd9Sstevel@tonic-gate
7437c478bd9Sstevel@tonic-gate        ba	%ncc, seg6
7447c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
7457c478bd9Sstevel@tonic-gate
7467c478bd9Sstevel@tonic-gate
7477c478bd9Sstevel@tonic-gate0:
7487c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
7497c478bd9Sstevel@tonic-gate	membar  #Sync
7507c478bd9Sstevel@tonic-gate	FALIGN_D12
7517c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
7527c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
7537c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
7547c478bd9Sstevel@tonic-gate	ba	%ncc, blkd28
7557c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
7567c478bd9Sstevel@tonic-gate
7577c478bd9Sstevel@tonic-gate1:
7587c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
7597c478bd9Sstevel@tonic-gate	membar  #Sync
7607c478bd9Sstevel@tonic-gate	FALIGN_D28
7617c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
7627c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
7637c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
7647c478bd9Sstevel@tonic-gate	ba	%ncc, blkd12
7657c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
7667c478bd9Sstevel@tonic-gate
7677c478bd9Sstevel@tonic-gate#define FALIGN_D14                      \
7687c478bd9Sstevel@tonic-gate        faligndata %d14, %d16, %d48     ;\
7697c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d50     ;\
7707c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d52     ;\
7717c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d54     ;\
7727c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d56     ;\
7737c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d58     ;\
7747c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d60     ;\
7757c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d62
7767c478bd9Sstevel@tonic-gate
7777c478bd9Sstevel@tonic-gate#define FALIGN_D30                      \
7787c478bd9Sstevel@tonic-gate        faligndata %d30, %d0, %d48     ;\
7797c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d50      ;\
7807c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d52      ;\
7817c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d54      ;\
7827c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d56      ;\
7837c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d58     ;\
7847c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d60    ;\
7857c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d62
7867c478bd9Sstevel@tonic-gate
7877c478bd9Sstevel@tonic-gateseg7:
7887c478bd9Sstevel@tonic-gate        FALIGN_D14
7897c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d0
7907c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
7917c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
7927c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
7937c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
7947c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
7957c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 1f
7967c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
7977c478bd9Sstevel@tonic-gate        ldda    [%i0]ASI_BLK_P, %d32
7987c478bd9Sstevel@tonic-gate
7997c478bd9Sstevel@tonic-gate        FALIGN_D30
8007c478bd9Sstevel@tonic-gate        ldda    [%l7]ASI_BLK_P, %d16
8017c478bd9Sstevel@tonic-gate        add     %l7, 64, %l7
8027c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
8037c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
8047c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
8057c478bd9Sstevel@tonic-gate        subcc   %i3, 64, %i3
8067c478bd9Sstevel@tonic-gate        bz,pn   %ncc, 0f
8077c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
8087c478bd9Sstevel@tonic-gate
8097c478bd9Sstevel@tonic-gate        ba	%ncc, seg7
8107c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
8117c478bd9Sstevel@tonic-gate
8127c478bd9Sstevel@tonic-gate0:
8137c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
8147c478bd9Sstevel@tonic-gate	membar  #Sync
8157c478bd9Sstevel@tonic-gate	FALIGN_D14
8167c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
8177c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
8187c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
8197c478bd9Sstevel@tonic-gate	ba	%ncc, blkd30
8207c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
8217c478bd9Sstevel@tonic-gate
8227c478bd9Sstevel@tonic-gate1:
8237c478bd9Sstevel@tonic-gate	ldda	[%i0]ASI_BLK_P, %d32
8247c478bd9Sstevel@tonic-gate	membar  #Sync
8257c478bd9Sstevel@tonic-gate	FALIGN_D30
8267c478bd9Sstevel@tonic-gate	FCMPNE32_D32_D48
8277c478bd9Sstevel@tonic-gate        add     %i0, 64, %i0
8287c478bd9Sstevel@tonic-gate        add     %i1, 64, %i1
8297c478bd9Sstevel@tonic-gate	ba	%ncc, blkd14
8307c478bd9Sstevel@tonic-gate        sub     %i2, 64, %i2
8317c478bd9Sstevel@tonic-gate
8327c478bd9Sstevel@tonic-gate
8337c478bd9Sstevel@tonic-gateblkd0:
8347c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
8357c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
8367c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8377c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d48
8387c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
8397c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
8407c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8417c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8427c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8437c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
8447c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8457c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
8467c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
8477c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
8487c478bd9Sstevel@tonic-gate
8497c478bd9Sstevel@tonic-gateblkd2:
8507c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
8517c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
8527c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8537c478bd9Sstevel@tonic-gate        faligndata %d2, %d4, %d48
8547c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
8557c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
8567c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8577c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8587c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8597c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
8607c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8617c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
8627c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
8637c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
8647c478bd9Sstevel@tonic-gate
8657c478bd9Sstevel@tonic-gateblkd4:
8667c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
8677c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
8687c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8697c478bd9Sstevel@tonic-gate        faligndata %d4, %d6, %d48
8707c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
8717c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
8727c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8737c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8747c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8757c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
8767c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8777c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
8787c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
8797c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
8807c478bd9Sstevel@tonic-gate
8817c478bd9Sstevel@tonic-gateblkd6:
8827c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
8837c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
8847c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8857c478bd9Sstevel@tonic-gate        faligndata %d6, %d8, %d48
8867c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
8877c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
8887c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8897c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8907c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
8917c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
8927c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
8937c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
8947c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
8957c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
8967c478bd9Sstevel@tonic-gate
8977c478bd9Sstevel@tonic-gateblkd8:
8987c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
8997c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9007c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9017c478bd9Sstevel@tonic-gate        faligndata %d8, %d10, %d48
9027c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
9037c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
9047c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9057c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9067c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9077c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
9087c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9097c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
9107c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
9117c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
9127c478bd9Sstevel@tonic-gate
9137c478bd9Sstevel@tonic-gateblkd10:
9147c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
9157c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9167c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9177c478bd9Sstevel@tonic-gate        faligndata %d10, %d12, %d48
9187c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
9197c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
9207c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9217c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9227c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9237c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
9247c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9257c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
9267c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
9277c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
9287c478bd9Sstevel@tonic-gate
9297c478bd9Sstevel@tonic-gateblkd12:
9307c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
9317c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9327c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9337c478bd9Sstevel@tonic-gate        faligndata %d12, %d14, %d48
9347c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
9357c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
9367c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9377c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9387c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9397c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
9407c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9417c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
9427c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
9437c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
9447c478bd9Sstevel@tonic-gate
9457c478bd9Sstevel@tonic-gateblkd14:
9467c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
9477c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9487c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9497c478bd9Sstevel@tonic-gate        ba,pt 	%ncc, blkleft
9507c478bd9Sstevel@tonic-gate	fmovd   %d14, %d0
9517c478bd9Sstevel@tonic-gate
9527c478bd9Sstevel@tonic-gateblkd16:
9537c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
9547c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9557c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9567c478bd9Sstevel@tonic-gate        faligndata %d16, %d18, %d48
9577c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
9587c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
9597c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9607c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9617c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9627c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
9637c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9647c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
9657c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
9667c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
9677c478bd9Sstevel@tonic-gate
9687c478bd9Sstevel@tonic-gateblkd18:
9697c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
9707c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9717c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9727c478bd9Sstevel@tonic-gate        faligndata %d18, %d20, %d48
9737c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
9747c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
9757c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9767c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9777c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9787c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
9797c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9807c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
9817c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
9827c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
9837c478bd9Sstevel@tonic-gate
9847c478bd9Sstevel@tonic-gateblkd20:
9857c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
9867c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
9877c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9887c478bd9Sstevel@tonic-gate        faligndata %d20, %d22, %d48
9897c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
9907c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
9917c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9927c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9937c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
9947c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
9957c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
9967c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
9977c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
9987c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
9997c478bd9Sstevel@tonic-gate
10007c478bd9Sstevel@tonic-gateblkd22:
10017c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
10027c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
10037c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10047c478bd9Sstevel@tonic-gate        faligndata %d22, %d24, %d48
10057c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
10067c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
10077c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10087c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10097c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10107c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
10117c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10127c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
10137c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
10147c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
10157c478bd9Sstevel@tonic-gate
10167c478bd9Sstevel@tonic-gateblkd24:
10177c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
10187c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
10197c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10207c478bd9Sstevel@tonic-gate        faligndata %d24, %d26, %d48
10217c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
10227c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
10237c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10247c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10257c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10267c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
10277c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10287c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
10297c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
10307c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
10317c478bd9Sstevel@tonic-gate
10327c478bd9Sstevel@tonic-gateblkd26:
10337c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
10347c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
10357c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10367c478bd9Sstevel@tonic-gate        faligndata %d26, %d28, %d48
10377c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
10387c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
10397c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10407c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10417c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10427c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
10437c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10447c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
10457c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
10467c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
10477c478bd9Sstevel@tonic-gate
10487c478bd9Sstevel@tonic-gateblkd28:
10497c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
10507c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
10517c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10527c478bd9Sstevel@tonic-gate        faligndata %d28, %d30, %d48
10537c478bd9Sstevel@tonic-gate	ldd	[%i0], %d32
10547c478bd9Sstevel@tonic-gate	fcmpne32 %d32, %d48, %l1
10557c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10567c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10577c478bd9Sstevel@tonic-gate	fsrc1	%d32, %d32
10587c478bd9Sstevel@tonic-gate	brnz,a	 %l1, .remcmp
10597c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10607c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
10617c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
10627c478bd9Sstevel@tonic-gate	sub	%i2, 8, %i2
10637c478bd9Sstevel@tonic-gate
10647c478bd9Sstevel@tonic-gateblkd30:
10657c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
10667c478bd9Sstevel@tonic-gate        blu,a,pn %ncc, .remcmp
10677c478bd9Sstevel@tonic-gate        sub     %i1, %i0, %i1           ! i1 gets the difference
10687c478bd9Sstevel@tonic-gate        fmovd   %d30, %d0
10697c478bd9Sstevel@tonic-gate
10707c478bd9Sstevel@tonic-gate	! This loop handles doubles remaining that were not loaded(ldda`ed)
10717c478bd9Sstevel@tonic-gate	! in the Block Compare loop
10727c478bd9Sstevel@tonic-gateblkleft:
10737c478bd9Sstevel@tonic-gate        ldd     [%l7], %d2
10747c478bd9Sstevel@tonic-gate        add     %l7, 8, %l7
10757c478bd9Sstevel@tonic-gate        faligndata %d0, %d2, %d8
10767c478bd9Sstevel@tonic-gate	ldd     [%i0], %d32
10777c478bd9Sstevel@tonic-gate        fcmpne32 %d32, %d8, %l1
10787c478bd9Sstevel@tonic-gate	fsrc1	%d2, %d0
10797c478bd9Sstevel@tonic-gate	fsrc1	%d2, %d0
10807c478bd9Sstevel@tonic-gate	fsrc1	%d2, %d0
10817c478bd9Sstevel@tonic-gate	brnz,a	%l1, .remcmp
10827c478bd9Sstevel@tonic-gate	sub     %i1, %i0, %i1           ! i1 gets the difference
10837c478bd9Sstevel@tonic-gate        add     %i0, 8, %i0
10847c478bd9Sstevel@tonic-gate        add     %i1, 8, %i1
10857c478bd9Sstevel@tonic-gate        subcc   %i4, 8, %i4
10867c478bd9Sstevel@tonic-gate        bgeu,pt  %ncc, blkleft
10877c478bd9Sstevel@tonic-gate        sub     %i2, 8, %i2
10887c478bd9Sstevel@tonic-gate
10897c478bd9Sstevel@tonic-gate	ba	%ncc, .remcmp
10907c478bd9Sstevel@tonic-gate	sub     %i1, %i0, %i1           ! i1 gets the difference
10917c478bd9Sstevel@tonic-gate
10927c478bd9Sstevel@tonic-gate6:      ldub    [%i0 + %i1], %i5        ! byte compare loop
10937c478bd9Sstevel@tonic-gate        inc     %i0
10947c478bd9Sstevel@tonic-gate        cmp     %i4, %i5
10957c478bd9Sstevel@tonic-gate        bne     %ncc, .bnoteq
10967c478bd9Sstevel@tonic-gate.remcmp:
10977c478bd9Sstevel@tonic-gate        deccc   %i2
10987c478bd9Sstevel@tonic-gate        bgeu,a   %ncc, 6b
10997c478bd9Sstevel@tonic-gate        ldub    [%i0], %i4
11007c478bd9Sstevel@tonic-gate
11017c478bd9Sstevel@tonic-gateexit:
11027c478bd9Sstevel@tonic-gate	and     %l5, 0x4, %l5           ! fprs.du = fprs.dl = 0
11037c478bd9Sstevel@tonic-gate	wr      %l5, %g0, %fprs         ! fprs = l5 - restore fprs
11047c478bd9Sstevel@tonic-gate	membar  #StoreLoad|#StoreStore
11057c478bd9Sstevel@tonic-gate        ret
11067c478bd9Sstevel@tonic-gate        restore %g0, %g0, %o0
11077c478bd9Sstevel@tonic-gate
11087c478bd9Sstevel@tonic-gate
11097c478bd9Sstevel@tonic-gate.bnoteq:
11107c478bd9Sstevel@tonic-gate	and     %l5, 0x4, %l5           ! fprs.du = fprs.dl = 0
11117c478bd9Sstevel@tonic-gate	wr      %l5, %g0, %fprs         ! fprs = l5 - restore fprs
11127c478bd9Sstevel@tonic-gate	membar  #StoreLoad|#StoreStore
11137c478bd9Sstevel@tonic-gate	sub	%i4, %i5, %i0		! return(*s1 - *s2)
11147c478bd9Sstevel@tonic-gate	ret				! strings aren't equal
11157c478bd9Sstevel@tonic-gate	restore %i0, %g0, %o0
11167c478bd9Sstevel@tonic-gate
11177c478bd9Sstevel@tonic-gate
11187c478bd9Sstevel@tonic-gate
11197c478bd9Sstevel@tonic-gate	SET_SIZE(memcmp)
1120