80 __JUMP(,lr); |
80 __JUMP(,lr); |
81 } |
81 } |
82 |
82 |
83 EXPORT_C __NAKED__ TInt RPointerArrayBase::Find(const TAny* /*anEntry*/, TGeneralIdentityRelation /*anIdentity*/) const |
83 EXPORT_C __NAKED__ TInt RPointerArrayBase::Find(const TAny* /*anEntry*/, TGeneralIdentityRelation /*anIdentity*/) const |
84 { |
84 { |
|
85 __EH_FNSTART |
85 asm("stmfd sp!, {r4-r8,lr} "); |
86 asm("stmfd sp!, {r4-r8,lr} "); |
86 __EH_FRAME_PUSH2(r4-r8,lr) |
87 __EH_FRAME_PUSH2(r4-r8,lr) |
87 asm("ldmia r0, {r4,r5} "); // r4=iCount, r5=iEntries |
88 asm("ldmia r0, {r4,r5} "); // r4=iCount, r5=iEntries |
88 asm("mvn r6, #0 "); |
89 asm("mvn r6, #0 "); |
89 asm("mov r7, r1 "); |
90 asm("mov r7, r1 "); |
101 asm("blt ptr_find2_loop "); |
102 asm("blt ptr_find2_loop "); |
102 asm("mvn r6, #0 "); |
103 asm("mvn r6, #0 "); |
103 asm("ptr_find2_return: "); // return r6 |
104 asm("ptr_find2_return: "); // return r6 |
104 asm("mov r0, r6 "); |
105 asm("mov r0, r6 "); |
105 __POPRET("r4-r8,"); |
106 __POPRET("r4-r8,"); |
106 } |
107 __EH_FNEND |
107 |
108 } |
108 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchSigned(TInt /*anEntry*/, TInt& /*anIndex*/) const |
109 |
109 { |
110 EXPORT_C TInt RPointerArrayBase::BinarySearchSigned(TInt anEntry, TInt& anIndex) const |
110 asm("mov r3, #0 "); |
111 { |
111 // fall through |
112 return RPointerArrayBase::BinarySearchSigned(anEntry, anIndex, 0); |
112 } |
113 } |
113 |
114 |
114 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchSigned(TInt /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
115 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchSigned(TInt /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
115 { |
116 { |
|
117 __EH_FNSTART |
116 asm("stmfd sp!, {r4-r6,lr} "); |
118 asm("stmfd sp!, {r4-r6,lr} "); |
117 __EH_FRAME_PUSH2(r4-r6,lr) |
119 __EH_FRAME_PUSH2(r4-r6,lr) |
118 asm("mov r6, r2 "); // r6=&anIndex |
120 asm("mov r6, r2 "); // r6=&anIndex |
119 asm("ldmia r0, {r2,r4} "); // r2=count, r4=iEntries |
121 asm("ldmia r0, {r2,r4} "); // r2=count, r4=iEntries |
120 asm("bl BinarySearchSigned "); |
122 asm("bl BinarySearchSigned "); |
158 asm("2: "); |
160 asm("2: "); |
159 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
161 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
160 asm("bne 3b "); // if not, V=0 (left from subs), N=1 for last, 0 for first, Z=0 => LAST->LT FIRST->GT |
162 asm("bne 3b "); // if not, V=0 (left from subs), N=1 for last, 0 for first, Z=0 => LAST->LT FIRST->GT |
161 asm("mov r2, r12 "); // if so, r2 = mid |
163 asm("mov r2, r12 "); // if so, r2 = mid |
162 __JUMP(,lr); // and return with r0 = 0 |
164 __JUMP(,lr); // and return with r0 = 0 |
163 } |
165 __EH_FNEND |
164 |
166 } |
165 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchUnsigned(TUint /*anEntry*/, TInt& /*anIndex*/) const |
167 |
166 { |
168 EXPORT_C TInt RPointerArrayBase::BinarySearchUnsigned(TUint anEntry, TInt& anIndex) const |
167 asm("mov r3, #0 "); |
169 { |
168 // fall through |
170 return RPointerArrayBase::BinarySearchUnsigned(anEntry, anIndex, 0); |
169 } |
171 } |
170 |
172 |
171 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchUnsigned(TUint /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
173 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchUnsigned(TUint /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
172 { |
174 { |
|
175 __EH_FNSTART |
173 asm("stmfd sp!, {r4-r6,lr} "); |
176 asm("stmfd sp!, {r4-r6,lr} "); |
174 __EH_FRAME_PUSH2(r4-r6,lr) |
177 __EH_FRAME_PUSH2(r4-r6,lr) |
175 asm("mov r6, r2 "); // r6=&anIndex |
178 asm("mov r6, r2 "); // r6=&anIndex |
176 asm("ldmia r0, {r2,r4} "); // r2=count, r4=iEntries |
179 asm("ldmia r0, {r2,r4} "); // r2=count, r4=iEntries |
177 asm("bl BinarySearchUnsigned "); |
180 asm("bl BinarySearchUnsigned "); |
216 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
219 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
217 asm("cmpne r3, #0x60000000 "); // HI if LAST, LO if FIRST |
220 asm("cmpne r3, #0x60000000 "); // HI if LAST, LO if FIRST |
218 asm("bne 3b "); // if not ANY, branch back |
221 asm("bne 3b "); // if not ANY, branch back |
219 asm("mov r2, r12 "); // if ANY, r2 = mid |
222 asm("mov r2, r12 "); // if ANY, r2 = mid |
220 __JUMP(,lr); // and return with r0 = 0 |
223 __JUMP(,lr); // and return with r0 = 0 |
|
224 __EH_FNEND |
221 } |
225 } |
222 |
226 |
223 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearch(const TAny* /*anEntry*/, TInt& /*anIndex*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
227 EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearch(const TAny* /*anEntry*/, TInt& /*anIndex*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
224 { |
228 { |
|
229 __EH_FNSTART |
225 asm("stmfd sp!, {r2,r4-r11,lr} "); // store &anIndex, r4-r11, lr |
230 asm("stmfd sp!, {r2,r4-r11,lr} "); // store &anIndex, r4-r11, lr |
226 __EH_FRAME_ADDRESS(sp,4) |
231 __EH_FRAME_ADDRESS(sp,4) |
227 __EH_FRAME_PUSH2(r4-r11,lr) |
232 __EH_FRAME_PUSH2(r4-r11,lr) |
228 asm("ldmia r0, {r5,r6} "); // r5=count, r6=iEntries |
233 asm("ldmia r0, {r5,r6} "); // r5=count, r6=iEntries |
229 asm("ldr r11, [sp, #40] "); // r11 = aMode |
234 asm("ldr r11, [sp, #40] "); // r11 = aMode |
280 asm("mvnnes r0, #0 "); // if set r0=-1 = KErrNotFound |
285 asm("mvnnes r0, #0 "); // if set r0=-1 = KErrNotFound |
281 __JUMP(,r9); |
286 __JUMP(,r9); |
282 asm("2: "); |
287 asm("2: "); |
283 asm("mov r5, r8 "); // if ANY, r8 = mid |
288 asm("mov r5, r8 "); // if ANY, r8 = mid |
284 __JUMP(,r9); // and return with r0 = 0, Z=1 |
289 __JUMP(,r9); // and return with r0 = 0, Z=1 |
285 } |
290 __EH_FNEND |
286 |
291 } |
287 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqSigned(TInt /*anEntry*/) const |
292 |
288 { |
293 EXPORT_C TInt RPointerArrayBase::FindIsqSigned(TInt anEntry) const |
289 asm("mov r2, #0 "); |
294 { |
290 // fall through |
295 return RPointerArrayBase::FindIsqSigned(anEntry, 0); |
291 } |
296 } |
292 |
297 |
293 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqSigned(TInt /*anEntry*/, TInt /*aMode*/) const |
298 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqSigned(TInt /*anEntry*/, TInt /*aMode*/) const |
294 { |
299 { |
|
300 __EH_FNSTART |
295 #ifdef __EABI__ |
301 #ifdef __EABI__ |
296 // sp needs correct alignment |
302 // sp needs correct alignment |
297 asm("stmfd sp!, {r4-r6,lr} "); |
303 asm("stmfd sp!, {r4-r6,lr} "); |
298 __EH_FRAME_PUSH2(r4-r6,lr) |
304 __EH_FRAME_PUSH2(r4-r6,lr) |
299 #else |
305 #else |
306 #ifdef __EABI__ |
312 #ifdef __EABI__ |
307 __POPRET("r4-r6,"); |
313 __POPRET("r4-r6,"); |
308 #else |
314 #else |
309 __POPRET("r4,r5,"); |
315 __POPRET("r4,r5,"); |
310 #endif |
316 #endif |
311 } |
317 __EH_FNEND |
312 |
318 } |
313 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqUnsigned(TUint /*anEntry*/) const |
319 |
314 { |
320 EXPORT_C TInt RPointerArrayBase::FindIsqUnsigned(TUint anEntry) const |
315 asm("mov r2, #0 "); |
321 { |
316 // fall through |
322 return RPointerArrayBase::FindIsqUnsigned(anEntry, 0); |
317 } |
323 } |
318 |
324 |
319 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqUnsigned(TUint /*anEntry*/, TInt /*aMode*/) const |
325 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqUnsigned(TUint /*anEntry*/, TInt /*aMode*/) const |
320 { |
326 { |
|
327 __EH_FNSTART |
321 #ifdef __EABI__ |
328 #ifdef __EABI__ |
322 // sp needs correct alignment |
329 // sp needs correct alignment |
323 asm("stmfd sp!, {r4-r6,lr} "); |
330 asm("stmfd sp!, {r4-r6,lr} "); |
324 __EH_FRAME_PUSH2(r4-r6,lr) |
331 __EH_FRAME_PUSH2(r4-r6,lr) |
325 #else |
332 #else |
332 #ifdef __EABI__ |
339 #ifdef __EABI__ |
333 __POPRET("r4-r6,"); |
340 __POPRET("r4-r6,"); |
334 #else |
341 #else |
335 __POPRET("r4,r5,"); |
342 __POPRET("r4,r5,"); |
336 #endif |
343 #endif |
337 } |
344 __EH_FNEND |
338 |
345 } |
339 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/) const |
346 |
340 { |
347 EXPORT_C TInt RPointerArrayBase::FindIsq(const TAny* anEntry, TGeneralLinearOrder anOrder) const |
341 asm("mov r3, #0 "); |
348 { |
342 // fall through |
349 return RPointerArrayBase::FindIsq(anEntry, anOrder, 0); |
343 } |
350 } |
344 |
351 |
345 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
352 EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
346 { |
353 { |
347 |
354 __EH_FNSTART |
348 asm("stmfd sp!, {r3-r11,lr} "); |
355 asm("stmfd sp!, {r3-r11,lr} "); |
349 __EH_FRAME_PUSH2(r4-r6,lr) |
356 __EH_FRAME_PUSH2(r4-r6,lr) |
350 asm("ldmia r0, {r5,r6} "); // r5=count, r6=iEntries |
357 asm("ldmia r0, {r5,r6} "); // r5=count, r6=iEntries |
351 asm("mov r11, r3 "); // r11 = aMode |
358 asm("mov r11, r3 "); // r11 = aMode |
352 asm("mov r7, r2 "); // r7=anOrder |
359 asm("mov r7, r2 "); // r7=anOrder |
353 asm("mov r4, r1 "); // r1=anEntry |
360 asm("mov r4, r1 "); // r1=anEntry |
354 asm("bl BinarySearchPointers "); |
361 asm("bl BinarySearchPointers "); |
355 asm("moveq r0, r5 "); // if match, r0=match index |
362 asm("moveq r0, r5 "); // if match, r0=match index |
356 __POPRET("r3-r11,"); |
363 __POPRET("r3-r11,"); |
|
364 __EH_FNEND |
357 } |
365 } |
358 |
366 |
359 #ifndef __KERNEL_MODE__ |
367 #ifndef __KERNEL_MODE__ |
360 EXPORT_C __NAKED__ void RPointerArrayBase::HeapSortSigned() |
368 EXPORT_C __NAKED__ void RPointerArrayBase::HeapSortSigned() |
361 { |
369 { |
|
370 __EH_FNSTART |
362 #ifdef __EABI__ |
371 #ifdef __EABI__ |
363 asm("stmfd sp!, {r4-r10,lr} "); |
372 asm("stmfd sp!, {r4-r10,lr} "); |
364 __EH_FRAME_PUSH2(r4-r10,lr) |
373 __EH_FRAME_PUSH2(r4-r10,lr) |
365 #else |
374 #else |
366 asm("stmfd sp!, {r4-r9,lr} "); |
375 asm("stmfd sp!, {r4-r9,lr} "); |
418 asm("mov r8, r6 "); |
427 asm("mov r8, r6 "); |
419 asm("mov r9, r6 "); |
428 asm("mov r9, r6 "); |
420 asm("bgt hss_loop_start2 "); |
429 asm("bgt hss_loop_start2 "); |
421 asm("str r7, [r5, #0] "); |
430 asm("str r7, [r5, #0] "); |
422 __JUMP(,lr); |
431 __JUMP(,lr); |
|
432 __EH_FNEND |
423 } |
433 } |
424 |
434 |
425 EXPORT_C __NAKED__ void RPointerArrayBase::HeapSortUnsigned() |
435 EXPORT_C __NAKED__ void RPointerArrayBase::HeapSortUnsigned() |
426 { |
436 { |
427 asm("stmfd sp!, {r4-r9,lr} "); |
437 asm("stmfd sp!, {r4-r9,lr} "); |
490 } |
500 } |
491 |
501 |
492 #ifndef __KERNEL_MODE__ |
502 #ifndef __KERNEL_MODE__ |
493 EXPORT_C __NAKED__ void RPointerArrayBase::HeapSort(TGeneralLinearOrder /*anOrder*/) |
503 EXPORT_C __NAKED__ void RPointerArrayBase::HeapSort(TGeneralLinearOrder /*anOrder*/) |
494 { |
504 { |
|
505 __EH_FNSTART |
495 asm("stmfd sp!, {r3-r11,lr} "); |
506 asm("stmfd sp!, {r3-r11,lr} "); |
496 // r3 is caller save |
507 // r3 is caller save |
497 __EH_FRAME_ADDRESS(sp,4) |
508 __EH_FRAME_ADDRESS(sp,4) |
498 // we can push the callee save regs |
509 // we can push the callee save regs |
499 __EH_FRAME_PUSH2(r4-r11,lr) |
510 __EH_FRAME_PUSH2(r4-r11,lr) |
621 __POPRET("r4,"); |
633 __POPRET("r4,"); |
622 } |
634 } |
623 |
635 |
624 EXPORT_C __NAKED__ TInt RArrayBase::Find(const TAny* /*anEntry*/, TGeneralIdentityRelation /*anIdentity*/) const |
636 EXPORT_C __NAKED__ TInt RArrayBase::Find(const TAny* /*anEntry*/, TGeneralIdentityRelation /*anIdentity*/) const |
625 { |
637 { |
|
638 __EH_FNSTART |
626 asm("stmfd sp!, {r4-r10,lr} "); // save r4-r10,lr |
639 asm("stmfd sp!, {r4-r10,lr} "); // save r4-r10,lr |
627 __EH_FRAME_PUSH2(r4-r10,lr) |
640 __EH_FRAME_PUSH2(r4-r10,lr) |
628 asm("ldmia r0, {r4,r5,r6} "); // r4=count, r5=iEntries, r6=iEntrySize |
641 asm("ldmia r0, {r4,r5,r6} "); // r4=count, r5=iEntries, r6=iEntrySize |
629 asm("mov r8, r1 "); // r8=anEntry |
642 asm("mov r8, r1 "); // r8=anEntry |
630 asm("mov r9, r2 "); // r9=anIdentity |
643 asm("mov r9, r2 "); // r9=anIdentity |
642 asm("bpl simple_find2_loop "); |
655 asm("bpl simple_find2_loop "); |
643 asm("add r4, r7, #1 "); // no match, arrange to return -1 |
656 asm("add r4, r7, #1 "); // no match, arrange to return -1 |
644 asm("simple_find2_return: "); |
657 asm("simple_find2_return: "); |
645 asm("sub r0, r7, r4 "); // index=count-r4 |
658 asm("sub r0, r7, r4 "); // index=count-r4 |
646 __POPRET("r4-r10,"); |
659 __POPRET("r4-r10,"); |
647 } |
660 __EH_FNEND |
648 |
661 } |
649 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchSigned(const TAny* /*anEntry*/, TInt& /*anIndex*/) const |
662 |
650 { |
663 EXPORT_C TInt RArrayBase::BinarySearchSigned(const TAny* anEntry, TInt& anIndex) const |
651 asm("mov r3, #0 "); |
664 { |
652 // fall through |
665 return RArrayBase::BinarySearchSigned(anEntry, anIndex, 0); |
653 } |
666 } |
654 |
667 |
655 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchSigned(const TAny* /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
668 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchSigned(const TAny* /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
656 { |
669 { |
|
670 __EH_FNSTART |
657 asm("stmfd sp!, {r4-r8,lr} "); |
671 asm("stmfd sp!, {r4-r8,lr} "); |
658 __EH_FRAME_PUSH2(r4-r8,lr) |
672 __EH_FRAME_PUSH2(r4-r8,lr) |
659 asm("mov r8, r2 "); // r8=&anIndex |
673 asm("mov r8, r2 "); // r8=&anIndex |
660 asm("ldmia r0, {r2,r4,r5,r6} "); // r2=count, r3=iEntries, r5=entry size, r6=key offset |
674 asm("ldmia r0, {r2,r4,r5,r6} "); // r2=count, r3=iEntries, r5=entry size, r6=key offset |
661 asm("cmp r5, #4 "); // check for 4 byte entries |
675 asm("cmp r5, #4 "); // check for 4 byte entries |
707 asm("2: "); |
721 asm("2: "); |
708 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
722 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
709 asm("bne 3b "); // if not, V=0 (left from subs), N=1 for last, 0 for first, Z=0 => LAST->LT FIRST->GT |
723 asm("bne 3b "); // if not, V=0 (left from subs), N=1 for last, 0 for first, Z=0 => LAST->LT FIRST->GT |
710 asm("mov r2, r12 "); // if so, r2 = mid |
724 asm("mov r2, r12 "); // if so, r2 = mid |
711 __JUMP(,lr); // and return with r0 = 0 |
725 __JUMP(,lr); // and return with r0 = 0 |
712 } |
726 __EH_FNEND |
713 |
727 } |
714 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchUnsigned(const TAny* /*anEntry*/, TInt& /*anIndex*/) const |
728 |
715 { |
729 EXPORT_C TInt RArrayBase::BinarySearchUnsigned(const TAny* anEntry, TInt& anIndex) const |
716 asm("mov r3, #0 "); |
730 { |
717 // fall through |
731 return RArrayBase::BinarySearchUnsigned(anEntry, anIndex, 0); |
718 } |
732 } |
719 |
733 |
720 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchUnsigned(const TAny* /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
734 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchUnsigned(const TAny* /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const |
721 { |
735 { |
|
736 __EH_FNSTART |
722 asm("stmfd sp!, {r4-r8,lr} "); |
737 asm("stmfd sp!, {r4-r8,lr} "); |
723 __EH_FRAME_PUSH2(r4-r8,lr) |
738 __EH_FRAME_PUSH2(r4-r8,lr) |
724 asm("mov r8, r2 "); // r8=&anIndex |
739 asm("mov r8, r2 "); // r8=&anIndex |
725 asm("ldmia r0, {r2,r4,r5,r6} "); // r2=count, r4=iEntries, r5=entry size, r6=key offset |
740 asm("ldmia r0, {r2,r4,r5,r6} "); // r2=count, r4=iEntries, r5=entry size, r6=key offset |
726 asm("cmp r5, #4 "); // check for 4 byte entries |
741 asm("cmp r5, #4 "); // check for 4 byte entries |
773 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
788 asm("bics r3, r3, #1 "); // clear NOT FOUND flag, test for find mode ANY (Z set if so) |
774 asm("cmpne r3, #0x60000000 "); // HI if LAST, LO if FIRST |
789 asm("cmpne r3, #0x60000000 "); // HI if LAST, LO if FIRST |
775 asm("bne 3b "); // if not ANY, branch back |
790 asm("bne 3b "); // if not ANY, branch back |
776 asm("mov r2, r12 "); // if ANY, r2 = mid |
791 asm("mov r2, r12 "); // if ANY, r2 = mid |
777 __JUMP(,lr); // and return with r0 = 0 |
792 __JUMP(,lr); // and return with r0 = 0 |
|
793 __EH_FNEND |
778 } |
794 } |
779 |
795 |
780 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearch(const TAny* /*anEntry*/, TInt& /*anIndex*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
796 EXPORT_C __NAKED__ TInt RArrayBase::BinarySearch(const TAny* /*anEntry*/, TInt& /*anIndex*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
781 { |
797 { |
|
798 __EH_FNSTART |
782 asm("stmfd sp!, {r3-r11,lr} "); |
799 asm("stmfd sp!, {r3-r11,lr} "); |
783 // r3 is caller save |
800 // r3 is caller save |
784 __EH_FRAME_ADDRESS(sp,4) |
801 __EH_FRAME_ADDRESS(sp,4) |
785 // we can push the callee save regs |
802 // we can push the callee save regs |
786 __EH_FRAME_PUSH2(r4-r11,lr) |
803 __EH_FRAME_PUSH2(r4-r11,lr) |
834 asm("mvnnes r0, #0 "); // if set r0=-1 = KErrNotFound |
851 asm("mvnnes r0, #0 "); // if set r0=-1 = KErrNotFound |
835 __POPRET("r2,"); |
852 __POPRET("r2,"); |
836 asm("2: "); |
853 asm("2: "); |
837 asm("mov r5, r8 "); // if ANY, r8 = mid |
854 asm("mov r5, r8 "); // if ANY, r8 = mid |
838 __POPRET("r2,"); // and return with r0 = 0, Z=1 |
855 __POPRET("r2,"); // and return with r0 = 0, Z=1 |
839 } |
856 __EH_FNEND |
840 |
857 } |
841 EXPORT_C __NAKED__ TInt RArrayBase::FindIsqSigned(const TAny* /*anEntry*/) const |
858 |
842 { |
859 EXPORT_C TInt RArrayBase::FindIsqSigned(const TAny* anEntry) const |
843 asm("mov r2, #0 "); |
860 { |
844 // fall through |
861 return RArrayBase::FindIsqSigned(anEntry, 0); |
845 } |
862 } |
846 |
863 |
847 EXPORT_C __NAKED__ TInt RArrayBase::FindIsqSigned(const TAny* /*anEntry*/, TInt /*aMode*/) const |
864 EXPORT_C __NAKED__ TInt RArrayBase::FindIsqSigned(const TAny* /*anEntry*/, TInt /*aMode*/) const |
848 { |
865 { |
|
866 __EH_FNSTART |
849 #ifdef __EABI__ |
867 #ifdef __EABI__ |
850 // sp needs to be aligned correctly |
868 // sp needs to be aligned correctly |
851 asm("stmfd sp!, {r4-r8,lr} "); |
869 asm("stmfd sp!, {r4-r8,lr} "); |
852 __EH_FRAME_PUSH2(r4-r8,lr) |
870 __EH_FRAME_PUSH2(r4-r8,lr) |
853 #else |
871 #else |
867 #ifdef __EABI__ |
885 #ifdef __EABI__ |
868 __POPRET("r4-r8,"); |
886 __POPRET("r4-r8,"); |
869 #else |
887 #else |
870 __POPRET("r4-r7,"); |
888 __POPRET("r4-r7,"); |
871 #endif |
889 #endif |
872 } |
890 __EH_FNEND |
873 |
891 } |
874 EXPORT_C __NAKED__ TInt RArrayBase::FindIsqUnsigned(const TAny* /*anEntry*/) const |
892 |
875 { |
893 EXPORT_C TInt RArrayBase::FindIsqUnsigned(const TAny* anEntry) const |
876 asm("mov r2, #0 "); |
894 { |
877 // fall through |
895 return RArrayBase::FindIsqUnsigned(anEntry, 0); |
878 } |
896 } |
879 |
897 |
880 EXPORT_C __NAKED__ TInt RArrayBase::FindIsqUnsigned(const TAny* /*anEntry*/, TInt /*aMode*/) const |
898 EXPORT_C __NAKED__ TInt RArrayBase::FindIsqUnsigned(const TAny* /*anEntry*/, TInt /*aMode*/) const |
881 { |
899 { |
|
900 __EH_FNSTART |
882 #ifdef __EABI__ |
901 #ifdef __EABI__ |
883 // sp needs to be aligned correctly |
902 // sp needs to be aligned correctly |
884 asm("stmfd sp!, {r4-r8,lr} "); |
903 asm("stmfd sp!, {r4-r8,lr} "); |
885 __EH_FRAME_PUSH2(r4-r8,lr) |
904 __EH_FRAME_PUSH2(r4-r8,lr) |
886 #else |
905 #else |
900 #ifdef __EABI__ |
919 #ifdef __EABI__ |
901 __POPRET("r4-r8,"); |
920 __POPRET("r4-r8,"); |
902 #else |
921 #else |
903 __POPRET("r4-r7,"); |
922 __POPRET("r4-r7,"); |
904 #endif |
923 #endif |
905 } |
924 __EH_FNEND |
906 |
925 } |
907 EXPORT_C __NAKED__ TInt RArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/) const |
926 |
908 { |
927 EXPORT_C TInt RArrayBase::FindIsq(const TAny* anEntry, TGeneralLinearOrder anOrder) const |
909 asm("mov r3, #0 "); |
928 { |
910 // fall through |
929 return RArrayBase::FindIsq(anEntry, anOrder, 0); |
911 } |
930 } |
912 |
931 |
913 EXPORT_C __NAKED__ TInt RArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
932 EXPORT_C __NAKED__ TInt RArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const |
914 { |
933 { |
|
934 __EH_FNSTART |
915 asm("stmfd sp!, {r3-r11,lr} "); |
935 asm("stmfd sp!, {r3-r11,lr} "); |
916 // r3 is caller save |
936 // r3 is caller save |
917 __EH_FRAME_ADDRESS(sp,4) |
937 __EH_FRAME_ADDRESS(sp,4) |
918 // we can push the callee save regs |
938 // we can push the callee save regs |
919 __EH_FRAME_PUSH2(r4-r11,lr) |
939 __EH_FRAME_PUSH2(r4-r11,lr) |
922 asm("mov r7, r2 "); // r7=anOrder |
942 asm("mov r7, r2 "); // r7=anOrder |
923 asm("mov r9, r3 "); // r9 = aMode |
943 asm("mov r9, r3 "); // r9 = aMode |
924 asm("bl BinarySearchEntries "); |
944 asm("bl BinarySearchEntries "); |
925 asm("moveq r0, r5 "); // if match r0=index |
945 asm("moveq r0, r5 "); // if match r0=index |
926 __POPRET("r3-r11,"); |
946 __POPRET("r3-r11,"); |
|
947 __EH_FNEND |
927 } |
948 } |
928 |
949 |
929 #ifndef __KERNEL_MODE__ |
950 #ifndef __KERNEL_MODE__ |
930 EXPORT_C __NAKED__ void RArrayBase::HeapSortSigned() |
951 EXPORT_C __NAKED__ void RArrayBase::HeapSortSigned() |
931 { |
952 { |
|
953 __EH_FNSTART |
932 #ifdef __EABI__ |
954 #ifdef __EABI__ |
933 // need sp aligned correctly |
955 // need sp aligned correctly |
934 asm("stmfd sp!, {r3-r11,lr} "); |
956 asm("stmfd sp!, {r3-r11,lr} "); |
935 __EH_FRAME_ADDRESS(sp,4) |
957 __EH_FRAME_ADDRESS(sp,4) |
936 __EH_FRAME_PUSH2(r4-r11,lr) |
958 __EH_FRAME_PUSH2(r4-r11,lr) |
1015 asm("mov r1, sp "); |
1037 asm("mov r1, sp "); |
1016 asm("mov r2, r10 "); |
1038 asm("mov r2, r10 "); |
1017 asm("bl wordmove "); // entry[0]=[sp] |
1039 asm("bl wordmove "); // entry[0]=[sp] |
1018 asm("add sp, sp, r10 "); // free temporary stack space |
1040 asm("add sp, sp, r10 "); // free temporary stack space |
1019 __JUMP(,r7); |
1041 __JUMP(,r7); |
|
1042 __EH_FNEND |
1020 } |
1043 } |
1021 |
1044 |
1022 EXPORT_C __NAKED__ void RArrayBase::HeapSortUnsigned() |
1045 EXPORT_C __NAKED__ void RArrayBase::HeapSortUnsigned() |
1023 { |
1046 { |
|
1047 __EH_FNSTART |
1024 #ifdef __EABI__ |
1048 #ifdef __EABI__ |
1025 // need sp aligned correctly |
1049 // need sp aligned correctly |
1026 asm("stmfd sp!, {r3-r11,lr} "); |
1050 asm("stmfd sp!, {r3-r11,lr} "); |
1027 __EH_FRAME_ADDRESS(sp,4) |
1051 __EH_FRAME_ADDRESS(sp,4) |
1028 __EH_FRAME_PUSH2(r4-r11,lr) |
1052 __EH_FRAME_PUSH2(r4-r11,lr) |
1107 asm("mov r1, sp "); |
1131 asm("mov r1, sp "); |
1108 asm("mov r2, r10 "); |
1132 asm("mov r2, r10 "); |
1109 asm("bl wordmove "); // entry[0]=[sp] |
1133 asm("bl wordmove "); // entry[0]=[sp] |
1110 asm("add sp, sp, r10 "); // free temporary stack space |
1134 asm("add sp, sp, r10 "); // free temporary stack space |
1111 __JUMP(,r7); |
1135 __JUMP(,r7); |
|
1136 __EH_FNEND |
1112 } |
1137 } |
1113 |
1138 |
1114 EXPORT_C __NAKED__ void RArrayBase::HeapSort(TGeneralLinearOrder anOrder) |
1139 EXPORT_C __NAKED__ void RArrayBase::HeapSort(TGeneralLinearOrder anOrder) |
1115 { |
1140 { |
|
1141 __EH_FNSTART |
1116 #ifdef __EABI__ |
1142 #ifdef __EABI__ |
1117 // need sp aligned correctly |
1143 // need sp aligned correctly |
1118 asm("stmfd sp!, {r3-r11,lr} "); |
1144 asm("stmfd sp!, {r3-r11,lr} "); |
1119 __EH_FRAME_ADDRESS(sp,4) |
1145 __EH_FRAME_ADDRESS(sp,4) |
1120 __EH_FRAME_PUSH2(r4-r11,lr) |
1146 __EH_FRAME_PUSH2(r4-r11,lr) |
1202 asm("mov r1, sp "); |
1228 asm("mov r1, sp "); |
1203 asm("mov r2, r10 "); |
1229 asm("mov r2, r10 "); |
1204 asm("bl wordmove "); // entry[0]=[sp] |
1230 asm("bl wordmove "); // entry[0]=[sp] |
1205 asm("ldr sp, [sp, r10] "); // restore stack pointer, freeing temporary stack space |
1231 asm("ldr sp, [sp, r10] "); // restore stack pointer, freeing temporary stack space |
1206 __POPRET(""); |
1232 __POPRET(""); |
|
1233 __EH_FNEND |
1207 } |
1234 } |
1208 #endif // __KERNEL_MODE__ |
1235 #endif // __KERNEL_MODE__ |
1209 #endif // __ARRAY_MACHINE_CODED__ |
1236 #endif // __ARRAY_MACHINE_CODED__ |