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 .file "memchr.S" 18 19 .section .text 20 .global _memchr 21 .type _memchr,@function 22_memchr: 23 movm [d2,d3,a2,a3],(sp) 24.Lend_of_prologue: 25 mov d0,a0 26 mov d1,d2 27 mov (28,sp),a1 28#ifndef __OPTIMIZE_SIZE__ 29 cmp 3,a1 30 bls .L44 31 mov a0,d3 32 btst 3,d3 33 bne .L44 34 mov a0,a2 35 mov 0,a3 36 clr d1 37 setlb 38 mov a3,d0 39 asl 8,d0 40 mov d2,a3 41 add d0,a3 42 inc d1 43 cmp 3,d1 44 lls 45 cmp 3,a1 46 bls .L48 47.L33: 48 mov (a2),d0 49 mov a3,d3 50 xor d3,d0 51 mov d0,d1 52 not d1 53 add -16843009,d0 54 and d1,d0 55 btst -2139062144,d0 56 beq .L34 57 mov a2,a0 58 clr d1 59 setlb 60 movbu (a0),d0 61 cmp d2,d0 62 beq .Lepilogue 63 inc a0 64 inc d1 65 cmp 3,d1 66 lls 67.L34: 68 add -4,a1 69 inc4 a2 70 cmp 3,a1 71 bhi .L33 72.L48: 73 mov a2,a0 74.L44: 75#endif 76 cmp 0,a1 77 beq .L50 78 setlb 79 movbu (a0),d0 80 cmp d2,d0 81 beq .Lepilogue 82 inc a0 83 sub 1,a1 84 lne 85.L50: 86 mov 0,a0 87.Lepilogue: 88 ret [d2,d3,a2,a3],16 89.Lend_of_memchr: 90 .size _memchr, .Lend_of_memchr - _memchr 91 92 .section .debug_frame,"",@progbits 93.Lstart_of_debug_frame: 94 # Common Information Entry (CIE) 95 .4byte .Lend_of_CIE - .Lstart_of_CIE # CIE Length 96.Lstart_of_CIE: 97 .4byte 0xffffffff # CIE Identifier Tag 98 .byte 0x1 # CIE Version 99 .ascii "\0" # CIE Augmentation 100 .uleb128 0x1 # CIE Code Alignment Factor 101 .sleb128 -4 # CIE Data Alignment Factor 102 .byte 0x32 # CIE RA Column 103 .byte 0xc # DW_CFA_def_cfa 104 .uleb128 0x9 105 .uleb128 0x0 106 .byte 0xb2 # DW_CFA_offset, column 0x32 107 .uleb128 0x0 108 .align 2 109.Lend_of_CIE: 110 111 # Frame Description Entry (FDE) 112 .4byte .Lend_of_FDE - .Lstart_of_FDE # FDE Length 113.Lstart_of_FDE: 114 .4byte .Lstart_of_debug_frame # FDE CIE offset 115 .4byte _memchr # FDE initial location 116 .4byte .Lend_of_memchr - _memchr # FDE address range 117 .byte 0x4 # DW_CFA_advance_loc4 118 .4byte .Lend_of_prologue - _memchr 119 .byte 0xe # DW_CFA_def_cfa_offset 120 .uleb128 0x4 121 .byte 0x87 # DW_CFA_offset, column 0x7 122 .uleb128 0x1 123 .align 2 124.Lend_of_FDE: 125