1/* 2Copyright (c) 1990 The Regents of the University of California. 3All rights reserved. 4 5Redistribution and use in source and binary forms are permitted 6provided that the above copyright notice and this paragraph are 7duplicated in all such forms and that any documentation, 8and/or other materials related to such 9distribution and use acknowledge that the software was developed 10by the University of California, Berkeley. The name of the 11University may not be used to endorse or promote products derived 12from this software without specific prior written permission. 13THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 */ 17#include <picolibc.h> 18 19 .file "memcmp.S" 20 21 .section .text 22 .global _memcmp 23 .type _memcmp,@function 24_memcmp: 25 movm [d2,d3,a2,a3],(sp) 26.Lend_of_prologue: 27 mov d0,a0 28 mov d1,a1 29 mov (28,sp),a2 30#ifndef __OPTIMIZE_SIZE__ 31 cmp 3,a2 32 bls .L22 33 mov a1,d2 34 or d2,d0 35 btst 3,d0 36 bne .L22 37 setlb 38 mov (a0),d1 39 mov (a1),d0 40 cmp d0,d1 41 bne .L22 42 inc4 a0 43 inc4 a1 44 add -4,a2 45 cmp 3,a2 46 lhi 47.L22: 48#endif 49 cmp 0,a2 50 beq .L24 51 setlb 52 movbu (a0),d3 53 movbu (a1),d2 54 cmp d2,d3 55 beq .L23 56 mov d3,d0 57 sub d2,d0 58 jmp .Lepilogue 59.L23: 60 inc a0 61 inc a1 62 sub 1,a2 63 lne 64.L24: 65 clr d0 66.Lepilogue: 67 ret [d2,d3,a2,a3],16 68.Lend_of_func: 69 .size _memcmp, .Lend_of_func - _memcmp 70 71 .section .debug_frame,"",@progbits 72.Lstart_of_debug_frame: 73 # Common Information Entry (CIE) 74 .4byte .Lend_of_CIE - .Lstart_of_CIE # CIE Length 75.Lstart_of_CIE: 76 .4byte 0xffffffff # CIE Identifier Tag 77 .byte 0x1 # CIE Version 78 .ascii "\0" # CIE Augmentation 79 .uleb128 0x1 # CIE Code Alignment Factor 80 .sleb128 -4 # CIE Data Alignment Factor 81 .byte 0x32 # CIE RA Column 82 .byte 0xc # DW_CFA_def_cfa 83 .uleb128 0x9 84 .uleb128 0x0 85 .byte 0xb2 # DW_CFA_offset, column 0x32 86 .uleb128 0x0 87 .align 2 88.Lend_of_CIE: 89 90 # Frame Description Entry (FDE) 91 .4byte .Lend_of_FDE - .Lstart_of_FDE # FDE Length 92.Lstart_of_FDE: 93 .4byte .Lstart_of_debug_frame # FDE CIE offset 94 .4byte _memcmp # FDE initial location 95 .4byte .Lend_of_func - _memcmp # FDE address range 96 .byte 0x4 # DW_CFA_advance_loc4 97 .4byte .Lend_of_prologue - _memcmp 98 .byte 0xe # DW_CFA_def_cfa_offset 99 .uleb128 0x4 100 .byte 0x87 # DW_CFA_offset, column 0x7 101 .uleb128 0x1 102 .align 2 103.Lend_of_FDE: 104