diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1998-02-14 19:27:17 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1998-02-14 19:27:17 +0000 |
commit | 6de8cb0481bd793706e38dead271f9233a57b7e5 (patch) | |
tree | 7ff9ff6922a48636469d3b019d912ee0b7894c00 /gnu/usr.bin/gcc/config/pa | |
parent | 627e15b4811e5758670f68174f71540e63fb4040 (diff) |
Diffstat (limited to 'gnu/usr.bin/gcc/config/pa')
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/ee.asm | 261 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/ee_fp.asm | 274 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/lib1funcs.asm | 1146 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/pa-gas.h | 21 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/pa-hpux10.h | 71 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/pa-pro-end.h | 41 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/pa-pro.h | 78 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/rtems.h | 26 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/t-pro | 38 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/config/pa/xm-papro.h | 58 |
10 files changed, 2014 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/config/pa/ee.asm b/gnu/usr.bin/gcc/config/pa/ee.asm new file mode 100644 index 00000000000..787bda75c0d --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/ee.asm @@ -0,0 +1,261 @@ +; Subroutines for out of line prologues and epilogues on for the HPPA +; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +; This file is part of GNU CC. + +; GNU CC is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. + +; GNU CC is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. + +; You should have received a copy of the GNU General Public License +; along with GNU CC; see the file COPYING. If not, write to +; the Free Software Foundation, 59 Temple Place - Suite 330, +; Boston, MA 02111-1307, USA. + + .SPACE $PRIVATE$ + .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 + .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82 + .SPACE $TEXT$ + .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44 + .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY + .SUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=8 + +; This is an out-of-line prologue. +; +; It performs the following operations: +; +; * Saves the return pointer at sp - 20 +; +; * Creates a new stack frame (sp'), size of the frame is passed in %r21 +; +; * The old stack pointer is saved at sp (frame pointer version only). +; +; * Saves grs (passed in low 16 bits of %r22 into the stack frame +; at sp' + local_fsize (passed in %r19). +; +; * Saves frs (passed in high 16 bits of %r22) into the stack +; frame at sp' + local_fsize (passed in %r19). +; +; * Sets up a frame pointer (in %r3) (frame pointer version only). +; +; * Returns to the instruction _immediately_ after the call to +; this function. + + .SPACE $TEXT$ + .SUBSPA $MILLICODE$ + .EXPORT __outline_prologue,MILLICODE + .align 32 +__outline_prologue + .PROC + .CALLINFO FRAME=0,NO_CALLS + .ENTRY + copy %r30,%r20 + + ; Subtract 4 from our return pointer so that we return to + ; the right location. + ldo -4(%r31),%r31 + + ; Save off %r2 + stw %r2,-20(0,%r30) + + ; Make our new frame. + add %r21,%r30,%r30 + + ; Add in local_fsize to our frame pointer so we do register + ; saves into the right place + add %r20,%r19,%r20 + + ; %r22 tells us what registers we need to save. The upper half + ; is for fp registers, the lower half for integer registers. + ; We put the lower half in %r1 and the upper half into %r22 + ; for later use. + extru %r22,31,16,%r1 + extrs %r22,15,16,%r22 + + ; %r1 now olds a value 0-18 which corresponds to the number + ; of grs we need to save. We need to reverse that value so + ; we can just into the table and straight-line execute to the + ; end of the gr saves. + comb,= %r0,%r1,L$0000 + subi 18,%r1,%r1 + blr,n %r1,%r0 + b,n L$0000 + stws,ma %r18,4(0,%r20) + nop + stws,ma %r17,4(0,%r20) + nop + stws,ma %r16,4(0,%r20) + nop + stws,ma %r15,4(0,%r20) + nop + stws,ma %r14,4(0,%r20) + nop + stws,ma %r13,4(0,%r20) + nop + stws,ma %r12,4(0,%r20) + nop + stws,ma %r11,4(0,%r20) + nop + stws,ma %r10,4(0,%r20) + nop + stws,ma %r9,4(0,%r20) + nop + stws,ma %r8,4(0,%r20) + nop + stws,ma %r7,4(0,%r20) + nop + stws,ma %r6,4(0,%r20) + nop + stws,ma %r5,4(0,%r20) + nop + stws,ma %r4,4(0,%r20) + nop + stws,ma %r3,4(0,%r20) + nop +L$0000 + ; All gr saves are done. Align the temporary frame pointer and + ; do the fr saves. + ldo 7(%r20),%r20 + depi 0,31,3,%r20 + + comb,= %r0,%r22,L$0001 + subi 21,%r22,%r22 + blr,n %r22,%r0 + b,n L$0001 + fstws,ma %fr21,8(0,%r20) + nop + fstws,ma %fr20,8(0,%r20) + nop + fstws,ma %fr19,8(0,%r20) + nop + fstws,ma %fr18,8(0,%r20) + nop + fstws,ma %fr17,8(0,%r20) + nop + fstws,ma %fr16,8(0,%r20) + nop + fstws,ma %fr15,8(0,%r20) + nop + fstws,ma %fr14,8(0,%r20) + nop + fstws,ma %fr13,8(0,%r20) + nop + fstws,ma %fr12,8(0,%r20) + nop +L$0001 + ; Return + bv,n 0(%r31) + .EXIT + .PROCEND + + + + .EXPORT __outline_epilogue,MILLICODE + .align 32 +__outline_epilogue + .PROC + .CALLINFO FRAME=0,NO_CALLS + .ENTRY + ; Get our original stack pointer and put it in %r20 + sub %r30,%r21,%r20 + + ; Subtract 4 from our return pointer so that we return to + ; the right location. + ldo -4(%r31),%r31 + + ; Reload %r2 + ldw -20(0,%r20),%r2 + + ; Add in local_fsize (%r19) to the frame pointer to find + ; the saved registers. + add %r20,%r19,%r20 + + ; %r22 tells us what registers we need to restore. The upper half + ; is for fp registers, the lower half for integer registers. + ; We put the lower half in %r1 and the upper half into %r22 + ; for later use. + extru %r22,31,16,%r1 + extrs %r22,15,16,%r22 + + ; %r1 now olds a value 0-18 which corresponds to the number + ; of grs we need to restore. We need to reverse that value so + ; we can just into the table and straight-line execute to the + ; end of the gr restore. + comb,= %r0,%r1,L$0004 + subi 18,%r1,%r1 + blr,n %r1,%r0 + b,n L$0004 + ldws,ma 4(0,%r20),%r18 + nop + ldws,ma 4(0,%r20),%r17 + nop + ldws,ma 4(0,%r20),%r16 + nop + ldws,ma 4(0,%r20),%r15 + nop + ldws,ma 4(0,%r20),%r14 + nop + ldws,ma 4(0,%r20),%r13 + nop + ldws,ma 4(0,%r20),%r12 + nop + ldws,ma 4(0,%r20),%r11 + nop + ldws,ma 4(0,%r20),%r10 + nop + ldws,ma 4(0,%r20),%r9 + nop + ldws,ma 4(0,%r20),%r8 + nop + ldws,ma 4(0,%r20),%r7 + nop + ldws,ma 4(0,%r20),%r6 + nop + ldws,ma 4(0,%r20),%r5 + nop + ldws,ma 4(0,%r20),%r4 + nop + ldws,ma 4(0,%r20),%r3 + nop +L$0004 + ; All gr restore are done. Align the temporary frame pointer and + ; do the fr restore. + ldo 7(%r20),%r20 + depi 0,31,3,%r20 + + comb,= %r0,%r22,L$0005 + subi 21,%r22,%r22 + blr,n %r22,%r0 + b,n L$0005 + fldws,ma 8(0,%r20),%fr21 + nop + fldws,ma 8(0,%r20),%fr20 + nop + fldws,ma 8(0,%r20),%fr19 + nop + fldws,ma 8(0,%r20),%fr18 + nop + fldws,ma 8(0,%r20),%fr17 + nop + fldws,ma 8(0,%r20),%fr16 + nop + fldws,ma 8(0,%r20),%fr15 + nop + fldws,ma 8(0,%r20),%fr14 + nop + fldws,ma 8(0,%r20),%fr13 + nop + fldws,ma 8(0,%r20),%fr12 + nop +L$0005 + ; Return and deallocate our frame. + bv 0(%r31) + sub %r30,%r21,%r30 + .EXIT + .PROCEND diff --git a/gnu/usr.bin/gcc/config/pa/ee_fp.asm b/gnu/usr.bin/gcc/config/pa/ee_fp.asm new file mode 100644 index 00000000000..ef040cf7dad --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/ee_fp.asm @@ -0,0 +1,274 @@ +; Subroutines for out of line prologues and epilogues on for the HPPA +; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +; This file is part of GNU CC. + +; GNU CC is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. + +; GNU CC is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. + +; You should have received a copy of the GNU General Public License +; along with GNU CC; see the file COPYING. If not, write to +; the Free Software Foundation, 59 Temple Place - Suite 330, +; Boston, MA 02111-1307, USA. + + .SPACE $PRIVATE$ + .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 + .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82 + .SPACE $TEXT$ + .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44 + .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY + .SUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=8 + + +; This is an out-of-line prologue. +; +; It performs the following operations: +; +; * Saves the return pointer at sp - 20 +; +; * Creates a new stack frame (sp'), size of the frame is passed in %r21 +; +; * The old stack pointer is saved at sp (frame pointer version only). +; +; * Saves grs (passed in low 16 bits of %r22 into the stack frame +; at sp' + local_fsize (passed in %r19). +; +; * Saves frs (passed in high 16 bits of %r22) into the stack +; frame at sp' + local_fsize (passed in %r19). +; +; * Sets up a frame pointer (in %r3) (frame pointer version only). +; +; * Returns to the instruction _immediately_ after the call to +; this function. + + .SPACE $TEXT$ + .SUBSPA $MILLICODE$ + .EXPORT __outline_prologue_fp,MILLICODE + .align 32 +__outline_prologue_fp + .PROC + .CALLINFO FRAME=0,NO_CALLS + .ENTRY + copy %r30,%r20 + + ; Subtract 4 from our return pointer so that we return to + ; the right location. + ldo -4(%r31),%r31 + + ; Save off %r2 + stw %r2,-20(0,%r30) + + ; Make our new frame. + add %r21,%r30,%r30 + + ; Save our old stack pointer. + stw %r20,0(0,%r20) + + ; Add in local_fsize to our frame pointer so we do register + ; saves into the right place + add %r20,%r19,%r20 + + ; %r22 tells us what registers we need to save. The upper half + ; is for fp registers, the lower half for integer registers. + ; We put the lower half in %r1 and the upper half into %r22 + ; for later use. + extru %r22,31,16,%r1 + extrs %r22,15,16,%r22 + + ; %r1 now olds a value 0-18 which corresponds to the number + ; of grs we need to save. We need to reverse that value so + ; we can just into the table and straight-line execute to the + ; end of the gr saves. + comb,= %r0,%r1,L$0002 + subi 18,%r1,%r1 + blr,n %r1,%r0 + b,n L$0002 + stws,ma %r18,4(0,%r20) + nop + stws,ma %r17,4(0,%r20) + nop + stws,ma %r16,4(0,%r20) + nop + stws,ma %r15,4(0,%r20) + nop + stws,ma %r14,4(0,%r20) + nop + stws,ma %r13,4(0,%r20) + nop + stws,ma %r12,4(0,%r20) + nop + stws,ma %r11,4(0,%r20) + nop + stws,ma %r10,4(0,%r20) + nop + stws,ma %r9,4(0,%r20) + nop + stws,ma %r8,4(0,%r20) + nop + stws,ma %r7,4(0,%r20) + nop + stws,ma %r6,4(0,%r20) + nop + stws,ma %r5,4(0,%r20) + nop + stws,ma %r4,4(0,%r20) + nop + stws,ma %r3,4(0,%r20) + nop +L$0002 + ; All gr saves are done. Align the temporary frame pointer and + ; do the fr saves. + ldo 7(%r20),%r20 + depi 0,31,3,%r20 + + comb,= %r0,%r22,L$0003 + subi 21,%r22,%r22 + blr,n %r22,%r0 + b,n L$0003 + fstws,ma %fr21,8(0,%r20) + nop + fstws,ma %fr20,8(0,%r20) + nop + fstws,ma %fr19,8(0,%r20) + nop + fstws,ma %fr18,8(0,%r20) + nop + fstws,ma %fr17,8(0,%r20) + nop + fstws,ma %fr16,8(0,%r20) + nop + fstws,ma %fr15,8(0,%r20) + nop + fstws,ma %fr14,8(0,%r20) + nop + fstws,ma %fr13,8(0,%r20) + nop + fstws,ma %fr12,8(0,%r20) + nop +L$0003 + ; Return, setting up a frame pointer in the delay slot + bv 0(%r31) + sub %r30,%r21,%r3 + .EXIT + .PROCEND + + +; This is an out-of-line epilogue. It's operation is basically the reverse +; of the out-of-line prologue. + + .EXPORT __outline_epilogue_fp,MILLICODE + .align 32 +__outline_epilogue_fp + .PROC + .CALLINFO FRAME=0,NO_CALLS + .ENTRY + ; Make a copy of our frame pointer into %r20 + copy %r3,%r20 + + ; Subtract 4 from our return pointer so that we return to + ; the right location. + ldo -4(%r31),%r31 + + ; Reload %r2 + ; First save off %r2 + ldw -20(0,%r20),%r2 + + ; Load our old stack pointer, save it in %r21. + ldw 0(0,%r20),%r21 + + ; Add in local_fsize (%r19) to the frame pointer to find + ; the saved registers. + add %r20,%r19,%r20 + + ; %r22 tells us what registers we need to restore. The upper half + ; is for fp registers, the lower half for integer registers. + ; We put the lower half in %r1 and the upper half into %r22 + ; for later use. + extru %r22,31,16,%r1 + extrs %r22,15,16,%r22 + + ; %r1 now olds a value 0-18 which corresponds to the number + ; of grs we need to restore. We need to reverse that value so + ; we can just into the table and straight-line execute to the + ; end of the gr restore. + comb,= %r0,%r1,L$0006 + subi 18,%r1,%r1 + blr,n %r1,%r0 + b,n L$0006 + ldws,ma 4(0,%r20),%r18 + nop + ldws,ma 4(0,%r20),%r17 + nop + ldws,ma 4(0,%r20),%r16 + nop + ldws,ma 4(0,%r20),%r15 + nop + ldws,ma 4(0,%r20),%r14 + nop + ldws,ma 4(0,%r20),%r13 + nop + ldws,ma 4(0,%r20),%r12 + nop + ldws,ma 4(0,%r20),%r11 + nop + ldws,ma 4(0,%r20),%r10 + nop + ldws,ma 4(0,%r20),%r9 + nop + ldws,ma 4(0,%r20),%r8 + nop + ldws,ma 4(0,%r20),%r7 + nop + ldws,ma 4(0,%r20),%r6 + nop + ldws,ma 4(0,%r20),%r5 + nop + ldws,ma 4(0,%r20),%r4 + nop + ldws,ma 4(0,%r20),%r3 + nop +L$0006 + ; All gr restore are done. Align the temporary frame pointer and + ; do the fr restore. + ldo 7(%r20),%r20 + depi 0,31,3,%r20 + + comb,= %r0,%r22,L$0007 + subi 21,%r22,%r22 + blr,n %r22,%r0 + b,n L$0007 + fldws,ma 8(0,%r20),%fr21 + nop + fldws,ma 8(0,%r20),%fr20 + nop + fldws,ma 8(0,%r20),%fr19 + nop + fldws,ma 8(0,%r20),%fr18 + nop + fldws,ma 8(0,%r20),%fr17 + nop + fldws,ma 8(0,%r20),%fr16 + nop + fldws,ma 8(0,%r20),%fr15 + nop + fldws,ma 8(0,%r20),%fr14 + nop + fldws,ma 8(0,%r20),%fr13 + nop + fldws,ma 8(0,%r20),%fr12 + nop +L$0007 + ; Return and deallocate our frame. + bv 0(%r31) + copy %r21,%r30 + .EXIT + .PROCEND + + diff --git a/gnu/usr.bin/gcc/config/pa/lib1funcs.asm b/gnu/usr.bin/gcc/config/pa/lib1funcs.asm new file mode 100644 index 00000000000..95eb75e1398 --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/lib1funcs.asm @@ -0,0 +1,1146 @@ +; Low level integer divide, multiply, remainder, etc routines for the HPPA. +; Copyright (C) 1995 Free Software Foundation, Inc. + +; This file is part of GNU CC. + +; GNU CC is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2, or (at your option) +; any later version. + +; In addition to the permissions in the GNU General Public License, the +; Free Software Foundation gives you unlimited permission to link the +; compiled version of this file with other programs, and to distribute +; those programs without any restriction coming from the use of this +; file. (The General Public License restrictions do apply in other +; respects; for example, they cover modification of the file, and +; distribution when not linked into another program.) + +; GNU CC is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. + +; You should have received a copy of the GNU General Public License +; along with GNU CC; see the file COPYING. If not, write to +; the Free Software Foundation, 59 Temple Place - Suite 330, +; Boston, MA 02111-1307, USA. + +#ifdef L_dyncall + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .export $$dyncall +$$dyncall + .proc + .callinfo frame=0,no_calls + .entry + bb,>=,n %r22,30,L$1 ; branch if not plabel address + depi 0,31,2,%r22 ; clear the two least significant bits + ldw 4(%sr0,%r22),%r19 ; load new LTP value + ldw 0(%sr0,%r22),%r22 ; load address of target +L$1 ldsid (%sr0,%r22),%r1 ; get the "space ident" selected by r22 + mtsp %r1,%sr0 ; move that space identifier into sr0 + be 0(%sr0,%r22) ; branch to the real target + stw %r2,-24(%sr0,%r30) ; save return address into frame marker + .exit + .procend +#endif + + +#ifdef L_multiply +#define op0 %r26 +#define op1 %r25 +#define res %r29 +#define ret %r31 +#define tmp %r1 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$mulU + .export $$mulI +$$mulU +$$mulI + .proc + .callinfo frame=0,no_calls + .entry + addi,tr 0,%r0,res ; clear out res, skip next insn +L$loop zdep op1,26,27,op1 ; shift up op1 by 5 +L$lo zdep op0,30,5,tmp ; extract next 5 bits and shift up + blr tmp,%r0 + extru op0,26,27,op0 ; shift down op0 by 5 +L$0 comib,<> 0,op0,L$lo + zdep op1,26,27,op1 ; shift up op1 by 5 + bv %r0(ret) + nop +L$1 b L$loop + addl op1,res,res + nop + nop +L$2 b L$loop + sh1addl op1,res,res + nop + nop +L$3 sh1addl op1,op1,tmp ; 3x + b L$loop + addl tmp,res,res + nop +L$4 b L$loop + sh2addl op1,res,res + nop + nop +L$5 sh2addl op1,op1,tmp ; 5x + b L$loop + addl tmp,res,res + nop +L$6 sh1addl op1,op1,tmp ; 3x + b L$loop + sh1addl tmp,res,res + nop +L$7 zdep op1,28,29,tmp ; 8x + sub tmp,op1,tmp ; 7x + b L$loop + addl tmp,res,res +L$8 b L$loop + sh3addl op1,res,res + nop + nop +L$9 sh3addl op1,op1,tmp ; 9x + b L$loop + addl tmp,res,res + nop +L$10 sh2addl op1,op1,tmp ; 5x + b L$loop + sh1addl tmp,res,res + nop +L$11 sh2addl op1,op1,tmp ; 5x + sh1addl tmp,op1,tmp ; 11x + b L$loop + addl tmp,res,res +L$12 sh1addl op1,op1,tmp ; 3x + b L$loop + sh2addl tmp,res,res + nop +L$13 sh1addl op1,op1,tmp ; 3x + sh2addl tmp,op1,tmp ; 13x + b L$loop + addl tmp,res,res +L$14 zdep op1,28,29,tmp ; 8x + sub tmp,op1,tmp ; 7x + b L$loop + sh1addl tmp,res,res +L$15 zdep op1,27,28,tmp ; 16x + sub tmp,op1,tmp ; 15x + b L$loop + addl tmp,res,res +L$16 zdep op1,27,28,tmp ; 16x + b L$loop + addl tmp,res,res + nop +L$17 zdep op1,27,28,tmp ; 16x + addl tmp,op1,tmp ; 17x + b L$loop + addl tmp,res,res +L$18 sh3addl op1,op1,tmp ; 9x + b L$loop + sh1addl tmp,res,res + nop +L$19 sh3addl op1,op1,tmp ; 9x + sh1addl tmp,op1,tmp ; 19x + b L$loop + addl tmp,res,res +L$20 sh2addl op1,op1,tmp ; 5x + b L$loop + sh2addl tmp,res,res + nop +L$21 sh2addl op1,op1,tmp ; 5x + sh2addl tmp,op1,tmp ; 21x + b L$loop + addl tmp,res,res +L$22 sh2addl op1,op1,tmp ; 5x + sh1addl tmp,op1,tmp ; 11x + b L$loop + sh1addl tmp,res,res +L$23 sh1addl op1,op1,tmp ; 3x + sh3addl tmp,res,res ; += 8x3 + b L$loop + sub res,op1,res ; -= x +L$24 sh1addl op1,op1,tmp ; 3x + b L$loop + sh3addl tmp,res,res ; += 8x3 + nop +L$25 sh2addl op1,op1,tmp ; 5x + sh2addl tmp,tmp,tmp ; 25x + b L$loop + addl tmp,res,res +L$26 sh1addl op1,op1,tmp ; 3x + sh2addl tmp,op1,tmp ; 13x + b L$loop + sh1addl tmp,res,res ; += 2x13 +L$27 sh1addl op1,op1,tmp ; 3x + sh3addl tmp,tmp,tmp ; 27x + b L$loop + addl tmp,res,res +L$28 zdep op1,28,29,tmp ; 8x + sub tmp,op1,tmp ; 7x + b L$loop + sh2addl tmp,res,res ; += 4x7 +L$29 sh1addl op1,op1,tmp ; 3x + sub res,tmp,res ; -= 3x + b L$foo + zdep op1,26,27,tmp ; 32x +L$30 zdep op1,27,28,tmp ; 16x + sub tmp,op1,tmp ; 15x + b L$loop + sh1addl tmp,res,res ; += 2x15 +L$31 zdep op1,26,27,tmp ; 32x + sub tmp,op1,tmp ; 31x +L$foo b L$loop + addl tmp,res,res + .exit + .procend +#endif + + +#ifdef L_divU +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define quotient %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU +$$divU + .proc + .callinfo frame=0,no_calls + .entry + comb,< divisor,0,L$largedivisor + sub %r0,divisor,%r1 ; clear cy as side-effect + ds %r0,%r1,%r0 + addc dividend,dividend,dividend + ds %r0,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,quotient + ds %r1,divisor,%r1 + bv 0(ret) + addc quotient,quotient,quotient +L$largedivisor + comclr,<< dividend,divisor,quotient + ldi 1,quotient + bv,n 0(ret) + .exit + .procend +#endif + + +#ifdef L_remU +#define dividend %r26 +#define divisor %r25 +#define quotient %r29 +#define tmp %r1 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$remU +$$remU + .proc + .callinfo frame=0,no_calls + .entry + comb,< divisor,0,L$largedivisor + sub %r0,divisor,%r1 ; clear cy as side-effect + ds %r0,%r1,%r0 + addc dividend,dividend,dividend + ds %r0,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,quotient + ds %r1,divisor,%r1 + comclr,>= %r1,%r0,%r0 + addl %r1,divisor,%r1 + bv 0(ret) + copy %r1,quotient +L$largedivisor + sub,>>= dividend,divisor,quotient + copy dividend,quotient + bv,n 0(ret) + .exit + .procend +#endif + + +#ifdef L_divI +#define dividend %r26 +#define divisor %r25 +#define quotient %r29 +#define tmp %r1 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI +$$divI + .proc + .callinfo frame=0,no_calls + .entry + xor dividend,divisor,quotient ; result sign + comclr,>= divisor,%r0,%r0 ; get absolute values + sub %r0,divisor,divisor + comclr,>= dividend,%r0,%r0 + sub %r0,dividend,dividend + + comb,< divisor,0,L$largedivisor + sub %r0,divisor,%r1 ; clear cy as side-effect + ds %r0,%r1,%r0 + addc dividend,dividend,dividend + ds %r0,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + comclr,>= %r1,%r0,%r0 + addl %r1,divisor,%r1 + comclr,>= quotient,%r0,%r0 ; skip of no need to negate + sub %r0,dividend,dividend + bv 0(ret) + copy dividend,quotient +L$largedivisor + comclr,<< dividend,divisor,quotient + ldi 1,quotient + bv,n 0(ret) + .exit + .procend +#endif + + +#ifdef L_remI +#define dividend %r26 +#define divisor %r25 +#define quotient %r29 +#define tmp %r1 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$remI +$$remI + .proc + .callinfo frame=0,no_calls + .entry + xor dividend,%r0,quotient ; result sign + comclr,>= divisor,%r0,%r0 ; get absolute values + sub %r0,divisor,divisor + comclr,>= dividend,%r0,%r0 + sub %r0,dividend,dividend + + comb,< divisor,0,L$largedivisor + sub %r0,divisor,%r1 ; clear cy as side-effect + ds %r0,%r1,%r0 + addc dividend,dividend,dividend + ds %r0,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + ds %r1,divisor,%r1 + addc dividend,dividend,dividend + comclr,>= %r1,%r0,%r0 + addl %r1,divisor,%r1 + comclr,>= quotient,%r0,%r0 ; skip of no need to negate + sub %r0,%r1,%r1 + bv 0(ret) + copy %r1,quotient +L$largedivisor + sub,>>= dividend,divisor,quotient + copy dividend,quotient + bv,n 0(ret) + .exit + .procend +#endif + + +#if defined (L_divU_3) && !defined (SMALL_LIB) +#undef L_divU_3 +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define result %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_3 +$$divU_3 + .proc + .callinfo frame=0,no_calls + .entry + sh2add %r26,%r26,%r29 ; r29 = lo(101 x r) + shd %r0,%r26,30,%r1 ; r1 = hi(100 x r) + addc %r1,%r0,%r1 ; r1 = hi(101 x r) +; r in r1,,r29 + zdep %r29,27,28,%r25 ; r25 = lo(10000 x r) + add %r25,%r29,%r25 ; r25 = lo(10001 x r) + shd %r1,%r29,28,%r29 ; r29 = hi(10000 x r) + addc %r29,%r1,%r29 ; r29 = hi(10001 x r) +; r in r29,,r25 + zdep %r25,23,24,%r1 ; r1 = lo(100000000 x r) + add %r1,%r25,%r1 ; r1 = lo(100000001 x r) + shd %r29,%r25,24,%r25 ; r25 = hi(100000000 x r) + addc %r25,%r29,%r25 ; r25 = hi(100000001 x r) +; r in r25,,r1 + zdep %r1,15,16,%r29 + add %r29,%r1,%r29 + shd %r25,%r1,16,%r1 + addc %r1,%r25,%r1 +; r in r1,,r29 + sh1add %r29,%r26,%r0 ; r0 = lo(10 x r) + dividend + shd %r1,%r29,31,%r29 ; r29 = hi(10 x r) + addc %r29,%r0,%r29 + bv 0(ret) + extru %r29,30,31,result + .exit + .procend +#endif + + +#if defined (L_divU_5) && !defined (SMALL_LIB) +#undef L_divU_5 +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define result %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_5 +$$divU_5 + .proc + .callinfo frame=0,no_calls + .entry + sh1add %r26,%r26,%r29 ; r29 = lo(11 x r) + shd %r0,%r26,31,%r1 ; r1 = hi(10 x r) + addc %r1,%r0,%r1 ; r1 = hi(11 x r) +; r in r1,,r29 + zdep %r29,27,28,%r25 ; r25 = lo(10000 x r) + add %r25,%r29,%r25 ; r25 = lo(10001 x r) + shd %r1,%r29,28,%r29 ; r29 = hi(10000 x r) + addc %r29,%r1,%r29 ; r29 = hi(10001 x r) +; r in r29,,r25 + zdep %r25,23,24,%r1 ; r1 = lo(100000000 x r) + add %r1,%r25,%r1 ; r1 = lo(100000001 x r) + shd %r29,%r25,24,%r25 ; r25 = hi(100000000 x r) + addc %r25,%r29,%r25 ; r25 = hi(100000001 x r) +; r in r25,,r1 + zdep %r1,15,16,%r29 + add %r29,%r1,%r29 + shd %r25,%r1,16,%r1 + addc %r1,%r25,%r1 +; r in r1,,r29 + sh2add %r29,%r26,%r0 ; r0 = lo(1000 x r) + dividend + shd %r1,%r29,30,%r29 ; r29 = hi(1000 x r) + addc %r29,%r0,%r29 + bv 0(ret) + extru %r29,29,30,result + .exit + .procend +#endif + + +#if defined (L_divU_6) && !defined (SMALL_LIB) +#undef L_divU_6 +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define result %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_6 +$$divU_6 + .proc + .callinfo frame=0,no_calls + .entry + sh2add %r26,%r26,%r29 ; r29 = lo(101 x r) + shd %r0,%r26,30,%r1 ; r1 = hi(100 x r) + addc %r1,%r0,%r1 ; r1 = hi(101 x r) +; r in r1,,r29 + zdep %r29,27,28,%r25 ; r25 = lo(10000 x r) + add %r25,%r29,%r25 ; r25 = lo(10001 x r) + shd %r1,%r29,28,%r29 ; r29 = hi(10000 x r) + addc %r29,%r1,%r29 ; r29 = hi(10001 x r) +; r in r29,,r25 + zdep %r25,23,24,%r1 ; r1 = lo(100000000 x r) + add %r1,%r25,%r1 ; r1 = lo(100000001 x r) + shd %r29,%r25,24,%r25 ; r25 = hi(100000000 x r) + addc %r25,%r29,%r25 ; r25 = hi(100000001 x r) +; r in r25,,r1 + zdep %r1,15,16,%r29 + add %r29,%r1,%r29 + shd %r25,%r1,16,%r1 + addc %r1,%r25,%r1 +; r in r1,,r29 + sh1add %r29,%r26,%r0 ; r0 = lo(10 x r) + dividend + shd %r1,%r29,31,%r29 ; r29 = hi(10 x r) + addc %r29,%r0,%r29 + bv 0(ret) + extru %r29,29,30,result + .exit + .procend +#endif + + +#if defined (L_divU_9) && !defined (SMALL_LIB) +#undef L_divU_9 +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define result %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_9 +$$divU_9 + .proc + .callinfo frame=0,no_calls + .entry + zdep %r26,28,29,%r29 + sub %r29,%r26,%r29 + shd 0,%r26,29,%r1 + subb %r1,0,%r1 /* 111 */ + + zdep %r29,25,26,%r25 + add %r25,%r29,%r25 + shd %r1,%r29,26,%r29 + addc %r29,%r1,%r29 /* 111000111 */ + + sh3add %r25,%r26,%r1 + shd %r29,%r25,29,%r25 + addc %r25,0,%r25 /* 111000111001 */ + + zdep %r1,16,17,%r29 + sub %r29,%r1,%r29 + shd %r25,%r1,17,%r1 + subb %r1,%r25,%r1 /* 111000111000111000111000111 */ + + sh3add %r29,%r26,%r0 + shd %r1,%r29,29,%r29 + addc %r29,0,%r29 /* 111000111000111000111000111001 */ + bv 0(ret) + extru %r29,30,31,result + .exit + .procend +#endif + + +#if defined (L_divU_10) && !defined (SMALL_LIB) +#undef L_divU_10 +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define result %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_10 +$$divU_10 + .proc + .callinfo frame=0,no_calls + .entry + sh1add %r26,%r26,%r29 ; r29 = lo(11 x r) + shd %r0,%r26,31,%r1 ; r1 = hi(10 x r) + addc %r1,%r0,%r1 ; r1 = hi(11 x r) +; r in r1,,r29 + zdep %r29,27,28,%r25 ; r25 = lo(10000 x r) + add %r25,%r29,%r25 ; r25 = lo(10001 x r) + shd %r1,%r29,28,%r29 ; r29 = hi(10000 x r) + addc %r29,%r1,%r29 ; r29 = hi(10001 x r) +; r in r29,,r25 + zdep %r25,23,24,%r1 ; r1 = lo(100000000 x r) + add %r1,%r25,%r1 ; r1 = lo(100000001 x r) + shd %r29,%r25,24,%r25 ; r25 = hi(100000000 x r) + addc %r25,%r29,%r25 ; r25 = hi(100000001 x r) +; r in r25,,r1 + zdep %r1,15,16,%r29 + add %r29,%r1,%r29 + shd %r25,%r1,16,%r1 + addc %r1,%r25,%r1 +; r in r1,,r29 + sh2add %r29,%r26,%r0 ; r0 = lo(1000 x r) + dividend + shd %r1,%r29,30,%r29 ; r29 = hi(1000 x r) + addc %r29,%r0,%r29 + bv 0(ret) + extru %r29,28,29,result + .exit + .procend +#endif + + +#if defined (L_divU_12) && !defined (SMALL_LIB) +#undef L_divU_12 +#define dividend %r26 +#define divisor %r25 +#define tmp %r1 +#define result %r29 +#define ret %r31 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_12 +$$divU_12 + .proc + .callinfo frame=0,no_calls + .entry + sh2add %r26,%r26,%r29 ; r29 = lo(101 x r) + shd %r0,%r26,30,%r1 ; r1 = hi(100 x r) + addc %r1,%r0,%r1 ; r1 = hi(101 x r) +; r in r1,,r29 + zdep %r29,27,28,%r25 ; r25 = lo(10000 x r) + add %r25,%r29,%r25 ; r25 = lo(10001 x r) + shd %r1,%r29,28,%r29 ; r29 = hi(10000 x r) + addc %r29,%r1,%r29 ; r29 = hi(10001 x r) +; r in r29,,r25 + zdep %r25,23,24,%r1 ; r1 = lo(100000000 x r) + add %r1,%r25,%r1 ; r1 = lo(100000001 x r) + shd %r29,%r25,24,%r25 ; r25 = hi(100000000 x r) + addc %r25,%r29,%r25 ; r25 = hi(100000001 x r) +; r in r25,,r1 + zdep %r1,15,16,%r29 + add %r29,%r1,%r29 + shd %r25,%r1,16,%r1 + addc %r1,%r25,%r1 +; r in r1,,r29 + sh1add %r29,%r26,%r0 ; r0 = lo(10 x r) + dividend + shd %r1,%r29,31,%r29 ; r29 = hi(10 x r) + addc %r29,%r0,%r29 + bv 0(ret) + extru %r29,28,29,result + .exit + .procend +#endif + + +#ifdef L_divU_3 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_3 +$$divU_3 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 3,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_5 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_5 +$$divU_5 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 5,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_6 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_6 +$$divU_6 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 6,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_7 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_7 +$$divU_7 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 7,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_9 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_9 +$$divU_9 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 9,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_10 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_10 +$$divU_10 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 10,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_12 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_12 +$$divU_12 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 12,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_14 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_14 +$$divU_14 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 14,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divU_15 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divU_15 +$$divU_15 + .proc + .callinfo frame=0,no_calls + .entry + b $$divU + ldi 15,%r25 + .exit + .procend + .import $$divU,MILLICODE +#endif + +#ifdef L_divI_3 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_3 +$$divI_3 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 3,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_5 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_5 +$$divI_5 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 5,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_6 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_6 +$$divI_6 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 6,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_7 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_7 +$$divI_7 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 7,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_9 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_9 +$$divI_9 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 9,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_10 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_10 +$$divI_10 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 10,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_12 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_12 +$$divI_12 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 12,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_14 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_14 +$$divI_14 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 14,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif + +#ifdef L_divI_15 + .space $TEXT$ + .subspa $MILLICODE$,quad=0,align=8,access=0x2c,sort=8 + .align 4 + .export $$divI_15 +$$divI_15 + .proc + .callinfo frame=0,no_calls + .entry + b $$divI + ldi 15,%r25 + .exit + .procend + .import $$divI,MILLICODE +#endif diff --git a/gnu/usr.bin/gcc/config/pa/pa-gas.h b/gnu/usr.bin/gcc/config/pa/pa-gas.h new file mode 100644 index 00000000000..d7da9e733b1 --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/pa-gas.h @@ -0,0 +1,21 @@ +/* Definitions of target machine for GNU compiler, for HP-UX using GNU as. + Copyright (C) 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT 0x88 /* TARGET_GAS + TARGET_JUMP_IN_DELAY */ diff --git a/gnu/usr.bin/gcc/config/pa/pa-hpux10.h b/gnu/usr.bin/gcc/config/pa/pa-hpux10.h new file mode 100644 index 00000000000..ab7cee39389 --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/pa-hpux10.h @@ -0,0 +1,71 @@ +/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Contributed by Tim Moore (moore@defmacro.cs.utah.edu) + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* We can debug dynamically linked executables on hpux9; we also want + dereferencing of a NULL pointer to cause a SEGV. */ +#undef LINK_SPEC +#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & 1) +#define LINK_SPEC \ + "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}" +#else +#define LINK_SPEC \ + "-z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}" +#endif + +/* The hpux10 assembler requires a .LEVEL pseudo-op at the start of + the assembly file. */ +#undef ASM_FILE_START +#define ASM_FILE_START(FILE) \ +do { \ + if (TARGET_SNAKE) \ + fputs("\t.LEVEL 1.1\n", FILE); \ + else \ + fputs("\t.LEVEL 1.0\n", FILE); \ + fputs ("\t.SPACE $PRIVATE$\n\ +\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31\n\ +\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82\n\ +\t.SPACE $TEXT$\n\ +\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44\n\ +\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n\ +\t.IMPORT $global$,DATA\n\ +\t.IMPORT $$dyncall,MILLICODE\n", FILE);\ + if (profile_flag)\ + fprintf (FILE, "\t.IMPORT _mcount, CODE\n");\ + if (write_symbols != NO_DEBUG) \ + output_file_directive ((FILE), main_input_filename); \ + } while (0) + +/* Under hpux10, the normal location of the `ld' and `as' programs is the + /usr/ccs/bin directory. */ + +#ifndef CROSS_COMPILE +#undef MD_EXEC_PREFIX +#define MD_EXEC_PREFIX "/usr/ccs/bin/" +#endif + +/* Under hpux10, the normal location of the various *crt*.o files is the + /usr/ccs/lib directory. */ + +#ifndef CROSS_COMPILE +#undef MD_STARTFILE_PREFIX +#define MD_STARTFILE_PREFIX "/usr/ccs/lib/" +#endif + diff --git a/gnu/usr.bin/gcc/config/pa/pa-pro-end.h b/gnu/usr.bin/gcc/config/pa/pa-pro-end.h new file mode 100644 index 00000000000..8b1de1c5e5f --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/pa-pro-end.h @@ -0,0 +1,41 @@ +/* Definitions of target machine for GNU compiler, for PRO. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Make GCC agree with types.h. */ +#undef SIZE_TYPE +#undef PTRDIFF_TYPE + +#define SIZE_TYPE "unsigned int" +#define PTRDIFF_TYPE "int" + +/* Like the default, except no -lg. */ +#undef LIB_SPEC +#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu(hppa) -Amachine(hppa)" + +/* hpux8 and later have C++ compatible include files, so do not + pretend they are `extern "C"'. */ +#define NO_IMPLICIT_EXTERN_C + +/* We don't want a crt0.o to get linked in automatically, we want the + linker script to pull it in. + */ +#define STARTFILE_SPEC "" diff --git a/gnu/usr.bin/gcc/config/pa/pa-pro.h b/gnu/usr.bin/gcc/config/pa/pa-pro.h new file mode 100644 index 00000000000..f64ac2dc54c --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/pa-pro.h @@ -0,0 +1,78 @@ +/* Definitions of target machine for GNU compiler, for PRO. + Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Global constructor and destructor support. */ +/* Define the pseudo-ops used to switch to the .ctors and .dtors sections. + + Note that we want to give these sections the SHF_WRITE attribute + because these sections will actually contain data (i.e. tables of + addresses of functions in the current root executable or shared library + file) and, in the case of a shared library, the relocatable addresses + will have to be properly resolved/relocated (and then written into) by + the dynamic linker when it actually attaches the given shared library + to the executing process. */ + +#define CTORS_SECTION_ASM_OP "\t.section\t\".ctors\",#alloc,#write" +#define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#write" + +#define CTORS_SECTION_FUNCTION \ +void \ +ctors_section () \ +{ \ + if (in_section != in_ctors) \ + { \ + fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ + in_section = in_ctors; \ + } \ +} + +#define DTORS_SECTION_FUNCTION \ +void \ +dtors_section () \ +{ \ + if (in_section != in_dtors) \ + { \ + fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ + in_section = in_dtors; \ + } \ +} + + +/* A C statement (sans semicolon) to output an element in the table of + global destructors. */ +#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ + do { \ + dtors_section (); \ + fputs ("\t.word\t ", FILE); \ + assemble_name (FILE, NAME); \ + fputs ("\n", FILE); \ + } while (0) + +/* A C statement (sans semicolon) to output an element in the table of + global constructors. */ +#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ + do { \ + ctors_section (); \ + fputs ("\t.word\t ", FILE); \ + assemble_name (FILE, NAME); \ + fputs ("\n", FILE); \ + } while (0) + +/* JUMP_IN_DELAY + PORTABLE_RUNTIME + GAS + NO_SPACE_REGS + SOFT_FLOAT */ +#define TARGET_DEFAULT (4 + 8 + 64 + 128 + 256) diff --git a/gnu/usr.bin/gcc/config/pa/rtems.h b/gnu/usr.bin/gcc/config/pa/rtems.h new file mode 100644 index 00000000000..eebfd4f5cc1 --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/rtems.h @@ -0,0 +1,26 @@ +/* Definitions of target machine for GNU compiler, for PRO. + Copyright (C) 1997 Free Software Foundation, Inc. + Contributed by Joel Sherrill (joel@OARcorp.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Specify predefined symbols in preprocessor. */ + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu(hppa) -Amachine(hppa) \ + -Drtems -D__rtems__ -Asystem(rtems)" diff --git a/gnu/usr.bin/gcc/config/pa/t-pro b/gnu/usr.bin/gcc/config/pa/t-pro new file mode 100644 index 00000000000..f40b2e4e4d7 --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/t-pro @@ -0,0 +1,38 @@ +LIBGCC1=libgcc1.null +CROSS_LIBGCC1 = libgcc1.null +LIB1ASMSRC = +LIB1ASMFUNCS = + +LIBGCC1_TEST = + +ADA_CFLAGS=-mdisable-indexing + +LIB2FUNCS_EXTRA=fp-bit.c dp-bit.c lib2funcs.asm ee.asm ee_fp.asm + +dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +lib2funcs.asm: $(srcdir)/config/pa/lib2funcs.asm + rm -f lib2funcs.asm + cp $(srcdir)/config/pa/lib2funcs.asm . + +ee.asm: $(srcdir)/config/pa/ee.asm + rm -f ee.asm + cp $(srcdir)/config/pa/ee.asm . + +ee_fp.asm: $(srcdir)/config/pa/ee_fp.asm + rm -f ee_fp.asm + cp $(srcdir)/config/pa/ee_fp.asm . + +# Build the libraries for both speed and space optimizations + +MULTILIB_OPTIONS=mspace +MULTILIB_DIRNAMES=space +MULTILIB_MATCHES= + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib diff --git a/gnu/usr.bin/gcc/config/pa/xm-papro.h b/gnu/usr.bin/gcc/config/pa/xm-papro.h new file mode 100644 index 00000000000..d36e2015ce7 --- /dev/null +++ b/gnu/usr.bin/gcc/config/pa/xm-papro.h @@ -0,0 +1,58 @@ +/* Configuration for GNU C-compiler for PA-RISC. + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + Contributed by Michael Tiemann (tiemann@cygnus.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +extern int errno; + +/* #defines that need visibility everywhere. */ +#define FALSE 0 +#define TRUE 1 + +/* This describes the machine the compiler is hosted on. */ +#define HOST_BITS_PER_CHAR 8 +#define HOST_BITS_PER_SHORT 16 +#define HOST_BITS_PER_INT 32 +#define HOST_BITS_PER_LONG 32 +#define HOST_BITS_PER_LONGLONG 64 + +/* Doubles are stored in memory with the high order word first. This + matters when cross-compiling. */ +#define HOST_WORDS_BIG_ENDIAN 1 + +/* Place any machine-dependent include files here, in case we + are bootstrapping. */ + +/* target machine dependencies. + tm.h is a symbolic link to the actual target specific file. */ +#include "tm.h" + +/* Arguments to use with `exit'. */ +#define SUCCESS_EXIT_CODE 0 +#define FATAL_EXIT_CODE 33 + +/* Don't try to use sys_siglist. */ +#define NO_SYS_SIGLIST + +/* HP's compiler has problems with enum bitfields. */ +#define ONLY_INT_FIELDS + +/* Always claim to use C alloca; this prevents losing if building with + gcc -fno-builtin ... */ +#define USE_C_ALLOCA |