mirror of
https://github.com/pret/agbcc.git
synced 2026-07-15 15:41:22 -05:00
build libgcc
This commit is contained in:
parent
e6fd5f9b5b
commit
0dfd357a51
19
Makefile
Normal file
19
Makefile
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
.PHONY: all clean
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
AGBCC := agbcc.exe
|
||||
else
|
||||
AGBCC := agbcc
|
||||
endif
|
||||
|
||||
all: gcc/$(AGBCC) libgcc/libgcc.a
|
||||
|
||||
gcc/$(AGBCC):
|
||||
make -C gcc
|
||||
|
||||
libgcc/libgcc.a: | gcc/$(AGBCC)
|
||||
make -C libgcc
|
||||
|
||||
clean:
|
||||
make -C gcc clean
|
||||
make -C libgcc clean
|
||||
79
libgcc/Makefile
Normal file
79
libgcc/Makefile
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
CC1 = ../gcc/agbcc
|
||||
CPP = cpp
|
||||
AS = $(DEVKITARM)/bin/arm-none-eabi-as
|
||||
AR = ar
|
||||
|
||||
libgcc.a: libgcc1.a libgcc2.a fp-bit.o dp-bit.o
|
||||
$(AR) -x libgcc1.a
|
||||
$(AR) -x libgcc2.a
|
||||
$(AR) -rc libgcc.a *.o
|
||||
|
||||
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX
|
||||
|
||||
LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
|
||||
_lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
|
||||
_udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
|
||||
_fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi
|
||||
|
||||
libgcc1.a: lib1thumb.asm
|
||||
-rm -f tmplibgcc1.a
|
||||
# Actually build it in tmplibgcc1.a, then rename at end,
|
||||
# so that libgcc1.a itself remains nonexistent if compilation is aborted.
|
||||
set -e
|
||||
for name in $(LIB1ASMFUNCS); \
|
||||
do \
|
||||
echo $${name}; \
|
||||
$(CPP) -DL$${name} -x assembler-with-cpp -o $${name}.s lib1thumb.asm; \
|
||||
$(AS) -mcpu=arm7tdmi -o $${name}.o $${name}.s; \
|
||||
rm -f $${name}.s; \
|
||||
$(AR) -rc tmplibgcc1.a $${name}.o; \
|
||||
rm -f $${name}.o; \
|
||||
done
|
||||
mv tmplibgcc1.a libgcc1.a
|
||||
|
||||
libgcc2.a: libgcc2.c longlong.h
|
||||
-rm -f tmplibgcc2.a
|
||||
# Actually build it in tmplibgcc2.a, then rename at end,
|
||||
# so that libgcc2.a itself remains nonexistent if compilation is aborted.
|
||||
set -e
|
||||
for name in $(LIB2FUNCS); \
|
||||
do \
|
||||
echo $${name}; \
|
||||
$(CPP) -I ../ginclude -nostdinc -DL$${name} -o $${name}.i libgcc2.c; \
|
||||
$(CC1) -O2 $${name}.i; \
|
||||
rm -f $${name}.i; \
|
||||
$(AS) -mcpu=arm7tdmi -o $${name}.o $${name}.s; \
|
||||
rm -f $${name}.s; \
|
||||
$(AR) -rc tmplibgcc2.a $${name}.o; \
|
||||
rm -f $${name}.o; \
|
||||
done
|
||||
mv tmplibgcc2.a libgcc2.a
|
||||
|
||||
fp-bit.o: fp-bit.c
|
||||
$(CPP) -I ../ginclude -nostdinc -o fp-bit.i fp-bit.c
|
||||
$(CC1) -O2 fp-bit.i
|
||||
rm -f fp-bit.i
|
||||
$(AS) -mcpu=arm7tdmi -o fp-bit.o fp-bit.s
|
||||
rm -f fp-bit.s
|
||||
|
||||
dp-bit.o: dp-bit.c
|
||||
$(CPP) -I ../ginclude -nostdinc -o dp-bit.i dp-bit.c
|
||||
$(CC1) -O2 dp-bit.i
|
||||
rm -f dp-bit.i
|
||||
$(AS) -mcpu=arm7tdmi -o dp-bit.o dp-bit.s
|
||||
rm -f dp-bit.s
|
||||
|
||||
fp-bit.c: fp-bit-base.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
|
||||
cat fp-bit-base.c >> fp-bit.c
|
||||
|
||||
dp-bit.c: fp-bit-base.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
|
||||
echo '#define FLOAT_WORD_ORDER_MISMATCH' >> dp-bit.c
|
||||
cat fp-bit-base.c >> dp-bit.c
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *.s *.i
|
||||
|
|
@ -35,15 +35,8 @@ Boston, MA 02111-1307, USA. */
|
|||
|
||||
.code 16
|
||||
|
||||
#ifdef __elf__
|
||||
#define __PLT__ (PLT)
|
||||
#define TYPE(x) .type SYM(x),function
|
||||
#define SIZE(x) .size SYM(x), . - SYM(x)
|
||||
#else
|
||||
#define __PLT__
|
||||
#define TYPE(x)
|
||||
#define SIZE(x)
|
||||
#endif
|
||||
|
||||
#define RET mov pc, lr
|
||||
|
||||
|
|
@ -57,15 +50,11 @@ dividend .req r0
|
|||
divisor .req r1
|
||||
result .req r2
|
||||
curbit .req r3
|
||||
ip .req r12
|
||||
sp .req r13
|
||||
lr .req r14
|
||||
pc .req r15
|
||||
|
||||
.text
|
||||
.globl SYM (__udivsi3)
|
||||
TYPE (__udivsi3)
|
||||
.align 0
|
||||
.align 2, 0
|
||||
.thumb_func
|
||||
SYM (__udivsi3):
|
||||
cmp divisor, #0
|
||||
|
|
@ -151,7 +140,7 @@ Lgot_result:
|
|||
|
||||
Ldiv0:
|
||||
push { lr }
|
||||
bl SYM (__div0) __PLT__
|
||||
bl SYM (__div0)
|
||||
mov r0, #0 @ about as wrong as it could be
|
||||
pop { pc }
|
||||
|
||||
|
|
@ -165,15 +154,11 @@ dividend .req r0
|
|||
divisor .req r1
|
||||
overdone .req r2
|
||||
curbit .req r3
|
||||
ip .req r12
|
||||
sp .req r13
|
||||
lr .req r14
|
||||
pc .req r15
|
||||
|
||||
.text
|
||||
.globl SYM (__umodsi3)
|
||||
TYPE (__umodsi3)
|
||||
.align 0
|
||||
.align 2, 0
|
||||
.thumb_func
|
||||
SYM (__umodsi3):
|
||||
cmp divisor, #0
|
||||
|
|
@ -306,7 +291,7 @@ Over10:
|
|||
|
||||
Ldiv0:
|
||||
push { lr }
|
||||
bl SYM (__div0) __PLT__
|
||||
bl SYM (__div0)
|
||||
mov r0, #0 @ about as wrong as it could be
|
||||
pop { pc }
|
||||
|
||||
|
|
@ -320,15 +305,11 @@ dividend .req r0
|
|||
divisor .req r1
|
||||
result .req r2
|
||||
curbit .req r3
|
||||
ip .req r12
|
||||
sp .req r13
|
||||
lr .req r14
|
||||
pc .req r15
|
||||
|
||||
.text
|
||||
.globl SYM (__divsi3)
|
||||
TYPE (__divsi3)
|
||||
.align 0
|
||||
.align 2, 0
|
||||
.thumb_func
|
||||
SYM (__divsi3):
|
||||
cmp divisor, #0
|
||||
|
|
@ -429,7 +410,7 @@ Over7:
|
|||
|
||||
Ldiv0:
|
||||
push { lr }
|
||||
bl SYM (__div0) __PLT__
|
||||
bl SYM (__div0)
|
||||
mov r0, #0 @ about as wrong as it could be
|
||||
pop { pc }
|
||||
|
||||
|
|
@ -443,15 +424,11 @@ dividend .req r0
|
|||
divisor .req r1
|
||||
overdone .req r2
|
||||
curbit .req r3
|
||||
ip .req r12
|
||||
sp .req r13
|
||||
lr .req r14
|
||||
pc .req r15
|
||||
|
||||
.text
|
||||
.globl SYM (__modsi3)
|
||||
TYPE (__modsi3)
|
||||
.align 0
|
||||
.align 2, 0
|
||||
.thumb_func
|
||||
SYM (__modsi3):
|
||||
mov curbit, #1
|
||||
|
|
@ -593,7 +570,7 @@ Over10:
|
|||
|
||||
Ldiv0:
|
||||
push { lr }
|
||||
bl SYM (__div0) __PLT__
|
||||
bl SYM (__div0)
|
||||
mov r0, #0 @ about as wrong as it could be
|
||||
pop { pc }
|
||||
|
||||
|
|
@ -605,7 +582,7 @@ Ldiv0:
|
|||
|
||||
.globl SYM (__div0)
|
||||
TYPE (__div0)
|
||||
.align 0
|
||||
.align 2, 0
|
||||
.thumb_func
|
||||
SYM (__div0):
|
||||
RET
|
||||
|
|
@ -624,7 +601,7 @@ SYM (__div0):
|
|||
code here switches to the correct mode before executing the function. */
|
||||
|
||||
.text
|
||||
.align 0
|
||||
.align 2, 0
|
||||
|
||||
.macro call_via register
|
||||
.globl SYM (_call_via_\register)
|
||||
|
|
|
|||
596
libgcc/libgcc1.c
596
libgcc/libgcc1.c
|
|
@ -1,596 +0,0 @@
|
|||
/* Subroutines needed by GCC output code on some machines. */
|
||||
/* Compile this file with the Unix C compiler! */
|
||||
/* Copyright (C) 1987, 1988, 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This file 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.)
|
||||
|
||||
This file 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 this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with other files,
|
||||
some of which are compiled with GCC, to produce an executable,
|
||||
this library does not by itself cause the resulting executable
|
||||
to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/* Don't use `fancy_abort' here even if config.h says to use it. */
|
||||
#ifdef abort
|
||||
#undef abort
|
||||
#endif
|
||||
|
||||
/* On some machines, cc is really GCC. For these machines, we can't
|
||||
expect these functions to be properly compiled unless GCC open codes
|
||||
the operation (which is precisely when the function won't be used).
|
||||
So allow tm.h to specify ways of accomplishing the operations
|
||||
by defining the macros perform_*.
|
||||
|
||||
On a machine where cc is some other compiler, there is usually no
|
||||
reason to define perform_*. The other compiler normally has other ways
|
||||
of implementing all of these operations.
|
||||
|
||||
In some cases a certain machine may come with GCC installed as cc
|
||||
or may have some other compiler. Then it may make sense for tm.h
|
||||
to define perform_* only if __GNUC__ is defined. */
|
||||
|
||||
#ifndef perform_mulsi3
|
||||
#define perform_mulsi3(a, b) return a * b
|
||||
#endif
|
||||
|
||||
#ifndef perform_divsi3
|
||||
#define perform_divsi3(a, b) return a / b
|
||||
#endif
|
||||
|
||||
#ifndef perform_udivsi3
|
||||
#define perform_udivsi3(a, b) return a / b
|
||||
#endif
|
||||
|
||||
#ifndef perform_modsi3
|
||||
#define perform_modsi3(a, b) return a % b
|
||||
#endif
|
||||
|
||||
#ifndef perform_umodsi3
|
||||
#define perform_umodsi3(a, b) return a % b
|
||||
#endif
|
||||
|
||||
#ifndef perform_lshrsi3
|
||||
#define perform_lshrsi3(a, b) return a >> b
|
||||
#endif
|
||||
|
||||
#ifndef perform_ashrsi3
|
||||
#define perform_ashrsi3(a, b) return a >> b
|
||||
#endif
|
||||
|
||||
#ifndef perform_ashlsi3
|
||||
#define perform_ashlsi3(a, b) return a << b
|
||||
#endif
|
||||
|
||||
#ifndef perform_adddf3
|
||||
#define perform_adddf3(a, b) return a + b
|
||||
#endif
|
||||
|
||||
#ifndef perform_subdf3
|
||||
#define perform_subdf3(a, b) return a - b
|
||||
#endif
|
||||
|
||||
#ifndef perform_muldf3
|
||||
#define perform_muldf3(a, b) return a * b
|
||||
#endif
|
||||
|
||||
#ifndef perform_divdf3
|
||||
#define perform_divdf3(a, b) return a / b
|
||||
#endif
|
||||
|
||||
#ifndef perform_addsf3
|
||||
#define perform_addsf3(a, b) return INTIFY (a + b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_subsf3
|
||||
#define perform_subsf3(a, b) return INTIFY (a - b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_mulsf3
|
||||
#define perform_mulsf3(a, b) return INTIFY (a * b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_divsf3
|
||||
#define perform_divsf3(a, b) return INTIFY (a / b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_negdf2
|
||||
#define perform_negdf2(a) return -a
|
||||
#endif
|
||||
|
||||
#ifndef perform_negsf2
|
||||
#define perform_negsf2(a) return INTIFY (-a)
|
||||
#endif
|
||||
|
||||
#ifndef perform_fixdfsi
|
||||
#define perform_fixdfsi(a) return (nongcc_SI_type) a;
|
||||
#endif
|
||||
|
||||
#ifndef perform_fixsfsi
|
||||
#define perform_fixsfsi(a) return (nongcc_SI_type) a
|
||||
#endif
|
||||
|
||||
#ifndef perform_floatsidf
|
||||
#define perform_floatsidf(a) return (double) a
|
||||
#endif
|
||||
|
||||
#ifndef perform_floatsisf
|
||||
#define perform_floatsisf(a) return INTIFY ((float) a)
|
||||
#endif
|
||||
|
||||
#ifndef perform_extendsfdf2
|
||||
#define perform_extendsfdf2(a) return a
|
||||
#endif
|
||||
|
||||
#ifndef perform_truncdfsf2
|
||||
#define perform_truncdfsf2(a) return INTIFY (a)
|
||||
#endif
|
||||
|
||||
/* Note that eqdf2 returns a value for "true" that is == 0,
|
||||
nedf2 returns a value for "true" that is != 0,
|
||||
gtdf2 returns a value for "true" that is > 0,
|
||||
and so on. */
|
||||
|
||||
#ifndef perform_eqdf2
|
||||
#define perform_eqdf2(a, b) return !(a == b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_nedf2
|
||||
#define perform_nedf2(a, b) return a != b
|
||||
#endif
|
||||
|
||||
#ifndef perform_gtdf2
|
||||
#define perform_gtdf2(a, b) return a > b
|
||||
#endif
|
||||
|
||||
#ifndef perform_gedf2
|
||||
#define perform_gedf2(a, b) return (a >= b) - 1
|
||||
#endif
|
||||
|
||||
#ifndef perform_ltdf2
|
||||
#define perform_ltdf2(a, b) return -(a < b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_ledf2
|
||||
#define perform_ledf2(a, b) return 1 - (a <= b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_eqsf2
|
||||
#define perform_eqsf2(a, b) return !(a == b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_nesf2
|
||||
#define perform_nesf2(a, b) return a != b
|
||||
#endif
|
||||
|
||||
#ifndef perform_gtsf2
|
||||
#define perform_gtsf2(a, b) return a > b
|
||||
#endif
|
||||
|
||||
#ifndef perform_gesf2
|
||||
#define perform_gesf2(a, b) return (a >= b) - 1
|
||||
#endif
|
||||
|
||||
#ifndef perform_ltsf2
|
||||
#define perform_ltsf2(a, b) return -(a < b)
|
||||
#endif
|
||||
|
||||
#ifndef perform_lesf2
|
||||
#define perform_lesf2(a, b) return 1 - (a <= b);
|
||||
#endif
|
||||
|
||||
/* Define the C data type to use for an SImode value. */
|
||||
|
||||
#ifndef nongcc_SI_type
|
||||
#define nongcc_SI_type long int
|
||||
#endif
|
||||
|
||||
/* Define the C data type to use for a value of word size */
|
||||
#ifndef nongcc_word_type
|
||||
#define nongcc_word_type nongcc_SI_type
|
||||
#endif
|
||||
|
||||
/* Define the type to be used for returning an SF mode value
|
||||
and the method for turning a float into that type.
|
||||
These definitions work for machines where an SF value is
|
||||
returned in the same register as an int. */
|
||||
|
||||
#ifndef FLOAT_VALUE_TYPE
|
||||
#define FLOAT_VALUE_TYPE int
|
||||
#endif
|
||||
|
||||
#ifndef INTIFY
|
||||
#define INTIFY(FLOATVAL) (intify.f = (FLOATVAL), intify.i)
|
||||
#endif
|
||||
|
||||
#ifndef FLOATIFY
|
||||
#define FLOATIFY(INTVAL) ((INTVAL).f)
|
||||
#endif
|
||||
|
||||
#ifndef FLOAT_ARG_TYPE
|
||||
#define FLOAT_ARG_TYPE union flt_or_int
|
||||
#endif
|
||||
|
||||
union flt_or_value { FLOAT_VALUE_TYPE i; float f; };
|
||||
|
||||
union flt_or_int { int i; float f; };
|
||||
|
||||
|
||||
#ifdef L_mulsi3
|
||||
nongcc_SI_type
|
||||
__mulsi3 (a, b)
|
||||
nongcc_SI_type a, b;
|
||||
{
|
||||
perform_mulsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_udivsi3
|
||||
nongcc_SI_type
|
||||
__udivsi3 (a, b)
|
||||
unsigned nongcc_SI_type a, b;
|
||||
{
|
||||
perform_udivsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_divsi3
|
||||
nongcc_SI_type
|
||||
__divsi3 (a, b)
|
||||
nongcc_SI_type a, b;
|
||||
{
|
||||
perform_divsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_umodsi3
|
||||
nongcc_SI_type
|
||||
__umodsi3 (a, b)
|
||||
unsigned nongcc_SI_type a, b;
|
||||
{
|
||||
perform_umodsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_modsi3
|
||||
nongcc_SI_type
|
||||
__modsi3 (a, b)
|
||||
nongcc_SI_type a, b;
|
||||
{
|
||||
perform_modsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_lshrsi3
|
||||
nongcc_SI_type
|
||||
__lshrsi3 (a, b)
|
||||
unsigned nongcc_SI_type a, b;
|
||||
{
|
||||
perform_lshrsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_ashrsi3
|
||||
nongcc_SI_type
|
||||
__ashrsi3 (a, b)
|
||||
nongcc_SI_type a, b;
|
||||
{
|
||||
perform_ashrsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_ashlsi3
|
||||
nongcc_SI_type
|
||||
__ashlsi3 (a, b)
|
||||
nongcc_SI_type a, b;
|
||||
{
|
||||
perform_ashlsi3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_divdf3
|
||||
double
|
||||
__divdf3 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
perform_divdf3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_muldf3
|
||||
double
|
||||
__muldf3 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
perform_muldf3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_negdf2
|
||||
double
|
||||
__negdf2 (a)
|
||||
double a;
|
||||
{
|
||||
perform_negdf2 (a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_adddf3
|
||||
double
|
||||
__adddf3 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
perform_adddf3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_subdf3
|
||||
double
|
||||
__subdf3 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
perform_subdf3 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Note that eqdf2 returns a value for "true" that is == 0,
|
||||
nedf2 returns a value for "true" that is != 0,
|
||||
gtdf2 returns a value for "true" that is > 0,
|
||||
and so on. */
|
||||
|
||||
#ifdef L_eqdf2
|
||||
nongcc_word_type
|
||||
__eqdf2 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
/* Value == 0 iff a == b. */
|
||||
perform_eqdf2 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_nedf2
|
||||
nongcc_word_type
|
||||
__nedf2 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
/* Value != 0 iff a != b. */
|
||||
perform_nedf2 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_gtdf2
|
||||
nongcc_word_type
|
||||
__gtdf2 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
/* Value > 0 iff a > b. */
|
||||
perform_gtdf2 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_gedf2
|
||||
nongcc_word_type
|
||||
__gedf2 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
/* Value >= 0 iff a >= b. */
|
||||
perform_gedf2 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_ltdf2
|
||||
nongcc_word_type
|
||||
__ltdf2 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
/* Value < 0 iff a < b. */
|
||||
perform_ltdf2 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_ledf2
|
||||
nongcc_word_type
|
||||
__ledf2 (a, b)
|
||||
double a, b;
|
||||
{
|
||||
/* Value <= 0 iff a <= b. */
|
||||
perform_ledf2 (a, b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_fixdfsi
|
||||
nongcc_SI_type
|
||||
__fixdfsi (a)
|
||||
double a;
|
||||
{
|
||||
perform_fixdfsi (a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_fixsfsi
|
||||
nongcc_SI_type
|
||||
__fixsfsi (a)
|
||||
FLOAT_ARG_TYPE a;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_fixsfsi (FLOATIFY (a));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_floatsidf
|
||||
double
|
||||
__floatsidf (a)
|
||||
nongcc_SI_type a;
|
||||
{
|
||||
perform_floatsidf (a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_floatsisf
|
||||
FLOAT_VALUE_TYPE
|
||||
__floatsisf (a)
|
||||
nongcc_SI_type a;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_floatsisf (a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_addsf3
|
||||
FLOAT_VALUE_TYPE
|
||||
__addsf3 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_addsf3 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_negsf2
|
||||
FLOAT_VALUE_TYPE
|
||||
__negsf2 (a)
|
||||
FLOAT_ARG_TYPE a;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_negsf2 (FLOATIFY (a));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_subsf3
|
||||
FLOAT_VALUE_TYPE
|
||||
__subsf3 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_subsf3 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_eqsf2
|
||||
nongcc_word_type
|
||||
__eqsf2 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_int intify;
|
||||
/* Value == 0 iff a == b. */
|
||||
perform_eqsf2 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_nesf2
|
||||
nongcc_word_type
|
||||
__nesf2 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_int intify;
|
||||
/* Value != 0 iff a != b. */
|
||||
perform_nesf2 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_gtsf2
|
||||
nongcc_word_type
|
||||
__gtsf2 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_int intify;
|
||||
/* Value > 0 iff a > b. */
|
||||
perform_gtsf2 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_gesf2
|
||||
nongcc_word_type
|
||||
__gesf2 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_int intify;
|
||||
/* Value >= 0 iff a >= b. */
|
||||
perform_gesf2 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_ltsf2
|
||||
nongcc_word_type
|
||||
__ltsf2 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_int intify;
|
||||
/* Value < 0 iff a < b. */
|
||||
perform_ltsf2 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_lesf2
|
||||
nongcc_word_type
|
||||
__lesf2 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_int intify;
|
||||
/* Value <= 0 iff a <= b. */
|
||||
perform_lesf2 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_mulsf3
|
||||
FLOAT_VALUE_TYPE
|
||||
__mulsf3 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_mulsf3 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_divsf3
|
||||
FLOAT_VALUE_TYPE
|
||||
__divsf3 (a, b)
|
||||
FLOAT_ARG_TYPE a, b;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_divsf3 (FLOATIFY (a), FLOATIFY (b));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_truncdfsf2
|
||||
FLOAT_VALUE_TYPE
|
||||
__truncdfsf2 (a)
|
||||
double a;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_truncdfsf2 (a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_extendsfdf2
|
||||
double
|
||||
__extendsfdf2 (a)
|
||||
FLOAT_ARG_TYPE a;
|
||||
{
|
||||
union flt_or_value intify;
|
||||
perform_extendsfdf2 (FLOATIFY (a));
|
||||
}
|
||||
#endif
|
||||
|
|
@ -28,11 +28,6 @@ Boston, MA 02111-1307, USA. */
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
/* Don't use `fancy_abort' here even if config.h says to use it. */
|
||||
#ifdef abort
|
||||
#undef abort
|
||||
#endif
|
||||
|
||||
/* In the first part of this file, we are interfacing to calls generated
|
||||
by the compiler itself. These calls pass values into these routines
|
||||
which have very specific modes (rather than very specific types), and
|
||||
|
|
@ -393,41 +388,6 @@ __udivmoddi4 (UDItype n, UDItype d, UDItype *rp)
|
|||
n0 = nn.s.low;
|
||||
n1 = nn.s.high;
|
||||
|
||||
#if !UDIV_NEEDS_NORMALIZATION
|
||||
if (d1 == 0)
|
||||
{
|
||||
if (d0 > n1)
|
||||
{
|
||||
/* 0q = nn / 0D */
|
||||
|
||||
udiv_qrnnd (q0, n0, n1, n0, d0);
|
||||
q1 = 0;
|
||||
|
||||
/* Remainder in n0. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* qq = NN / 0d */
|
||||
|
||||
if (d0 == 0)
|
||||
d0 = 1 / d0; /* Divide intentionally by zero. */
|
||||
|
||||
udiv_qrnnd (q1, n1, 0, n1, d0);
|
||||
udiv_qrnnd (q0, n0, n1, n0, d0);
|
||||
|
||||
/* Remainder in n0. */
|
||||
}
|
||||
|
||||
if (rp != 0)
|
||||
{
|
||||
rr.s.low = n0;
|
||||
rr.s.high = 0;
|
||||
*rp = rr.ll;
|
||||
}
|
||||
}
|
||||
|
||||
#else /* UDIV_NEEDS_NORMALIZATION */
|
||||
|
||||
if (d1 == 0)
|
||||
{
|
||||
if (d0 > n1)
|
||||
|
|
@ -500,7 +460,6 @@ __udivmoddi4 (UDItype n, UDItype d, UDItype *rp)
|
|||
*rp = rr.ll;
|
||||
}
|
||||
}
|
||||
#endif /* UDIV_NEEDS_NORMALIZATION */
|
||||
|
||||
else
|
||||
{
|
||||
|
|
@ -822,33 +781,9 @@ __floatdidf (DItype u)
|
|||
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
|
||||
#define DI_SIZE (sizeof (DItype) * 8)
|
||||
|
||||
/* Define codes for all the float formats that we know of. Note
|
||||
that this is copied from real.h. */
|
||||
|
||||
#define UNKNOWN_FLOAT_FORMAT 0
|
||||
#define IEEE_FLOAT_FORMAT 1
|
||||
#define VAX_FLOAT_FORMAT 2
|
||||
#define IBM_FLOAT_FORMAT 3
|
||||
|
||||
/* Default to IEEE float if not specified. Nearly all machines use it. */
|
||||
#ifndef HOST_FLOAT_FORMAT
|
||||
#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
|
||||
#endif
|
||||
|
||||
#if HOST_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
|
||||
/* IEEE format */
|
||||
#define DF_SIZE 53
|
||||
#define SF_SIZE 24
|
||||
#endif
|
||||
|
||||
#if HOST_FLOAT_FORMAT == IBM_FLOAT_FORMAT
|
||||
#define DF_SIZE 56
|
||||
#define SF_SIZE 24
|
||||
#endif
|
||||
|
||||
#if HOST_FLOAT_FORMAT == VAX_FLOAT_FORMAT
|
||||
#define DF_SIZE 56
|
||||
#define SF_SIZE 24
|
||||
#endif
|
||||
|
||||
SFtype
|
||||
__floatdisf (DItype u)
|
||||
|
|
|
|||
1158
libgcc/longlong.h
1158
libgcc/longlong.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user