diff options
author | Jeffrey A Law <law@cygnus.com> | 2000-02-29 20:29:14 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2000-02-29 13:29:14 -0700 |
commit | a7a1d2701f5d7e496d53fa19708219d192df91ba (patch) | |
tree | e9907e050b3bf128cb04d3594c3578261af6a48c /gcc/config/pa | |
parent | c4c81601892fb2066cedcae91525dec7837f5132 (diff) | |
download | gcc-a7a1d2701f5d7e496d53fa19708219d192df91ba.zip gcc-a7a1d2701f5d7e496d53fa19708219d192df91ba.tar.gz gcc-a7a1d2701f5d7e496d53fa19708219d192df91ba.tar.bz2 |
t-pa: Use quadlib.c instead of quadlib.asm.
* pa/t-pa: Use quadlib.c instead of quadlib.asm.
* pa/quadlib.asm: Remove.
* pa/quadlib.c: New file.
From-SVN: r32265
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/quadlib.asm | 359 | ||||
-rw-r--r-- | gcc/config/pa/quadlib.c | 85 | ||||
-rw-r--r-- | gcc/config/pa/t-pa | 8 |
3 files changed, 89 insertions, 363 deletions
diff --git a/gcc/config/pa/quadlib.asm b/gcc/config/pa/quadlib.asm deleted file mode 100644 index eb65362..0000000 --- a/gcc/config/pa/quadlib.asm +++ /dev/null @@ -1,359 +0,0 @@ -; Subroutines for long double support on the HPPA -; Copyright (C) 1999 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. - -; 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.) - -; 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 $TEXT$ - .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY - .compiler "quadlib.asm GNU_PA-RISC_Assembler 2.9.4" - .IMPORT _U_Qfcmp,CODE - .IMPORT _U_Qfsub,CODE - - .align 4 - .NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY - ; - ; Check two long doubles for equality - ; - .EXPORT _U_Qfeq,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qfeq - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Load the additional argument and call the comparison routine. - ; - bl _U_Qfcmp,%r2 - ldi 4,%r24 - - ; - ; The return from _U_Qfcmp is the masked C bit from the FP - ; status register. Convert that to a 0 or 1. - ; - comiclr,= 0,%r28,%r28 - ldi 1,%r28 - - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30), %r30 - - .EXIT - .PROCEND - - ; - ; Check two long doubles for inequality - ; - .EXPORT _U_Qfne,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qfne - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Load the additional argument and call the comparison routine. - ; - bl _U_Qfcmp,%r2 - ldi 4,%r24 - - ; - ; The return from _U_Qfcmp is the masked C bit from the FP - ; status register. Convert that to a 0 or 1. - ; - comiclr,<> 0,%r28,%r28 - ldi 1,%r28 - - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30),%r30 - .EXIT - .PROCEND - - ; - ; Check if opnd1 > opnd0 - ; - .EXPORT _U_Qfgt,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qfgt - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Load the additional argument and call the comparison routine. - ; - bl _U_Qfcmp,%r2 - ldi 17,%r24 - - ; - ; The return from _U_Qfcmp is the masked C bit from the FP - ; status register. Convert that to a 0 or 1. - ; - comiclr,= 0,%r28,%r28 - ldi 1,%r28 - - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30), %r30 - - .EXIT - .PROCEND - - ; - ; Check if opnd1 >= opnd0 - ; - .EXPORT _U_Qfge,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qfge - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Load the additional argument and call the comparison routine. - ; - bl _U_Qfcmp,%r2 - ldi 21,%r24 - - ; - ; The return from _U_Qfcmp is the masked C bit from the FP - ; status register. Convert that to a 0 or 1. - ; - comiclr,= 0,%r28,%r28 - ldi 1,%r28 - - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30), %r30 - - .EXIT - .PROCEND - - ; - ; Check if opnd1 < opnd0 - ; - .EXPORT _U_Qflt,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qflt - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Load the additional argument and call the comparison routine. - ; - bl _U_Qfcmp,%r2 - ldi 9,%r24 - - ; - ; The return from _U_Qfcmp is the masked C bit from the FP - ; status register. Convert that to a 0 or 1. - ; - comiclr,= 0,%r28,%r28 - ldi 1,%r28 - - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30), %r30 - - .EXIT - .PROCEND - - ; - ; Check if opnd1 <= opnd0 - ; - .EXPORT _U_Qfle,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qfle - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Load the additional argument and call the comparison routine. - ; - bl _U_Qfcmp,%r2 - ldi 13,%r24 - - ; - ; The return from _U_Qfcmp is the masked C bit from the FP - ; status register. Convert that to a 0 or 1. - ; - comiclr,= 0,%r28,%r28 - ldi 1,%r28 - - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30), %r30 - - .EXIT - .PROCEND - - ; - ; Negate opnd0 and store in ret0 - ; - .EXPORT _U_Qfneg,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR -_U_Qfneg - .PROC - .CALLINFO FRAME=128,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 128(%r30),%r30 - - ; - ; copy the value to be negated to the frame. - ; - ldw 0(0,%r26), %r25 - ldw 4(0,%r26), %r24 - ldw 8(0,%r26), %r23 - ldw 12(0,%r26),%r1 - stw %r25, -100(0,%r30) - stw %r24, -96(0,%r30) - stw %r23, -92(0,%r30) - stw %r1, -88(0,%r30) - ldo -100(%r30), %r25 - - ; - ; ret0 contains a pointer to the location for the return - ; value. Initialize it to zero and pass it as arg0 to - ; _U_Qfsub. - ; - copy %r28,%r26 - stw %r0,0(0,%r26) - stw %r0,4(0,%r26) - stw %r0,8(0,%r26) - bl _U_Qfsub,%r2 - stw %r0,12(0,%r26) - - ; - ; Return - ; - ldw -148(0,%r30),%r2 - bv 0(%r2) - ldo -128(%r30), %r30 - - .EXIT - .PROCEND - - ; - ; Compare opnd0 and opnd1. If opnd0 == opnd1, return 0. - ; If opnd0 is greater than opnd1, return 1. - ; Otherwise, return -1. - ; - .EXPORT _U_Qfcomp,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR -_U_Qfcomp - .PROC - .CALLINFO FRAME=64,CALLS,SAVE_RP - .ENTRY - ; - ; Build the frame - ; - stw %r2,-20(0,%r30) - ldo 64(%r30),%r30 - - ; - ; Save arg0 and arg1. - ; - stw %r26, -60(0,%r30) - stw %r25, -56(0,%r30) - ; - ; Check for equality - ; - bl _U_Qfcmp,%r2 - ldi 4, %r24 - - comib,<> 0,%r28,done - copy %r0, %r1 - - ; - ; Reset the parms and test for opnd0 > opnd1. - ; - ldw -60(0,%r30),%r26 - ldw -56(0,%r30),%r25 - bl _U_Qfcmp,%r2 - ldi 22,%r24 - - ldi 1,%r1 - comiclr,<> 0,%r28,0 - ldi -1,%r1 - -done - copy %r1,%r28 - ; - ; Return - ; - ldw -84(0,%r30),%r2 - bv 0(%r2) - ldo -64(%r30), %r30 - - .EXIT - .PROCEND diff --git a/gcc/config/pa/quadlib.c b/gcc/config/pa/quadlib.c new file mode 100644 index 0000000..826c809 --- /dev/null +++ b/gcc/config/pa/quadlib.c @@ -0,0 +1,85 @@ +/* Subroutines for long double support. + Copyright (C) 2000 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. */ + +int _U_Qfcmp (long double a, long double b, int); +long _U_Qfcnvfxt_quad_to_sgl (long double); + +int +_U_Qfeq (long double a, long double b) +{ + return (_U_Qfcmp (a, b, 4) != 0); +} + +int +_U_Qfne (long double a, long double b) +{ + return (_U_Qfcmp (a, b, 4) == 0); +} + +int +_U_Qfgt (long double a, long double b) +{ + return (_U_Qfcmp (a, b, 17) != 0); +} + +int +_U_Qfge (long double a, long double b) +{ + return (_U_Qfcmp (a, b, 21) != 0); +} + +int +_U_Qflt (long double a, long double b) +{ + return (_U_Qfcmp (a, b, 9) != 0); +} + +int +_U_Qfle (long double a, long double b) +{ + return (_U_Qfcmp (a, b, 13) != 0); +} + +int +_U_Qfcomp (long double a, long double b) +{ + if (_U_Qfcmp (a, b, 4) == 0) + return 0; + + return (_U_Qfcmp (a, b, 22) != 0 ? 1 : -1); +} + + +long double +_U_Qfneg (long double a) +{ + return (0.0L - a); +} + +#ifdef __LP64__ +/* This routine is only necessary for the PA64 port; for reasons unknown + _U_Qfcnvfxt_quad_to_sgl returns the integer in the high 32bits of the + return value. Ugh. */ +int +__U_Qfcnvfxt_quad_to_sgl (long double a) +{ + return _U_Qfcnvfxt_quad_to_sgl (a) >> 32; +} +#endif diff --git a/gcc/config/pa/t-pa b/gcc/config/pa/t-pa index b772486..5d2a72c 100644 --- a/gcc/config/pa/t-pa +++ b/gcc/config/pa/t-pa @@ -1,14 +1,14 @@ LIBGCC1=libgcc1.null CROSS_LIBGCC1=libgcc1.null ADA_CFLAGS=-mdisable-indexing -LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.asm +LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.c lib2funcs.asm: $(srcdir)/config/pa/lib2funcs.asm rm -f lib2funcs.asm cp $(srcdir)/config/pa/lib2funcs.asm . -quadlib.asm: $(srcdir)/config/pa/quadlib.asm - rm -f quadlib.asm - cp $(srcdir)/config/pa/quadlib.asm . +quadlib.c: $(srcdir)/config/pa/quadlib.c + rm -f quadlib.c + cp $(srcdir)/config/pa/quadlib.c . TARGET_LIBGCC2_CFLAGS = -fPIC |