xref: /onnv-gate/usr/src/lib/libc/amd64/gen/memcmp.s (revision 7298:b69e27387f74)
10Sstevel@tonic-gate/*
20Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
30Sstevel@tonic-gate * Use is subject to license terms.
40Sstevel@tonic-gate */
50Sstevel@tonic-gate
60Sstevel@tonic-gate/*
70Sstevel@tonic-gate * Copyright (c) 2002 Advanced Micro Devices, Inc.
80Sstevel@tonic-gate *
90Sstevel@tonic-gate * All rights reserved.
100Sstevel@tonic-gate *
110Sstevel@tonic-gate * Redistribution and  use in source and binary  forms, with or
120Sstevel@tonic-gate * without  modification,  are   permitted  provided  that  the
130Sstevel@tonic-gate * following conditions are met:
140Sstevel@tonic-gate *
150Sstevel@tonic-gate * + Redistributions  of source  code  must  retain  the  above
160Sstevel@tonic-gate *   copyright  notice,   this  list  of   conditions  and  the
170Sstevel@tonic-gate *   following disclaimer.
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * + Redistributions  in binary  form must reproduce  the above
200Sstevel@tonic-gate *   copyright  notice,   this  list  of   conditions  and  the
210Sstevel@tonic-gate *   following  disclaimer in  the  documentation and/or  other
220Sstevel@tonic-gate *   materials provided with the distribution.
230Sstevel@tonic-gate *
240Sstevel@tonic-gate * + Neither the  name of Advanced Micro Devices,  Inc. nor the
250Sstevel@tonic-gate *   names  of  its contributors  may  be  used  to endorse  or
260Sstevel@tonic-gate *   promote  products  derived   from  this  software  without
270Sstevel@tonic-gate *   specific prior written permission.
280Sstevel@tonic-gate *
290Sstevel@tonic-gate * THIS  SOFTWARE  IS PROVIDED  BY  THE  COPYRIGHT HOLDERS  AND
300Sstevel@tonic-gate * CONTRIBUTORS AS IS AND  ANY EXPRESS OR IMPLIED WARRANTIES,
310Sstevel@tonic-gate * INCLUDING,  BUT NOT  LIMITED TO,  THE IMPLIED  WARRANTIES OF
320Sstevel@tonic-gate * MERCHANTABILITY  AND FITNESS  FOR A  PARTICULAR  PURPOSE ARE
330Sstevel@tonic-gate * DISCLAIMED.  IN  NO  EVENT  SHALL  ADVANCED  MICRO  DEVICES,
340Sstevel@tonic-gate * INC.  OR CONTRIBUTORS  BE LIABLE  FOR ANY  DIRECT, INDIRECT,
350Sstevel@tonic-gate * INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR CONSEQUENTIAL  DAMAGES
360Sstevel@tonic-gate * (INCLUDING,  BUT NOT LIMITED  TO, PROCUREMENT  OF SUBSTITUTE
370Sstevel@tonic-gate * GOODS  OR  SERVICES;  LOSS  OF  USE, DATA,  OR  PROFITS;  OR
380Sstevel@tonic-gate * BUSINESS INTERRUPTION)  HOWEVER CAUSED AND ON  ANY THEORY OF
390Sstevel@tonic-gate * LIABILITY,  WHETHER IN CONTRACT,  STRICT LIABILITY,  OR TORT
400Sstevel@tonic-gate * (INCLUDING NEGLIGENCE  OR OTHERWISE) ARISING IN  ANY WAY OUT
410Sstevel@tonic-gate * OF THE  USE  OF  THIS  SOFTWARE, EVEN  IF  ADVISED  OF  THE
420Sstevel@tonic-gate * POSSIBILITY OF SUCH DAMAGE.
430Sstevel@tonic-gate *
440Sstevel@tonic-gate * It is  licensee's responsibility  to comply with  any export
450Sstevel@tonic-gate * regulations applicable in licensee's jurisdiction.
460Sstevel@tonic-gate */
470Sstevel@tonic-gate
48*7298SMark.J.Nelson@Sun.COM	.file	"memcmp.s"
490Sstevel@tonic-gate
500Sstevel@tonic-gate#include <sys/asm_linkage.h>
510Sstevel@tonic-gate
520Sstevel@tonic-gate	ANSI_PRAGMA_WEAK(memcmp,function)
530Sstevel@tonic-gate
540Sstevel@tonic-gate#include "SYS.h"
550Sstevel@tonic-gate#include "cache.h"
560Sstevel@tonic-gate
570Sstevel@tonic-gate#define LABEL(s) .memcmp/**/s
580Sstevel@tonic-gate
590Sstevel@tonic-gate	ENTRY(memcmp)                 /* (const void *, const void*, size_t) */
600Sstevel@tonic-gate
610Sstevel@tonic-gateLABEL(try1):
620Sstevel@tonic-gate        cmp     $8, %rdx
630Sstevel@tonic-gate        jae     LABEL(1after)
640Sstevel@tonic-gate
650Sstevel@tonic-gateLABEL(1):                                /* 1-byte */
660Sstevel@tonic-gate        test    %rdx, %rdx
670Sstevel@tonic-gate        mov     $0, %eax
680Sstevel@tonic-gate        jz      LABEL(exit)
690Sstevel@tonic-gate
700Sstevel@tonic-gateLABEL(1loop):
710Sstevel@tonic-gate        movzbl  (%rdi), %eax
720Sstevel@tonic-gate        movzbl  (%rsi), %ecx
730Sstevel@tonic-gate        sub     %ecx, %eax
740Sstevel@tonic-gate        jnz     LABEL(exit)
750Sstevel@tonic-gate
760Sstevel@tonic-gate        dec     %rdx
770Sstevel@tonic-gate
780Sstevel@tonic-gate        lea     1 (%rdi), %rdi
790Sstevel@tonic-gate        lea     1 (%rsi), %rsi
800Sstevel@tonic-gate
810Sstevel@tonic-gate        jnz     LABEL(1loop)
820Sstevel@tonic-gate
830Sstevel@tonic-gateLABEL(exit):
840Sstevel@tonic-gate        rep
850Sstevel@tonic-gate        ret
860Sstevel@tonic-gate
870Sstevel@tonic-gate        .p2align 4
880Sstevel@tonic-gate
890Sstevel@tonic-gateLABEL(1after):
900Sstevel@tonic-gate
910Sstevel@tonic-gateLABEL(8try):
920Sstevel@tonic-gate        cmp     $32, %rdx
930Sstevel@tonic-gate        jae     LABEL(8after)
940Sstevel@tonic-gate
950Sstevel@tonic-gateLABEL(8):                        /* 8-byte */
960Sstevel@tonic-gate        mov     %edx, %ecx
970Sstevel@tonic-gate        shr     $3, %ecx
980Sstevel@tonic-gate        jz      LABEL(1)
990Sstevel@tonic-gate
1000Sstevel@tonic-gate        .p2align 4
1010Sstevel@tonic-gate
1020Sstevel@tonic-gateLABEL(8loop):
1030Sstevel@tonic-gate        mov     (%rsi), %rax
1040Sstevel@tonic-gate        cmp     (%rdi), %rax
1050Sstevel@tonic-gate        jne     LABEL(1)
1060Sstevel@tonic-gate
1070Sstevel@tonic-gate        sub     $8, %rdx
1080Sstevel@tonic-gate        dec     %ecx
1090Sstevel@tonic-gate
1100Sstevel@tonic-gate        lea     8 (%rsi), %rsi
1110Sstevel@tonic-gate        lea     8 (%rdi), %rdi
1120Sstevel@tonic-gate
1130Sstevel@tonic-gate        jnz     LABEL(8loop)
1140Sstevel@tonic-gate
1150Sstevel@tonic-gateLABEL(8skip):
1160Sstevel@tonic-gate        and     $7, %edx
1170Sstevel@tonic-gate        jnz     LABEL(1)
1180Sstevel@tonic-gate
1190Sstevel@tonic-gate        xor     %eax, %eax
1200Sstevel@tonic-gate        ret
1210Sstevel@tonic-gate
1220Sstevel@tonic-gate        .p2align 4
1230Sstevel@tonic-gate
1240Sstevel@tonic-gateLABEL(8after):
1250Sstevel@tonic-gate
1260Sstevel@tonic-gateLABEL(32try):
1270Sstevel@tonic-gate        cmp     $2048, %rdx
1280Sstevel@tonic-gate        ja      LABEL(32after)
1290Sstevel@tonic-gate
1300Sstevel@tonic-gateLABEL(32):                               /* 32-byte */
1310Sstevel@tonic-gate        mov     %edx, %ecx
1320Sstevel@tonic-gate        shr     $5, %ecx
1330Sstevel@tonic-gate        jz      LABEL(8)
1340Sstevel@tonic-gate
1350Sstevel@tonic-gate        .p2align 4
1360Sstevel@tonic-gate
1370Sstevel@tonic-gateLABEL(32loop):
1380Sstevel@tonic-gate        mov        (%rsi), %rax
1390Sstevel@tonic-gate        mov      8 (%rsi),  %r8
1400Sstevel@tonic-gate        mov     16 (%rsi),  %r9
1410Sstevel@tonic-gate        mov     24 (%rsi), %r10
1420Sstevel@tonic-gate        sub        (%rdi), %rax
1430Sstevel@tonic-gate        sub      8 (%rdi),  %r8
1440Sstevel@tonic-gate        sub     16 (%rdi),  %r9
1450Sstevel@tonic-gate        sub     24 (%rdi), %r10
1460Sstevel@tonic-gate
1470Sstevel@tonic-gate        or      %rax,  %r8
1480Sstevel@tonic-gate        or       %r9, %r10
1490Sstevel@tonic-gate        or       %r8, %r10
1500Sstevel@tonic-gate        jnz     LABEL(8)
1510Sstevel@tonic-gate
1520Sstevel@tonic-gate        sub     $32, %rdx
1530Sstevel@tonic-gate        dec     %ecx
1540Sstevel@tonic-gate
1550Sstevel@tonic-gate        lea     32 (%rsi), %rsi
1560Sstevel@tonic-gate        lea     32 (%rdi), %rdi
1570Sstevel@tonic-gate
1580Sstevel@tonic-gate        jnz     LABEL(32loop)
1590Sstevel@tonic-gate
1600Sstevel@tonic-gateLABEL(32skip):
1610Sstevel@tonic-gate        and     $31, %edx
1620Sstevel@tonic-gate        jnz     LABEL(8)
1630Sstevel@tonic-gate
1640Sstevel@tonic-gate        xor     %eax, %eax
1650Sstevel@tonic-gate        ret
1660Sstevel@tonic-gate
1670Sstevel@tonic-gate        .p2align 4
1680Sstevel@tonic-gate
1690Sstevel@tonic-gateLABEL(32after):
1700Sstevel@tonic-gate
1710Sstevel@tonic-gate	prefetchnta _sref_(.amd64cache1half)	/* 3DNow: use prefetch */
1720Sstevel@tonic-gate
1730Sstevel@tonic-gateLABEL(srctry):
1740Sstevel@tonic-gate        mov     %esi, %r8d      /* align by source */
1750Sstevel@tonic-gate
1760Sstevel@tonic-gate        and     $7, %r8d
1770Sstevel@tonic-gate        jz      LABEL(srcafter)  /* not unaligned */
1780Sstevel@tonic-gate
1790Sstevel@tonic-gateLABEL(src):                      /* align */
1800Sstevel@tonic-gate        lea     -8 (%r8, %rdx), %rdx
1810Sstevel@tonic-gate        sub     $8, %r8d
1820Sstevel@tonic-gate
1830Sstevel@tonic-gate
1840Sstevel@tonic-gateLABEL(srcloop):
1850Sstevel@tonic-gate        movzbl  (%rdi), %eax
1860Sstevel@tonic-gate        movzbl  (%rsi), %ecx
1870Sstevel@tonic-gate        sub     %ecx, %eax
1880Sstevel@tonic-gate        jnz     LABEL(exit)
1890Sstevel@tonic-gate
1900Sstevel@tonic-gate        inc     %r8d
1910Sstevel@tonic-gate
1920Sstevel@tonic-gate        lea     1 (%rdi), %rdi
1930Sstevel@tonic-gate        lea     1 (%rsi), %rsi
1940Sstevel@tonic-gate
1950Sstevel@tonic-gate        jnz     LABEL(srcloop)
1960Sstevel@tonic-gate
1970Sstevel@tonic-gate        .p2align 4
1980Sstevel@tonic-gate
1990Sstevel@tonic-gateLABEL(srcafter):
2000Sstevel@tonic-gate
2010Sstevel@tonic-gateLABEL(64try):
2020Sstevel@tonic-gate        mov     _sref_(.amd64cache1half), %rcx
2030Sstevel@tonic-gate        cmp	%rdx, %rcx
2040Sstevel@tonic-gate        cmova   %rdx, %rcx
2050Sstevel@tonic-gate
2060Sstevel@tonic-gateLABEL(64):                               /* 64-byte */
2070Sstevel@tonic-gate        shr     $6, %rcx
2080Sstevel@tonic-gate        jz      LABEL(32)
2090Sstevel@tonic-gate
2100Sstevel@tonic-gate        .p2align 4
2110Sstevel@tonic-gate
2120Sstevel@tonic-gateLABEL(64loop):
2130Sstevel@tonic-gate        mov        (%rsi), %rax
2140Sstevel@tonic-gate        mov      8 (%rsi),  %r8
2150Sstevel@tonic-gate        sub        (%rdi), %rax
2160Sstevel@tonic-gate        sub      8 (%rdi),  %r8
2170Sstevel@tonic-gate        or      %r8,  %rax
2180Sstevel@tonic-gate
2190Sstevel@tonic-gate        mov     16 (%rsi),  %r9
2200Sstevel@tonic-gate        mov     24 (%rsi), %r10
2210Sstevel@tonic-gate        sub     16 (%rdi),  %r9
2220Sstevel@tonic-gate        sub     24 (%rdi), %r10
2230Sstevel@tonic-gate        or      %r10, %r9
2240Sstevel@tonic-gate
2250Sstevel@tonic-gate        or      %r9,  %rax
2260Sstevel@tonic-gate        jnz     LABEL(32)
2270Sstevel@tonic-gate
2280Sstevel@tonic-gate        mov     32 (%rsi), %rax
2290Sstevel@tonic-gate        mov     40 (%rsi),  %r8
2300Sstevel@tonic-gate        sub     32 (%rdi), %rax
2310Sstevel@tonic-gate        sub     40 (%rdi),  %r8
2320Sstevel@tonic-gate        or      %r8,  %rax
2330Sstevel@tonic-gate
2340Sstevel@tonic-gate        mov     48 (%rsi),  %r9
2350Sstevel@tonic-gate        mov     56 (%rsi), %r10
2360Sstevel@tonic-gate        sub     48 (%rdi),  %r9
2370Sstevel@tonic-gate        sub     56 (%rdi), %r10
2380Sstevel@tonic-gate        or      %r10, %r9
2390Sstevel@tonic-gate
2400Sstevel@tonic-gate        or      %r9,  %rax
2410Sstevel@tonic-gate        jnz    	LABEL(32)
2420Sstevel@tonic-gate
2430Sstevel@tonic-gate        lea     64 (%rsi), %rsi
2440Sstevel@tonic-gate        lea     64 (%rdi), %rdi
2450Sstevel@tonic-gate
2460Sstevel@tonic-gate        sub     $64, %rdx
2470Sstevel@tonic-gate        dec     %rcx
2480Sstevel@tonic-gate        jnz     LABEL(64loop)
2490Sstevel@tonic-gate
2500Sstevel@tonic-gateLABEL(64skip):
2510Sstevel@tonic-gate        cmp     $2048, %rdx
2520Sstevel@tonic-gate        ja     LABEL(64after)
2530Sstevel@tonic-gate
2540Sstevel@tonic-gate        test    %edx, %edx
2550Sstevel@tonic-gate        jnz     LABEL(32)
2560Sstevel@tonic-gate
2570Sstevel@tonic-gate        xor     %eax, %eax
2580Sstevel@tonic-gate        ret
2590Sstevel@tonic-gate
2600Sstevel@tonic-gate        .p2align 4
2610Sstevel@tonic-gate
2620Sstevel@tonic-gateLABEL(64after):
2630Sstevel@tonic-gate
2640Sstevel@tonic-gateLABEL(pretry):
2650Sstevel@tonic-gate
2660Sstevel@tonic-gateLABEL(pre):                              /* 64-byte prefetching */
2670Sstevel@tonic-gate        mov     _sref_(.amd64cache2half), %rcx
2680Sstevel@tonic-gate        cmp	%rdx, %rcx
2690Sstevel@tonic-gate        cmova   %rdx, %rcx
2700Sstevel@tonic-gate
2710Sstevel@tonic-gate        shr     $6, %rcx
2720Sstevel@tonic-gate        jz      LABEL(preskip)
2730Sstevel@tonic-gate
2740Sstevel@tonic-gate        prefetchnta 512 (%rsi)	/* 3DNow: use prefetch */
2750Sstevel@tonic-gate        prefetchnta 512 (%rdi)	/* 3DNow: use prefetch */
2760Sstevel@tonic-gate
2770Sstevel@tonic-gate        mov        (%rsi), %rax
2780Sstevel@tonic-gate        mov      8 (%rsi), %r9
2790Sstevel@tonic-gate        mov     16 (%rsi), %r10
2800Sstevel@tonic-gate        mov     24 (%rsi), %r11
2810Sstevel@tonic-gate        sub        (%rdi), %rax
2820Sstevel@tonic-gate        sub      8 (%rdi), %r9
2830Sstevel@tonic-gate        sub     16 (%rdi), %r10
2840Sstevel@tonic-gate        sub     24 (%rdi), %r11
2850Sstevel@tonic-gate
2860Sstevel@tonic-gate        or       %r9, %rax
2870Sstevel@tonic-gate        or      %r11, %r10
2880Sstevel@tonic-gate        or      %r10, %rax
2890Sstevel@tonic-gate        jnz     LABEL(32)
2900Sstevel@tonic-gate
2910Sstevel@tonic-gate        mov     32 (%rsi), %rax
2920Sstevel@tonic-gate        mov     40 (%rsi), %r9
2930Sstevel@tonic-gate        mov     48 (%rsi), %r10
2940Sstevel@tonic-gate        mov     56 (%rsi), %r11
2950Sstevel@tonic-gate        sub     32 (%rdi), %rax
2960Sstevel@tonic-gate        sub     40 (%rdi), %r9
2970Sstevel@tonic-gate        sub     48 (%rdi), %r10
2980Sstevel@tonic-gate        sub     56 (%rdi), %r11
2990Sstevel@tonic-gate
3000Sstevel@tonic-gate        or       %r9, %rax
3010Sstevel@tonic-gate        or      %r11, %r10
3020Sstevel@tonic-gate        or      %r10, %rax
3030Sstevel@tonic-gate        jnz     LABEL(32)
3040Sstevel@tonic-gate
3050Sstevel@tonic-gate        lea     64 (%rsi), %rsi
3060Sstevel@tonic-gate        lea     64 (%rdi), %rdi
3070Sstevel@tonic-gate
3080Sstevel@tonic-gate        sub     $64, %rdx
3090Sstevel@tonic-gate        dec     %rcx
3100Sstevel@tonic-gate
3110Sstevel@tonic-gate        .p2align 4
3120Sstevel@tonic-gate
3130Sstevel@tonic-gateLABEL(preloop):
3140Sstevel@tonic-gate        prefetchnta 512 (%rsi)	/* 3DNow: use prefetch */
3150Sstevel@tonic-gate        prefetchnta 512 (%rdi)	/* 3DNow: use prefetch */
3160Sstevel@tonic-gate
3170Sstevel@tonic-gate        mov        (%rsi), %rax
3180Sstevel@tonic-gate        mov      8 (%rsi), %r9
3190Sstevel@tonic-gate        mov     16 (%rsi), %r10
3200Sstevel@tonic-gate        mov     24 (%rsi), %r11
3210Sstevel@tonic-gate        sub        (%rdi), %rax
3220Sstevel@tonic-gate        sub      8 (%rdi), %r9
3230Sstevel@tonic-gate        sub     16 (%rdi), %r10
3240Sstevel@tonic-gate        sub     24 (%rdi), %r11
3250Sstevel@tonic-gate
3260Sstevel@tonic-gate        or       %r9, %rax
3270Sstevel@tonic-gate        or      %r11, %r10
3280Sstevel@tonic-gate        or      %r10, %rax
3290Sstevel@tonic-gate        jnz     LABEL(32)
3300Sstevel@tonic-gate
3310Sstevel@tonic-gate        mov     32 (%rsi), %rax
3320Sstevel@tonic-gate        mov     40 (%rsi), %r9
3330Sstevel@tonic-gate        mov     48 (%rsi), %r10
3340Sstevel@tonic-gate        mov     56 (%rsi), %r11
3350Sstevel@tonic-gate        sub     32 (%rdi), %rax
3360Sstevel@tonic-gate        sub     40 (%rdi), %r9
3370Sstevel@tonic-gate        sub     48 (%rdi), %r10
3380Sstevel@tonic-gate        sub     56 (%rdi), %r11
3390Sstevel@tonic-gate
3400Sstevel@tonic-gate        or       %r9, %rax
3410Sstevel@tonic-gate        or      %r11, %r10
3420Sstevel@tonic-gate        or      %r10, %rax
3430Sstevel@tonic-gate        jnz     LABEL(32)
3440Sstevel@tonic-gate
3450Sstevel@tonic-gate        lea     64 (%rsi), %rsi
3460Sstevel@tonic-gate        lea     64 (%rdi), %rdi
3470Sstevel@tonic-gate
3480Sstevel@tonic-gate        sub     $64, %rdx
3490Sstevel@tonic-gate        dec     %rcx
3500Sstevel@tonic-gate        jnz     LABEL(preloop)
3510Sstevel@tonic-gate
3520Sstevel@tonic-gate
3530Sstevel@tonic-gateLABEL(preskip):
3540Sstevel@tonic-gate        cmp     $2048, %rdx
3550Sstevel@tonic-gate        ja      LABEL(preafter)
3560Sstevel@tonic-gate
3570Sstevel@tonic-gate        test    %edx, %edx
3580Sstevel@tonic-gate        jnz     LABEL(32)
3590Sstevel@tonic-gate
3600Sstevel@tonic-gate        xor     %eax, %eax
3610Sstevel@tonic-gate        ret
3620Sstevel@tonic-gate
3630Sstevel@tonic-gate        .p2align 4
3640Sstevel@tonic-gate
3650Sstevel@tonic-gateLABEL(preafter):
3660Sstevel@tonic-gate
3670Sstevel@tonic-gateLABEL(128try):
3680Sstevel@tonic-gate
3690Sstevel@tonic-gateLABEL(128):                              /* 128-byte */
3700Sstevel@tonic-gate        mov     %rdx, %rcx
3710Sstevel@tonic-gate        shr     $7, %rcx
3720Sstevel@tonic-gate        jz      LABEL(128skip)
3730Sstevel@tonic-gate
3740Sstevel@tonic-gate        .p2align 4
3750Sstevel@tonic-gate
3760Sstevel@tonic-gateLABEL(128loop):
3770Sstevel@tonic-gate        prefetchnta 512 (%rsi)	/* 3DNow: use prefetch */
3780Sstevel@tonic-gate        prefetchnta 512 (%rdi)	/* 3DNow: use prefetch */
3790Sstevel@tonic-gate
3800Sstevel@tonic-gate        mov        (%rsi), %rax
3810Sstevel@tonic-gate        mov      8 (%rsi), %r8
3820Sstevel@tonic-gate        sub        (%rdi), %rax
3830Sstevel@tonic-gate        sub      8 (%rdi), %r8
3840Sstevel@tonic-gate        mov     16 (%rsi), %r9
3850Sstevel@tonic-gate        mov     24 (%rsi), %r10
3860Sstevel@tonic-gate        sub     16 (%rdi), %r9
3870Sstevel@tonic-gate        sub     24 (%rdi), %r10
3880Sstevel@tonic-gate
3890Sstevel@tonic-gate        or       %r8, %rax
3900Sstevel@tonic-gate        or       %r9, %r10
3910Sstevel@tonic-gate        or      %r10, %rax
3920Sstevel@tonic-gate
3930Sstevel@tonic-gate        mov     32 (%rsi), %r8
3940Sstevel@tonic-gate        mov     40 (%rsi), %r9
3950Sstevel@tonic-gate        sub     32 (%rdi), %r8
3960Sstevel@tonic-gate        sub     40 (%rdi), %r9
3970Sstevel@tonic-gate        mov     48 (%rsi), %r10
3980Sstevel@tonic-gate        mov     56 (%rsi), %r11
3990Sstevel@tonic-gate        sub     48 (%rdi), %r10
4000Sstevel@tonic-gate        sub     56 (%rdi), %r11
4010Sstevel@tonic-gate
4020Sstevel@tonic-gate        or       %r9, %r8
4030Sstevel@tonic-gate        or      %r11, %r10
4040Sstevel@tonic-gate        or      %r10, %r8
4050Sstevel@tonic-gate
4060Sstevel@tonic-gate        or      %r8, %rax
4070Sstevel@tonic-gate        jnz     LABEL(32)
4080Sstevel@tonic-gate
4090Sstevel@tonic-gate        prefetchnta 576 (%rsi)	/* 3DNow: use prefetch */
4100Sstevel@tonic-gate        prefetchnta 576 (%rdi)	/* 3DNow: use prefetch */
4110Sstevel@tonic-gate
4120Sstevel@tonic-gate        mov      64 (%rsi), %rax
4130Sstevel@tonic-gate        mov      72 (%rsi), %r8
4140Sstevel@tonic-gate        sub      64 (%rdi), %rax
4150Sstevel@tonic-gate        sub      72 (%rdi), %r8
4160Sstevel@tonic-gate        mov      80 (%rsi), %r9
4170Sstevel@tonic-gate        mov      88 (%rsi), %r10
4180Sstevel@tonic-gate        sub      80 (%rdi), %r9
4190Sstevel@tonic-gate        sub      88 (%rdi), %r10
4200Sstevel@tonic-gate
4210Sstevel@tonic-gate        or       %r8, %rax
4220Sstevel@tonic-gate        or       %r9, %r10
4230Sstevel@tonic-gate        or      %r10, %rax
4240Sstevel@tonic-gate
4250Sstevel@tonic-gate        mov      96 (%rsi), %r8
4260Sstevel@tonic-gate        mov     104 (%rsi), %r9
4270Sstevel@tonic-gate        sub      96 (%rdi), %r8
4280Sstevel@tonic-gate        sub     104 (%rdi), %r9
4290Sstevel@tonic-gate        mov     112 (%rsi), %r10
4300Sstevel@tonic-gate        mov     120 (%rsi), %r11
4310Sstevel@tonic-gate        sub     112 (%rdi), %r10
4320Sstevel@tonic-gate        sub     120 (%rdi), %r11
4330Sstevel@tonic-gate
4340Sstevel@tonic-gate        or       %r9, %r8
4350Sstevel@tonic-gate        or      %r11, %r10
4360Sstevel@tonic-gate        or      %r10, %r8
4370Sstevel@tonic-gate
4380Sstevel@tonic-gate        or      %r8, %rax
4390Sstevel@tonic-gate        jnz     LABEL(32)
4400Sstevel@tonic-gate
4410Sstevel@tonic-gate        sub     $128, %rdx
4420Sstevel@tonic-gate        dec     %rcx
4430Sstevel@tonic-gate
4440Sstevel@tonic-gate        lea     128 (%rsi), %rsi
4450Sstevel@tonic-gate        lea     128 (%rdi), %rdi
4460Sstevel@tonic-gate
4470Sstevel@tonic-gate        jnz     LABEL(128loop)
4480Sstevel@tonic-gate
4490Sstevel@tonic-gateLABEL(128skip):
4500Sstevel@tonic-gate        and     $127, %edx
4510Sstevel@tonic-gate        jnz     LABEL(32)
4520Sstevel@tonic-gate
4530Sstevel@tonic-gate        xor     %eax, %eax
4540Sstevel@tonic-gate        ret
4550Sstevel@tonic-gate
4560Sstevel@tonic-gate	SET_SIZE(memcmp)
457