Annotation of gcc/config/sh/lib1funcs.asm, revision 1.1.1.2

1.1.1.2 ! root        1: /* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
1.1       root        2: 
                      3: This file is free software; you can redistribute it and/or modify it
                      4: under the terms of the GNU General Public License as published by the
                      5: Free Software Foundation; either version 2, or (at your option) any
                      6: later version.
                      7: 
                      8: In addition to the permissions in the GNU General Public License, the
                      9: Free Software Foundation gives you unlimited permission to link the
                     10: compiled version of this file with other programs, and to distribute
                     11: those programs without any restriction coming from the use of this
                     12: file.  (The General Public License restrictions do apply in other
                     13: respects; for example, they cover modification of the file, and
                     14: distribution when not linked into another program.)
                     15: 
                     16: This file is distributed in the hope that it will be useful, but
                     17: WITHOUT ANY WARRANTY; without even the implied warranty of
                     18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                     19: General Public License for more details.
                     20: 
                     21: You should have received a copy of the GNU General Public License
                     22: along with this program; see the file COPYING.  If not, write to
1.1.1.2 ! root       23: the Free Software Foundation, 59 Temple Place - Suite 330,
        !            24: Boston, MA 02111-1307, USA.  */
1.1       root       25: 
                     26: /* As a special exception, if you link this library with other files,
                     27:    some of which are compiled with GCC, to produce an executable,
                     28:    this library does not by itself cause the resulting executable
                     29:    to be covered by the GNU General Public License.
                     30:    This exception does not however invalidate any other reasons why
                     31:    the executable file might be covered by the GNU General Public License.  */
                     32: 
                     33: 
                     34: !! libgcc1 routines for the Hitachi SH cpu.
                     35: !! Contributed by Steve Chamberlain.
                     36: !! [email protected]
                     37: 
1.1.1.2 ! root       38: !! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
        !            39: !! recoded in assembly by Toshiyasu Morita
        !            40: !! [email protected]
1.1       root       41: 
                     42: #ifdef L_ashiftrt
                     43:        .global ___ashiftrt_r4_0
                     44:        .global ___ashiftrt_r4_1
                     45:        .global ___ashiftrt_r4_2
                     46:        .global ___ashiftrt_r4_3
                     47:        .global ___ashiftrt_r4_4
                     48:        .global ___ashiftrt_r4_5
                     49:        .global ___ashiftrt_r4_6
                     50:        .global ___ashiftrt_r4_7
                     51:        .global ___ashiftrt_r4_8
                     52:        .global ___ashiftrt_r4_9
                     53:        .global ___ashiftrt_r4_10
                     54:        .global ___ashiftrt_r4_11
                     55:        .global ___ashiftrt_r4_12
                     56:        .global ___ashiftrt_r4_13
                     57:        .global ___ashiftrt_r4_14
                     58:        .global ___ashiftrt_r4_15
                     59:        .global ___ashiftrt_r4_16
                     60:        .global ___ashiftrt_r4_17
                     61:        .global ___ashiftrt_r4_18
                     62:        .global ___ashiftrt_r4_19
                     63:        .global ___ashiftrt_r4_20
                     64:        .global ___ashiftrt_r4_21
                     65:        .global ___ashiftrt_r4_22
                     66:        .global ___ashiftrt_r4_23
                     67:        .global ___ashiftrt_r4_24
                     68:        .global ___ashiftrt_r4_25
                     69:        .global ___ashiftrt_r4_26
                     70:        .global ___ashiftrt_r4_27
                     71:        .global ___ashiftrt_r4_28
                     72:        .global ___ashiftrt_r4_29
                     73:        .global ___ashiftrt_r4_30
                     74:        .global ___ashiftrt_r4_31
                     75:        .global ___ashiftrt_r4_32
                     76: 
1.1.1.2 ! root       77:        .align  1
1.1       root       78: ___ashiftrt_r4_32:
                     79: ___ashiftrt_r4_31:
1.1.1.2 ! root       80:        rotcl   r4
        !            81:        rts
        !            82:        subc    r4,r4
        !            83: 
1.1       root       84: ___ashiftrt_r4_30:
                     85:        shar    r4
                     86: ___ashiftrt_r4_29:
                     87:        shar    r4
                     88: ___ashiftrt_r4_28:
                     89:        shar    r4
                     90: ___ashiftrt_r4_27:
                     91:        shar    r4
                     92: ___ashiftrt_r4_26:
                     93:        shar    r4
                     94: ___ashiftrt_r4_25:
                     95:        shar    r4
                     96: ___ashiftrt_r4_24:
1.1.1.2 ! root       97:        shlr16  r4
        !            98:        shlr8   r4
        !            99:        rts
        !           100:        exts.b  r4,r4
        !           101: 
1.1       root      102: ___ashiftrt_r4_23:
                    103:        shar    r4
                    104: ___ashiftrt_r4_22:
                    105:        shar    r4
                    106: ___ashiftrt_r4_21:
                    107:        shar    r4
                    108: ___ashiftrt_r4_20:
                    109:        shar    r4
                    110: ___ashiftrt_r4_19:
                    111:        shar    r4
                    112: ___ashiftrt_r4_18:
                    113:        shar    r4
                    114: ___ashiftrt_r4_17:
                    115:        shar    r4
                    116: ___ashiftrt_r4_16:
1.1.1.2 ! root      117:        shlr16  r4
        !           118:        rts
        !           119:        exts.w  r4,r4
        !           120: 
1.1       root      121: ___ashiftrt_r4_15:
                    122:        shar    r4
                    123: ___ashiftrt_r4_14:
                    124:        shar    r4
                    125: ___ashiftrt_r4_13:
                    126:        shar    r4
                    127: ___ashiftrt_r4_12:
                    128:        shar    r4
                    129: ___ashiftrt_r4_11:
                    130:        shar    r4
                    131: ___ashiftrt_r4_10:
                    132:        shar    r4
                    133: ___ashiftrt_r4_9:
                    134:        shar    r4
                    135: ___ashiftrt_r4_8:
                    136:        shar    r4
                    137: ___ashiftrt_r4_7:
                    138:        shar    r4
                    139: ___ashiftrt_r4_6:
                    140:        shar    r4
                    141: ___ashiftrt_r4_5:
                    142:        shar    r4
                    143: ___ashiftrt_r4_4:
                    144:        shar    r4
                    145: ___ashiftrt_r4_3:
                    146:        shar    r4
                    147: ___ashiftrt_r4_2:
                    148:        shar    r4
                    149: ___ashiftrt_r4_1:
                    150:        rts
                    151:        shar    r4
                    152: 
                    153: ___ashiftrt_r4_0:
                    154:        rts
1.1.1.2 ! root      155:        nop
        !           156: #endif
        !           157: 
        !           158: #ifdef L_ashiftrt_n
        !           159: 
        !           160: !
        !           161: ! ___ashrsi3
        !           162: !
        !           163: ! Entry:
        !           164: !
        !           165: ! r4: Value to shift
        !           166: ! r5: Shifts
        !           167: !
        !           168: ! Exit:
        !           169: !
        !           170: ! r0: Result
        !           171: !
        !           172: ! Destroys:
        !           173: !
        !           174: ! (none)
        !           175: !
        !           176: 
        !           177:        .global ___ashrsi3
        !           178:        .align  2
        !           179: ___ashrsi3:
        !           180:        mov     #31,r0
        !           181:        cmp/hi  r0,r5
        !           182:        bt      L_ashrsi3_31
        !           183:        mova    L_ashrsi3_table,r0
        !           184:        mov.b   @(r0,r5),r5
        !           185:        add     r5,r0           ! Change to braf when gas is fixed
        !           186:        jmp     @r0
        !           187:        mov     r4,r0
        !           188: 
        !           189: L_ashrsi3_table:
        !           190:        .byte           L_ashrsi3_0-L_ashrsi3_table
        !           191:        .byte           L_ashrsi3_1-L_ashrsi3_table
        !           192:        .byte           L_ashrsi3_2-L_ashrsi3_table
        !           193:        .byte           L_ashrsi3_3-L_ashrsi3_table
        !           194:        .byte           L_ashrsi3_4-L_ashrsi3_table
        !           195:        .byte           L_ashrsi3_5-L_ashrsi3_table
        !           196:        .byte           L_ashrsi3_6-L_ashrsi3_table
        !           197:        .byte           L_ashrsi3_7-L_ashrsi3_table
        !           198:        .byte           L_ashrsi3_8-L_ashrsi3_table
        !           199:        .byte           L_ashrsi3_9-L_ashrsi3_table
        !           200:        .byte           L_ashrsi3_10-L_ashrsi3_table
        !           201:        .byte           L_ashrsi3_11-L_ashrsi3_table
        !           202:        .byte           L_ashrsi3_12-L_ashrsi3_table
        !           203:        .byte           L_ashrsi3_13-L_ashrsi3_table
        !           204:        .byte           L_ashrsi3_14-L_ashrsi3_table
        !           205:        .byte           L_ashrsi3_15-L_ashrsi3_table
        !           206:        .byte           L_ashrsi3_16-L_ashrsi3_table
        !           207:        .byte           L_ashrsi3_17-L_ashrsi3_table
        !           208:        .byte           L_ashrsi3_18-L_ashrsi3_table
        !           209:        .byte           L_ashrsi3_19-L_ashrsi3_table
        !           210:        .byte           L_ashrsi3_20-L_ashrsi3_table
        !           211:        .byte           L_ashrsi3_21-L_ashrsi3_table
        !           212:        .byte           L_ashrsi3_22-L_ashrsi3_table
        !           213:        .byte           L_ashrsi3_23-L_ashrsi3_table
        !           214:        .byte           L_ashrsi3_24-L_ashrsi3_table
        !           215:        .byte           L_ashrsi3_25-L_ashrsi3_table
        !           216:        .byte           L_ashrsi3_26-L_ashrsi3_table
        !           217:        .byte           L_ashrsi3_27-L_ashrsi3_table
        !           218:        .byte           L_ashrsi3_28-L_ashrsi3_table
        !           219:        .byte           L_ashrsi3_29-L_ashrsi3_table
        !           220:        .byte           L_ashrsi3_30-L_ashrsi3_table
        !           221:        .byte           L_ashrsi3_31-L_ashrsi3_table
        !           222: 
        !           223: L_ashrsi3_31:
        !           224:        rotcl   r0
        !           225:        rts
        !           226:        subc    r0,r0
        !           227: 
        !           228: L_ashrsi3_30:
        !           229:        shar    r0
        !           230: L_ashrsi3_29:
        !           231:        shar    r0
        !           232: L_ashrsi3_28:
        !           233:        shar    r0
        !           234: L_ashrsi3_27:
        !           235:        shar    r0
        !           236: L_ashrsi3_26:
        !           237:        shar    r0
        !           238: L_ashrsi3_25:
        !           239:        shar    r0
        !           240: L_ashrsi3_24:
        !           241:        shlr16  r0
        !           242:        shlr8   r0
        !           243:        rts
        !           244:        exts.b  r0,r0
        !           245: 
        !           246: L_ashrsi3_23:
        !           247:        shar    r0
        !           248: L_ashrsi3_22:
        !           249:        shar    r0
        !           250: L_ashrsi3_21:
        !           251:        shar    r0
        !           252: L_ashrsi3_20:
        !           253:        shar    r0
        !           254: L_ashrsi3_19:
        !           255:        shar    r0
        !           256: L_ashrsi3_18:
        !           257:        shar    r0
        !           258: L_ashrsi3_17:
        !           259:        shar    r0
        !           260: L_ashrsi3_16:
        !           261:        shlr16  r0
        !           262:        rts
        !           263:        exts.w  r0,r0
        !           264: 
        !           265: L_ashrsi3_15:
        !           266:        shar    r0
        !           267: L_ashrsi3_14:
        !           268:        shar    r0
        !           269: L_ashrsi3_13:
        !           270:        shar    r0
        !           271: L_ashrsi3_12:
        !           272:        shar    r0
        !           273: L_ashrsi3_11:
        !           274:        shar    r0
        !           275: L_ashrsi3_10:
        !           276:        shar    r0
        !           277: L_ashrsi3_9:
        !           278:        shar    r0
        !           279: L_ashrsi3_8:
        !           280:        shar    r0
        !           281: L_ashrsi3_7:
        !           282:        shar    r0
        !           283: L_ashrsi3_6:
        !           284:        shar    r0
        !           285: L_ashrsi3_5:
        !           286:        shar    r0
        !           287: L_ashrsi3_4:
        !           288:        shar    r0
        !           289: L_ashrsi3_3:
        !           290:        shar    r0
        !           291: L_ashrsi3_2:
        !           292:        shar    r0
        !           293: L_ashrsi3_1:
        !           294:        rts
        !           295:        shar    r0
        !           296: 
        !           297: L_ashrsi3_0:
        !           298:        rts
        !           299:        nop
        !           300: 
        !           301: #endif
        !           302: 
        !           303: #ifdef L_ashiftlt
        !           304: 
        !           305: !
        !           306: ! ___ashlsi3
        !           307: !
        !           308: ! Entry:
        !           309: !
        !           310: ! r4: Value to shift
        !           311: ! r5: Shifts
        !           312: !
        !           313: ! Exit:
        !           314: !
        !           315: ! r0: Result
        !           316: !
        !           317: ! Destroys:
        !           318: !
        !           319: ! (none)
        !           320: !
        !           321:        .global ___ashlsi3
        !           322:        .align  2
        !           323: ___ashlsi3:
        !           324:        mov     #31,r0
        !           325:        cmp/hi  r0,r5
        !           326:        bt      L_ashlsi3_32
        !           327:        mova    L_ashlsi3_table,r0
        !           328:        mov.b   @(r0,r5),r5
        !           329:        add     r5,r0           ! Change to braf when gas is fixed
        !           330:        jmp     @r0
        !           331:        mov     r4,r0
        !           332: 
        !           333: L_ashlsi3_table:
        !           334:        .byte           L_ashlsi3_0-L_ashlsi3_table
        !           335:        .byte           L_ashlsi3_1-L_ashlsi3_table
        !           336:        .byte           L_ashlsi3_2-L_ashlsi3_table
        !           337:        .byte           L_ashlsi3_3-L_ashlsi3_table
        !           338:        .byte           L_ashlsi3_4-L_ashlsi3_table
        !           339:        .byte           L_ashlsi3_5-L_ashlsi3_table
        !           340:        .byte           L_ashlsi3_6-L_ashlsi3_table
        !           341:        .byte           L_ashlsi3_7-L_ashlsi3_table
        !           342:        .byte           L_ashlsi3_8-L_ashlsi3_table
        !           343:        .byte           L_ashlsi3_9-L_ashlsi3_table
        !           344:        .byte           L_ashlsi3_10-L_ashlsi3_table
        !           345:        .byte           L_ashlsi3_11-L_ashlsi3_table
        !           346:        .byte           L_ashlsi3_12-L_ashlsi3_table
        !           347:        .byte           L_ashlsi3_13-L_ashlsi3_table
        !           348:        .byte           L_ashlsi3_14-L_ashlsi3_table
        !           349:        .byte           L_ashlsi3_15-L_ashlsi3_table
        !           350:        .byte           L_ashlsi3_16-L_ashlsi3_table
        !           351:        .byte           L_ashlsi3_17-L_ashlsi3_table
        !           352:        .byte           L_ashlsi3_18-L_ashlsi3_table
        !           353:        .byte           L_ashlsi3_19-L_ashlsi3_table
        !           354:        .byte           L_ashlsi3_20-L_ashlsi3_table
        !           355:        .byte           L_ashlsi3_21-L_ashlsi3_table
        !           356:        .byte           L_ashlsi3_22-L_ashlsi3_table
        !           357:        .byte           L_ashlsi3_23-L_ashlsi3_table
        !           358:        .byte           L_ashlsi3_24-L_ashlsi3_table
        !           359:        .byte           L_ashlsi3_25-L_ashlsi3_table
        !           360:        .byte           L_ashlsi3_26-L_ashlsi3_table
        !           361:        .byte           L_ashlsi3_27-L_ashlsi3_table
        !           362:        .byte           L_ashlsi3_28-L_ashlsi3_table
        !           363:        .byte           L_ashlsi3_29-L_ashlsi3_table
        !           364:        .byte           L_ashlsi3_30-L_ashlsi3_table
        !           365:        .byte           L_ashlsi3_31-L_ashlsi3_table
        !           366: 
        !           367: L_ashlsi3_6:
        !           368:        shll2   r0
        !           369: L_ashlsi3_4:
        !           370:        shll2   r0
        !           371: L_ashlsi3_2:
        !           372:        rts
        !           373:        shll2   r0
        !           374: 
        !           375: L_ashlsi3_7:
        !           376:        shll2   r0
        !           377: L_ashlsi3_5:
        !           378:        shll2   r0
        !           379: L_ashlsi3_3:
        !           380:        shll2   r0
        !           381: L_ashlsi3_1:
        !           382:        rts
        !           383:        shll    r0
        !           384: 
        !           385: L_ashlsi3_14:
        !           386:        shll2   r0
        !           387: L_ashlsi3_12:
        !           388:        shll2   r0
        !           389: L_ashlsi3_10:
        !           390:        shll2   r0
        !           391: L_ashlsi3_8:
        !           392:        rts
        !           393:        shll8   r0
        !           394: 
        !           395: L_ashlsi3_15:
        !           396:        shll2   r0
        !           397: L_ashlsi3_13:
        !           398:        shll2   r0
        !           399: L_ashlsi3_11:
        !           400:        shll2   r0
        !           401: L_ashlsi3_9:
        !           402:        shll8   r0
        !           403:        rts
        !           404:        shll    r0
        !           405: 
        !           406: L_ashlsi3_22:
        !           407:        shll2   r0
        !           408: L_ashlsi3_20:
        !           409:        shll2   r0
        !           410: L_ashlsi3_18:
        !           411:        shll2   r0
        !           412: L_ashlsi3_16:
        !           413:        rts
        !           414:        shll16  r0
        !           415: 
        !           416: L_ashlsi3_23:
        !           417:        shll2   r0
        !           418: L_ashlsi3_21:
        !           419:        shll2   r0
        !           420: L_ashlsi3_19:
        !           421:        shll2   r0
        !           422: L_ashlsi3_17:
        !           423:        shll16  r0
        !           424:        rts
        !           425:        shll    r0
        !           426: 
        !           427: L_ashlsi3_30:
        !           428:        shll2   r0
        !           429: L_ashlsi3_28:
        !           430:        shll2   r0
        !           431: L_ashlsi3_26:
        !           432:        shll2   r0
        !           433: L_ashlsi3_24:
        !           434:        shll16  r0
        !           435:        rts
        !           436:        shll8   r0
        !           437: 
        !           438: L_ashlsi3_31:
        !           439:        shll2   r0
        !           440: L_ashlsi3_29:
        !           441:        shll2   r0
        !           442: L_ashlsi3_27:
        !           443:        shll2   r0
        !           444: L_ashlsi3_25:
        !           445:        shll16  r0
        !           446:        shll8   r0
        !           447:        rts
        !           448:        shll    r0
        !           449: 
        !           450: L_ashlsi3_32:
        !           451:        rts
        !           452:        mov     #0,r0
        !           453: 
        !           454: L_ashlsi3_0:
        !           455:        rts
        !           456:        nop
        !           457: 
        !           458: #endif
        !           459: 
        !           460: #ifdef L_lshiftrt
        !           461: 
        !           462: !
        !           463: ! ___lshrsi3
        !           464: !
        !           465: ! Entry:
        !           466: !
        !           467: ! r4: Value to shift
        !           468: ! r5: Shifts
        !           469: !
        !           470: ! Exit:
        !           471: !
        !           472: ! r0: Result
        !           473: !
        !           474: ! Destroys:
        !           475: !
        !           476: ! (none)
        !           477: !
        !           478:        .global ___lshrsi3
        !           479:        .align  2
        !           480: ___lshrsi3:
        !           481:        mov     #31,r0
        !           482:        cmp/hi  r0,r5
        !           483:        bt      L_lshrsi3_32
        !           484:        mova    L_lshrsi3_table,r0
        !           485:        mov.b   @(r0,r5),r5
        !           486:        add     r5,r0           ! Change to braf when gas is fixed
        !           487:        jmp     @r0
        !           488:        mov     r4,r0
        !           489: 
        !           490: L_lshrsi3_table:
        !           491:        .byte           L_lshrsi3_0-L_lshrsi3_table
        !           492:        .byte           L_lshrsi3_1-L_lshrsi3_table
        !           493:        .byte           L_lshrsi3_2-L_lshrsi3_table
        !           494:        .byte           L_lshrsi3_3-L_lshrsi3_table
        !           495:        .byte           L_lshrsi3_4-L_lshrsi3_table
        !           496:        .byte           L_lshrsi3_5-L_lshrsi3_table
        !           497:        .byte           L_lshrsi3_6-L_lshrsi3_table
        !           498:        .byte           L_lshrsi3_7-L_lshrsi3_table
        !           499:        .byte           L_lshrsi3_8-L_lshrsi3_table
        !           500:        .byte           L_lshrsi3_9-L_lshrsi3_table
        !           501:        .byte           L_lshrsi3_10-L_lshrsi3_table
        !           502:        .byte           L_lshrsi3_11-L_lshrsi3_table
        !           503:        .byte           L_lshrsi3_12-L_lshrsi3_table
        !           504:        .byte           L_lshrsi3_13-L_lshrsi3_table
        !           505:        .byte           L_lshrsi3_14-L_lshrsi3_table
        !           506:        .byte           L_lshrsi3_15-L_lshrsi3_table
        !           507:        .byte           L_lshrsi3_16-L_lshrsi3_table
        !           508:        .byte           L_lshrsi3_17-L_lshrsi3_table
        !           509:        .byte           L_lshrsi3_18-L_lshrsi3_table
        !           510:        .byte           L_lshrsi3_19-L_lshrsi3_table
        !           511:        .byte           L_lshrsi3_20-L_lshrsi3_table
        !           512:        .byte           L_lshrsi3_21-L_lshrsi3_table
        !           513:        .byte           L_lshrsi3_22-L_lshrsi3_table
        !           514:        .byte           L_lshrsi3_23-L_lshrsi3_table
        !           515:        .byte           L_lshrsi3_24-L_lshrsi3_table
        !           516:        .byte           L_lshrsi3_25-L_lshrsi3_table
        !           517:        .byte           L_lshrsi3_26-L_lshrsi3_table
        !           518:        .byte           L_lshrsi3_27-L_lshrsi3_table
        !           519:        .byte           L_lshrsi3_28-L_lshrsi3_table
        !           520:        .byte           L_lshrsi3_29-L_lshrsi3_table
        !           521:        .byte           L_lshrsi3_30-L_lshrsi3_table
        !           522:        .byte           L_lshrsi3_31-L_lshrsi3_table
        !           523: 
        !           524: L_lshrsi3_6:
        !           525:        shlr2   r0
        !           526: L_lshrsi3_4:
        !           527:        shlr2   r0
        !           528: L_lshrsi3_2:
        !           529:        rts
        !           530:        shlr2   r0
        !           531: 
        !           532: L_lshrsi3_7:
        !           533:        shlr2   r0
        !           534: L_lshrsi3_5:
        !           535:        shlr2   r0
        !           536: L_lshrsi3_3:
        !           537:        shlr2   r0
        !           538: L_lshrsi3_1:
        !           539:        rts
        !           540:        shlr    r0
        !           541: 
        !           542: L_lshrsi3_14:
        !           543:        shlr2   r0
        !           544: L_lshrsi3_12:
        !           545:        shlr2   r0
        !           546: L_lshrsi3_10:
        !           547:        shlr2   r0
        !           548: L_lshrsi3_8:
        !           549:        rts
        !           550:        shlr8   r0
        !           551: 
        !           552: L_lshrsi3_15:
        !           553:        shlr2   r0
        !           554: L_lshrsi3_13:
        !           555:        shlr2   r0
        !           556: L_lshrsi3_11:
        !           557:        shlr2   r0
        !           558: L_lshrsi3_9:
        !           559:        shlr8   r0
        !           560:        rts
        !           561:        shlr    r0
        !           562: 
        !           563: L_lshrsi3_22:
        !           564:        shlr2   r0
        !           565: L_lshrsi3_20:
        !           566:        shlr2   r0
        !           567: L_lshrsi3_18:
        !           568:        shlr2   r0
        !           569: L_lshrsi3_16:
        !           570:        rts
        !           571:        shlr16  r0
        !           572: 
        !           573: L_lshrsi3_23:
        !           574:        shlr2   r0
        !           575: L_lshrsi3_21:
        !           576:        shlr2   r0
        !           577: L_lshrsi3_19:
        !           578:        shlr2   r0
        !           579: L_lshrsi3_17:
        !           580:        shlr16  r0
        !           581:        rts
        !           582:        shlr    r0
        !           583: 
        !           584: L_lshrsi3_30:
        !           585:        shlr2   r0
        !           586: L_lshrsi3_28:
        !           587:        shlr2   r0
        !           588: L_lshrsi3_26:
        !           589:        shlr2   r0
        !           590: L_lshrsi3_24:
        !           591:        shlr16  r0
        !           592:        rts
        !           593:        shlr8   r0
        !           594: 
        !           595: L_lshrsi3_31:
        !           596:        shlr2   r0
        !           597: L_lshrsi3_29:
        !           598:        shlr2   r0
        !           599: L_lshrsi3_27:
        !           600:        shlr2   r0
        !           601: L_lshrsi3_25:
        !           602:        shlr16  r0
        !           603:        shlr8   r0
        !           604:        rts
        !           605:        shlr    r0
        !           606: 
        !           607: L_lshrsi3_32:
        !           608:        rts
        !           609:        mov     #0,r0
        !           610: 
        !           611: L_lshrsi3_0:
        !           612:        rts
        !           613:        nop
        !           614: 
1.1       root      615: #endif
                    616: 
                    617: #ifdef L_movstr
                    618:        .text
                    619: ! done all the large groups, do the remainder
                    620: 
                    621: ! jump to movstr+
                    622: done:
                    623:        add     #64,r5
                    624:        mova    ___movstrSI0,r0
                    625:        shll2   r6
                    626:        add     r6,r0
                    627:        jmp     @r0
1.1.1.2 ! root      628:        add     #64,r4
1.1       root      629:        .align  4
                    630:        .global ___movstrSI64
                    631: ___movstrSI64:
                    632:        mov.l   @(60,r5),r0
                    633:        mov.l   r0,@(60,r4)
                    634:        .global ___movstrSI60
                    635: ___movstrSI60:
                    636:        mov.l   @(56,r5),r0
                    637:        mov.l   r0,@(56,r4)
                    638:        .global ___movstrSI56
                    639: ___movstrSI56:
                    640:        mov.l   @(52,r5),r0
                    641:        mov.l   r0,@(52,r4)
                    642:        .global ___movstrSI52
                    643: ___movstrSI52:
                    644:        mov.l   @(48,r5),r0
                    645:        mov.l   r0,@(48,r4)
                    646:        .global ___movstrSI48
                    647: ___movstrSI48:
                    648:        mov.l   @(44,r5),r0
                    649:        mov.l   r0,@(44,r4)
                    650:        .global ___movstrSI44
                    651: ___movstrSI44:
                    652:        mov.l   @(40,r5),r0
                    653:        mov.l   r0,@(40,r4)
                    654:        .global ___movstrSI40
                    655: ___movstrSI40:
                    656:        mov.l   @(36,r5),r0
                    657:        mov.l   r0,@(36,r4)
                    658:        .global ___movstrSI36
                    659: ___movstrSI36:
                    660:        mov.l   @(32,r5),r0
                    661:        mov.l   r0,@(32,r4)
                    662:        .global ___movstrSI32
                    663: ___movstrSI32:
                    664:        mov.l   @(28,r5),r0
                    665:        mov.l   r0,@(28,r4)
                    666:        .global ___movstrSI28
                    667: ___movstrSI28:
                    668:        mov.l   @(24,r5),r0
                    669:        mov.l   r0,@(24,r4)
                    670:        .global ___movstrSI24
                    671: ___movstrSI24:
                    672:        mov.l   @(20,r5),r0
                    673:        mov.l   r0,@(20,r4)
                    674:        .global ___movstrSI20
                    675: ___movstrSI20:
                    676:        mov.l   @(16,r5),r0
                    677:        mov.l   r0,@(16,r4)
                    678:        .global ___movstrSI16
                    679: ___movstrSI16:
                    680:        mov.l   @(12,r5),r0
                    681:        mov.l   r0,@(12,r4)
                    682:        .global ___movstrSI12
                    683: ___movstrSI12:
                    684:        mov.l   @(8,r5),r0
                    685:        mov.l   r0,@(8,r4)
                    686:        .global ___movstrSI8
                    687: ___movstrSI8:
                    688:        mov.l   @(4,r5),r0
                    689:        mov.l   r0,@(4,r4)
                    690:        .global ___movstrSI4
                    691: ___movstrSI4:
                    692:        mov.l   @(0,r5),r0
                    693:        mov.l   r0,@(0,r4)
                    694: ___movstrSI0:
                    695:        rts
                    696:        or      r0,r0,r0
                    697: 
                    698:        .align  4
                    699: 
                    700:        .global ___movstr
                    701: ___movstr:
                    702:        mov.l   @(60,r5),r0
                    703:        mov.l   r0,@(60,r4)
                    704: 
                    705:        mov.l   @(56,r5),r0
                    706:        mov.l   r0,@(56,r4)
                    707: 
                    708:        mov.l   @(52,r5),r0
                    709:        mov.l   r0,@(52,r4)
                    710: 
                    711:        mov.l   @(48,r5),r0
                    712:        mov.l   r0,@(48,r4)
                    713: 
                    714:        mov.l   @(44,r5),r0
                    715:        mov.l   r0,@(44,r4)
                    716: 
                    717:        mov.l   @(40,r5),r0
                    718:        mov.l   r0,@(40,r4)
                    719: 
                    720:        mov.l   @(36,r5),r0
                    721:        mov.l   r0,@(36,r4)
                    722: 
                    723:        mov.l   @(32,r5),r0
                    724:        mov.l   r0,@(32,r4)
                    725: 
                    726:        mov.l   @(28,r5),r0
                    727:        mov.l   r0,@(28,r4)
                    728: 
                    729:        mov.l   @(24,r5),r0
                    730:        mov.l   r0,@(24,r4)
                    731: 
                    732:        mov.l   @(20,r5),r0
                    733:        mov.l   r0,@(20,r4)
                    734: 
                    735:        mov.l   @(16,r5),r0
                    736:        mov.l   r0,@(16,r4)
                    737: 
                    738:        mov.l   @(12,r5),r0
                    739:        mov.l   r0,@(12,r4)
                    740: 
                    741:        mov.l   @(8,r5),r0
                    742:        mov.l   r0,@(8,r4)
                    743: 
                    744:        mov.l   @(4,r5),r0
                    745:        mov.l   r0,@(4,r4)
                    746: 
                    747:        mov.l   @(0,r5),r0
                    748:        mov.l   r0,@(0,r4)
                    749: 
                    750:        add     #-16,r6
                    751:        cmp/pl  r6
                    752:        bf      done
                    753: 
                    754:        add     #64,r5
                    755:        bra     ___movstr
                    756:        add     #64,r4
                    757: #endif
                    758: 
                    759: #ifdef L_mulsi3
                    760: 
                    761: 
                    762:        .global ___mulsi3
                    763: 
                    764: ! r4 =       aabb
                    765: ! r5 =       ccdd
                    766: ! r0 = aabb*ccdd  via partial products
                    767: !
                    768: ! if aa == 0 and cc = 0
                    769: ! r0 = bb*dd
                    770: !
                    771: ! else
                    772: ! aa = bb*dd + (aa*dd*65536) + (cc*bb*65536)
                    773: !
                    774: 
                    775: ___mulsi3:
                    776:        mulu    r4,r5           ! multiply the lsws  macl=bb*dd
                    777:        mov     r5,r3           ! r3 = ccdd
                    778:        swap.w  r4,r2           ! r2 = bbaa
                    779:        xtrct   r2,r3           ! r3 = aacc
                    780:        tst     r3,r3           ! msws zero ?
1.1.1.2 ! root      781:        bf      hiset
        !           782:        rts                     ! yes - then we have the answer
1.1       root      783:        sts     macl,r0
                    784: 
                    785: hiset: sts     macl,r0         ! r0 = bb*dd
                    786:        mulu    r2,r5           | brewing macl = aa*dd
                    787:        sts     macl,r1
                    788:        mulu    r3,r4           | brewing macl = cc*bb
1.1.1.2 ! root      789:        sts     macl,r2
1.1       root      790:        add     r1,r2
                    791:        shll16  r2
                    792:        rts
                    793:        add     r2,r0
1.1.1.2 ! root      794: 
        !           795: 
        !           796: #endif
1.1       root      797: #ifdef L_sdivsi3
                    798:        .title "SH DIVIDE"
                    799: !! 4 byte integer Divide code for the Hitachi SH
                    800: !!
                    801: !! Steve Chamberlain
                    802: !! [email protected]
                    803: !!
                    804: !!
                    805: 
                    806: !! args in r4 and r5, result in r0 clobber r1,r2,r3
                    807: 
                    808:        .global ___sdivsi3
                    809: ___sdivsi3:
                    810:        mov     r4,r1
                    811:        mov     r5,r0
1.1.1.2 ! root      812: 
1.1       root      813:        tst     r0,r0
                    814:        bt      div0
                    815:        mov     #0,r2
                    816:        div0s   r2,r1
                    817:        subc    r3,r3
                    818:        subc    r2,r1
                    819:        div0s   r0,r3
                    820:        rotcl   r1
                    821:        div1    r0,r3
                    822:        rotcl   r1
                    823:        div1    r0,r3
                    824:        rotcl   r1
                    825:        div1    r0,r3
                    826:        rotcl   r1
                    827:        div1    r0,r3
                    828:        rotcl   r1
                    829:        div1    r0,r3
                    830:        rotcl   r1
                    831:        div1    r0,r3
                    832:        rotcl   r1
                    833:        div1    r0,r3
                    834:        rotcl   r1
                    835:        div1    r0,r3
                    836:        rotcl   r1
                    837:        div1    r0,r3
                    838:        rotcl   r1
                    839:        div1    r0,r3
                    840:        rotcl   r1
                    841:        div1    r0,r3
                    842:        rotcl   r1
                    843:        div1    r0,r3
                    844:        rotcl   r1
                    845:        div1    r0,r3
                    846:        rotcl   r1
                    847:        div1    r0,r3
                    848:        rotcl   r1
                    849:        div1    r0,r3
                    850:        rotcl   r1
                    851:        div1    r0,r3
                    852:        rotcl   r1
                    853:        div1    r0,r3
                    854:        rotcl   r1
                    855:        div1    r0,r3
                    856:        rotcl   r1
                    857:        div1    r0,r3
                    858:        rotcl   r1
                    859:        div1    r0,r3
                    860:        rotcl   r1
                    861:        div1    r0,r3
                    862:        rotcl   r1
                    863:        div1    r0,r3
                    864:        rotcl   r1
                    865:        div1    r0,r3
                    866:        rotcl   r1
                    867:        div1    r0,r3
                    868:        rotcl   r1
                    869:        div1    r0,r3
                    870:        rotcl   r1
                    871:        div1    r0,r3
                    872:        rotcl   r1
                    873:        div1    r0,r3
                    874:        rotcl   r1
                    875:        div1    r0,r3
                    876:        rotcl   r1
                    877:        div1    r0,r3
                    878:        rotcl   r1
                    879:        div1    r0,r3
                    880:        rotcl   r1
                    881:        div1    r0,r3
                    882:        rotcl   r1
                    883:        div1    r0,r3
                    884:        rotcl   r1
                    885:        addc    r2,r1
1.1.1.2 ! root      886:        rts
1.1       root      887:        mov     r1,r0
                    888: 
1.1.1.2 ! root      889: 
1.1       root      890: div0:  rts
                    891:        mov     #0,r0
                    892: 
                    893: #endif
                    894: #ifdef L_udivsi3
                    895: 
                    896:        .title "SH DIVIDE"
                    897: !! 4 byte integer Divide code for the Hitachi SH
                    898: !!
                    899: !! Steve Chamberlain
                    900: !! [email protected]
                    901: !!
1.1.1.2 ! root      902: !!
1.1       root      903: 
1.1.1.2 ! root      904: !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
1.1       root      905:        .global ___udivsi3
                    906: 
                    907: ___udivsi3:
                    908: longway:
                    909:        mov     #0,r0
1.1.1.2 ! root      910:        div0u
        !           911:        ! get one bit from the msb of the numerator into the T
1.1       root      912:        ! bit and divide it by whats in r5.  Put the answer bit
                    913:        ! into the T bit so it can come out again at the bottom
                    914: 
1.1.1.2 ! root      915:        rotcl   r4 ; div1 r5,r0
1.1       root      916:        rotcl   r4 ; div1 r5,r0
                    917:        rotcl   r4 ; div1 r5,r0
                    918:        rotcl   r4 ; div1 r5,r0
                    919:        rotcl   r4 ; div1 r5,r0
                    920:        rotcl   r4 ; div1 r5,r0
                    921:        rotcl   r4 ; div1 r5,r0
                    922:        rotcl   r4 ; div1 r5,r0
                    923: 
                    924:        rotcl   r4 ; div1 r5,r0
                    925:        rotcl   r4 ; div1 r5,r0
                    926:        rotcl   r4 ; div1 r5,r0
                    927:        rotcl   r4 ; div1 r5,r0
                    928:        rotcl   r4 ; div1 r5,r0
                    929:        rotcl   r4 ; div1 r5,r0
                    930:        rotcl   r4 ; div1 r5,r0
                    931:        rotcl   r4 ; div1 r5,r0
                    932: shortway:
                    933:        rotcl   r4 ; div1 r5,r0
                    934:        rotcl   r4 ; div1 r5,r0
                    935:        rotcl   r4 ; div1 r5,r0
                    936:        rotcl   r4 ; div1 r5,r0
                    937:        rotcl   r4 ; div1 r5,r0
                    938:        rotcl   r4 ; div1 r5,r0
                    939:        rotcl   r4 ; div1 r5,r0
                    940:        rotcl   r4 ; div1 r5,r0
                    941: 
                    942: vshortway:
                    943:        rotcl   r4 ; div1 r5,r0
                    944:        rotcl   r4 ; div1 r5,r0
                    945:        rotcl   r4 ; div1 r5,r0
                    946:        rotcl   r4 ; div1 r5,r0
                    947:        rotcl   r4 ; div1 r5,r0
                    948:        rotcl   r4 ; div1 r5,r0
                    949:        rotcl   r4 ; div1 r5,r0
                    950:        rotcl   r4 ; div1 r5,r0
1.1.1.2 ! root      951:        rotcl   r4
1.1       root      952: ret:   rts
                    953:        mov     r4,r0
                    954: 
                    955: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.