Lines Matching refs:s2

29 /* strcmp(s1, s2)
31 * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0
37 * strcmp(s1, s2)
39 * register const char *s2;
42 * if(s1 == s2)
44 * while(*s1 == *s2++)
47 * return(*s1 - s2[-1]);
56 ! align s2, this also happens and then the compare begins. Otherwise,
65 subcc %o0, %o1, %o2 ! s1 == s2 ?
76 ldub [%o1], %g1 ! s2[]
77 subcc %o0, %g1, %o0 ! s1[] != s2[] ?
83 inc %o1 ! s1++, s2++
86 andcc %o1, 3, %o3 ! s2 word aligned ?
88 cmp %o3, 2 ! s2 half-word aligned ?
90 cmp %o3, 3 ! s2 offset to dword == 3 ?
92 ldub [%o1], %o0 ! new lower word in s2
95 lduw [%o1 - 1], %o0 ! new lower word in s2
97 sll %o0, 8, %g1 ! partial unaligned word from s2
104 bz,a .doload1 ! no null byte in previous word from s2
105 lduw [%o1 + 3], %o0 ! load next aligned word from s2
107 srl %o0, 24, %o3 ! byte 1 of new aligned word from s2
108 or %g1, %o3, %g1 ! merge to get unaligned word from s2
110 cmp %o3, %g1 ! *s1 != *s2 ?
112 add %o1, 4, %o1 ! s1+=4, s2+=4
117 sll %o0, 8, %g1 ! partial unaligned word from s2
128 lduh [%o1], %o0 ! new lower word in s2
130 sll %o0, 16, %g1 ! partial unaligned word from s2
137 bz,a .doload2 ! no null byte in previous word from s2
138 lduw [%o1 + 2], %o0 ! load next aligned word from s2
140 srl %o0, 16, %o3 ! bytes 1,2 of new aligned word from s2
141 or %g1, %o3, %g1 ! merge to get unaligned word from s2
143 cmp %o3, %g1 ! *s1 != *s2 ?
145 add %o1, 4, %o1 ! s1+=4, s2+=4
150 sll %o0, 16, %g1 ! partial unaligned word from s2
159 sll %o0, 24, %g1 ! partial unaligned word from s2
163 bnz,a .doload3 ! nope, load next word from s2
164 lduw [%o1 + 1], %o0 ! load next aligned word from s2
166 srl %o0, 8, %o3 ! bytes 1,2,3 from new aligned s2 word
167 or %g1, %o3, %g1 ! merge to get unaligned word from s2
169 cmp %o3, %g1 ! *s1 != *s2 ?
171 add %o1, 4, %o1 ! s1+=4, s2+=4
176 sll %o0, 24, %g1 ! partial unaligned word from s2
191 lduw [%o1], %g1 ! load word from s2
208 srl %g1, 24, %o2 ! first byte of mismatching word in s2
210 subcc %o1, %o2, %o0 ! *s1-*s2
212 srl %g1, 16, %o2 ! second byte of mismatching word in s2
219 subcc %o1, %o2, %o0 ! *s1-*s2
221 srl %g1, 8, %o2 ! third byte of mismatching word in s2
228 subcc %o1, %o2, %o0 ! *s1-*s2
235 subcc %o3, %g1, %o0 ! *s1-*s2