From d876f5327985eac3bf3109e9429febc8a8954ff5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 29 Dec 1999 18:11:48 +0000 Subject: Update. 1999-12-29 Ulrich Drepper * soft-fp/*: Tons of new files to implement floating-point arithmetic in software. Contributed by Richard Henderson, Jakub Jelinek and others. --- ChangeLog | 6 + linuxthreads/ChangeLog | 4 + soft-fp/Banner | 1 + soft-fp/ChangeLog | 135 +++++ soft-fp/Makefile | 40 ++ soft-fp/adddf3.c | 40 ++ soft-fp/addsf3.c | 41 ++ soft-fp/addtf3.c | 40 ++ soft-fp/configure | 2 + soft-fp/divdf3.c | 40 ++ soft-fp/divsf3.c | 40 ++ soft-fp/divtf3.c | 40 ++ soft-fp/double.h | 197 +++++++ soft-fp/eqdf2.c | 42 ++ soft-fp/eqsf2.c | 42 ++ soft-fp/eqtf2.c | 42 ++ soft-fp/extenddftf2.c | 45 ++ soft-fp/extended.h | 388 ++++++++++++++ soft-fp/extendsfdf2.c | 45 ++ soft-fp/extendsftf2.c | 45 ++ soft-fp/fixdfdi.c | 37 ++ soft-fp/fixdfsi.c | 37 ++ soft-fp/fixsfdi.c | 37 ++ soft-fp/fixsfsi.c | 37 ++ soft-fp/fixtfdi.c | 37 ++ soft-fp/fixtfsi.c | 37 ++ soft-fp/fixunsdfdi.c | 37 ++ soft-fp/fixunsdfsi.c | 37 ++ soft-fp/fixunssfdi.c | 37 ++ soft-fp/fixunssfsi.c | 37 ++ soft-fp/fixunstfdi.c | 37 ++ soft-fp/fixunstfsi.c | 37 ++ soft-fp/floatdidf.c | 37 ++ soft-fp/floatdisf.c | 37 ++ soft-fp/floatditf.c | 37 ++ soft-fp/floatsidf.c | 37 ++ soft-fp/floatsisf.c | 37 ++ soft-fp/floatsitf.c | 37 ++ soft-fp/gedf2.c | 42 ++ soft-fp/gesf2.c | 42 ++ soft-fp/getf2.c | 42 ++ soft-fp/ledf2.c | 42 ++ soft-fp/lesf2.c | 42 ++ soft-fp/letf2.c | 42 ++ soft-fp/muldf3.c | 40 ++ soft-fp/mulsf3.c | 40 ++ soft-fp/multf3.c | 40 ++ soft-fp/negdf2.c | 39 ++ soft-fp/negsf2.c | 39 ++ soft-fp/negtf2.c | 39 ++ soft-fp/op-1.h | 297 +++++++++++ soft-fp/op-2.h | 608 +++++++++++++++++++++ soft-fp/op-4.h | 661 +++++++++++++++++++++++ soft-fp/op-8.h | 103 ++++ soft-fp/op-common.h | 767 +++++++++++++++++++++++++++ soft-fp/quad.h | 201 +++++++ soft-fp/single.h | 110 ++++ soft-fp/soft-fp.h | 176 +++++++ soft-fp/sqrtdf2.c | 39 ++ soft-fp/sqrtsf2.c | 39 ++ soft-fp/sqrttf2.c | 39 ++ soft-fp/subdf3.c | 40 ++ soft-fp/subsf3.c | 40 ++ soft-fp/subtf3.c | 40 ++ soft-fp/sysdeps/alpha/sfp-machine.h | 35 ++ soft-fp/sysdeps/i386/sfp-machine.h | 87 +++ soft-fp/sysdeps/mips/mips64/sfp-machine.h | 47 ++ soft-fp/sysdeps/mips/sfp-machine.h | 47 ++ soft-fp/sysdeps/powerpc/sfp-machine.h | 48 ++ soft-fp/sysdeps/sparc/sparc32/Makefile | 31 ++ soft-fp/sysdeps/sparc/sparc32/q_add.c | 39 ++ soft-fp/sysdeps/sparc/sparc32/q_cmp.c | 41 ++ soft-fp/sysdeps/sparc/sparc32/q_cmpe.c | 42 ++ soft-fp/sysdeps/sparc/sparc32/q_div.c | 39 ++ soft-fp/sysdeps/sparc/sparc32/q_dtoq.c | 44 ++ soft-fp/sysdeps/sparc/sparc32/q_feq.c | 40 ++ soft-fp/sysdeps/sparc/sparc32/q_fge.c | 40 ++ soft-fp/sysdeps/sparc/sparc32/q_fgt.c | 40 ++ soft-fp/sysdeps/sparc/sparc32/q_fle.c | 40 ++ soft-fp/sysdeps/sparc/sparc32/q_flt.c | 40 ++ soft-fp/sysdeps/sparc/sparc32/q_fne.c | 40 ++ soft-fp/sysdeps/sparc/sparc32/q_itoq.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_mul.c | 39 ++ soft-fp/sysdeps/sparc/sparc32/q_neg.c | 47 ++ soft-fp/sysdeps/sparc/sparc32/q_qtod.c | 45 ++ soft-fp/sysdeps/sparc/sparc32/q_qtoi.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_qtos.c | 45 ++ soft-fp/sysdeps/sparc/sparc32/q_qtoui.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_qtoux.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_qtox.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_sqrt.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_stoq.c | 43 ++ soft-fp/sysdeps/sparc/sparc32/q_sub.c | 39 ++ soft-fp/sysdeps/sparc/sparc32/q_uitoq.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_util.c | 57 ++ soft-fp/sysdeps/sparc/sparc32/q_uxtoq.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/q_xtoq.c | 38 ++ soft-fp/sysdeps/sparc/sparc32/sfp-machine.h | 221 ++++++++ soft-fp/sysdeps/sparc/sparc64/Makefile | 33 ++ soft-fp/sysdeps/sparc/sparc64/Versions | 7 + soft-fp/sysdeps/sparc/sparc64/qp_add.c | 45 ++ soft-fp/sysdeps/sparc/sparc64/qp_cmp.c | 51 ++ soft-fp/sysdeps/sparc/sparc64/qp_cmpe.c | 52 ++ soft-fp/sysdeps/sparc/sparc64/qp_div.c | 45 ++ soft-fp/sysdeps/sparc/sparc64/qp_dtoq.c | 46 ++ soft-fp/sysdeps/sparc/sparc64/qp_feq.c | 51 ++ soft-fp/sysdeps/sparc/sparc64/qp_fge.c | 51 ++ soft-fp/sysdeps/sparc/sparc64/qp_fgt.c | 51 ++ soft-fp/sysdeps/sparc/sparc64/qp_fle.c | 51 ++ soft-fp/sysdeps/sparc/sparc64/qp_flt.c | 51 ++ soft-fp/sysdeps/sparc/sparc64/qp_fne.c | 52 ++ soft-fp/sysdeps/sparc/sparc64/qp_itoq.c | 35 ++ soft-fp/sysdeps/sparc/sparc64/qp_mul.c | 50 ++ soft-fp/sysdeps/sparc/sparc64/qp_neg.S | 31 ++ soft-fp/sysdeps/sparc/sparc64/qp_qtod.c | 49 ++ soft-fp/sysdeps/sparc/sparc64/qp_qtoi.c | 47 ++ soft-fp/sysdeps/sparc/sparc64/qp_qtos.c | 50 ++ soft-fp/sysdeps/sparc/sparc64/qp_qtoui.c | 47 ++ soft-fp/sysdeps/sparc/sparc64/qp_qtoux.c | 47 ++ soft-fp/sysdeps/sparc/sparc64/qp_qtox.c | 47 ++ soft-fp/sysdeps/sparc/sparc64/qp_sqrt.c | 42 ++ soft-fp/sysdeps/sparc/sparc64/qp_stoq.c | 46 ++ soft-fp/sysdeps/sparc/sparc64/qp_sub.c | 45 ++ soft-fp/sysdeps/sparc/sparc64/qp_uitoq.c | 35 ++ soft-fp/sysdeps/sparc/sparc64/qp_util.c | 57 ++ soft-fp/sysdeps/sparc/sparc64/qp_uxtoq.c | 35 ++ soft-fp/sysdeps/sparc/sparc64/qp_xtoq.c | 35 ++ soft-fp/sysdeps/sparc/sparc64/s_frexpl.c | 52 ++ soft-fp/sysdeps/sparc/sparc64/s_ilogbl.c | 82 +++ soft-fp/sysdeps/sparc/sparc64/s_scalblnl.c | 55 ++ soft-fp/sysdeps/sparc/sparc64/s_scalbnl.c | 55 ++ soft-fp/sysdeps/sparc/sparc64/sfp-machine.h | 143 +++++ soft-fp/testit.c | 788 ++++++++++++++++++++++++++++ soft-fp/truncdfsf2.c | 45 ++ soft-fp/trunctfdf2.c | 45 ++ soft-fp/trunctfsf2.c | 45 ++ 136 files changed, 9802 insertions(+) create mode 100644 soft-fp/Banner create mode 100644 soft-fp/ChangeLog create mode 100644 soft-fp/Makefile create mode 100644 soft-fp/adddf3.c create mode 100644 soft-fp/addsf3.c create mode 100644 soft-fp/addtf3.c create mode 100755 soft-fp/configure create mode 100644 soft-fp/divdf3.c create mode 100644 soft-fp/divsf3.c create mode 100644 soft-fp/divtf3.c create mode 100644 soft-fp/double.h create mode 100644 soft-fp/eqdf2.c create mode 100644 soft-fp/eqsf2.c create mode 100644 soft-fp/eqtf2.c create mode 100644 soft-fp/extenddftf2.c create mode 100644 soft-fp/extended.h create mode 100644 soft-fp/extendsfdf2.c create mode 100644 soft-fp/extendsftf2.c create mode 100644 soft-fp/fixdfdi.c create mode 100644 soft-fp/fixdfsi.c create mode 100644 soft-fp/fixsfdi.c create mode 100644 soft-fp/fixsfsi.c create mode 100644 soft-fp/fixtfdi.c create mode 100644 soft-fp/fixtfsi.c create mode 100644 soft-fp/fixunsdfdi.c create mode 100644 soft-fp/fixunsdfsi.c create mode 100644 soft-fp/fixunssfdi.c create mode 100644 soft-fp/fixunssfsi.c create mode 100644 soft-fp/fixunstfdi.c create mode 100644 soft-fp/fixunstfsi.c create mode 100644 soft-fp/floatdidf.c create mode 100644 soft-fp/floatdisf.c create mode 100644 soft-fp/floatditf.c create mode 100644 soft-fp/floatsidf.c create mode 100644 soft-fp/floatsisf.c create mode 100644 soft-fp/floatsitf.c create mode 100644 soft-fp/gedf2.c create mode 100644 soft-fp/gesf2.c create mode 100644 soft-fp/getf2.c create mode 100644 soft-fp/ledf2.c create mode 100644 soft-fp/lesf2.c create mode 100644 soft-fp/letf2.c create mode 100644 soft-fp/muldf3.c create mode 100644 soft-fp/mulsf3.c create mode 100644 soft-fp/multf3.c create mode 100644 soft-fp/negdf2.c create mode 100644 soft-fp/negsf2.c create mode 100644 soft-fp/negtf2.c create mode 100644 soft-fp/op-1.h create mode 100644 soft-fp/op-2.h create mode 100644 soft-fp/op-4.h create mode 100644 soft-fp/op-8.h create mode 100644 soft-fp/op-common.h create mode 100644 soft-fp/quad.h create mode 100644 soft-fp/single.h create mode 100644 soft-fp/soft-fp.h create mode 100644 soft-fp/sqrtdf2.c create mode 100644 soft-fp/sqrtsf2.c create mode 100644 soft-fp/sqrttf2.c create mode 100644 soft-fp/subdf3.c create mode 100644 soft-fp/subsf3.c create mode 100644 soft-fp/subtf3.c create mode 100644 soft-fp/sysdeps/alpha/sfp-machine.h create mode 100644 soft-fp/sysdeps/i386/sfp-machine.h create mode 100644 soft-fp/sysdeps/mips/mips64/sfp-machine.h create mode 100644 soft-fp/sysdeps/mips/sfp-machine.h create mode 100644 soft-fp/sysdeps/powerpc/sfp-machine.h create mode 100644 soft-fp/sysdeps/sparc/sparc32/Makefile create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_add.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_cmp.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_cmpe.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_div.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_dtoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_feq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_fge.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_fgt.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_fle.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_flt.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_fne.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_itoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_mul.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_neg.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_qtod.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_qtoi.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_qtos.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_qtoui.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_qtoux.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_qtox.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_sqrt.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_stoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_sub.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_uitoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_util.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_uxtoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/q_xtoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc32/sfp-machine.h create mode 100644 soft-fp/sysdeps/sparc/sparc64/Makefile create mode 100644 soft-fp/sysdeps/sparc/sparc64/Versions create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_add.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_cmp.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_cmpe.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_div.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_dtoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_feq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_fge.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_fgt.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_fle.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_flt.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_fne.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_itoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_mul.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_neg.S create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_qtod.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_qtoi.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_qtos.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_qtoui.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_qtoux.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_qtox.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_sqrt.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_stoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_sub.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_uitoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_util.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_uxtoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/qp_xtoq.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/s_frexpl.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/s_ilogbl.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/s_scalblnl.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/s_scalbnl.c create mode 100644 soft-fp/sysdeps/sparc/sparc64/sfp-machine.h create mode 100644 soft-fp/testit.c create mode 100644 soft-fp/truncdfsf2.c create mode 100644 soft-fp/trunctfdf2.c create mode 100644 soft-fp/trunctfsf2.c diff --git a/ChangeLog b/ChangeLog index eb9c9e10be..30ed6d2394 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-12-29 Ulrich Drepper + + * soft-fp/*: Tons of new files to implement floating-point arithmetic + in software. + Contributed by Richard Henderson, Jakub Jelinek and others. + 1999-12-29 Andreas Jaeger * sysdeps/unix/sysv/linux/alpha/sys/io.h: Don't include diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 994f7e610f..47ba65529d 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,7 @@ +1999-12-29 Andreas Jaeger + + * sysdeps/pthread/pthread.h: Fix typos, reformat comments. + 1999-12-28 Ulrich Drepper * sysdeps/alpha/pt-machine.h: Move stack_pointer definition to the diff --git a/soft-fp/Banner b/soft-fp/Banner new file mode 100644 index 0000000000..940395cfe3 --- /dev/null +++ b/soft-fp/Banner @@ -0,0 +1 @@ +software FPU emulation by Richard Henderson, Jakub Jelinek and others diff --git a/soft-fp/ChangeLog b/soft-fp/ChangeLog new file mode 100644 index 0000000000..f4e8bea5ee --- /dev/null +++ b/soft-fp/ChangeLog @@ -0,0 +1,135 @@ +1999-10-29 Jakub Jelinek + + * Makefile: New file. + * adddf3.c: New file. + * addsf3.c: New file. + * addtf3.c: New file. + * divdf3.c: New file. + * divsf3.c: New file. + * divtf3.c: New file. + * double.h: New file. + * eqdf2.c: New file. + * eqsf2.c: New file. + * eqtf2.c: New file. + * extenddftf2.c: New file. + * extendsfdf2.c: New file. + * extendsftf2.c: New file. + * fixdfdi.c: New file. + * fixdfsi.c: New file. + * fixsfdi.c: New file. + * fixsfsi.c: New file. + * fixtfdi.c: New file. + * fixtfsi.c: New file. + * fixunsdfdi.c: New file. + * fixunsdfsi.c: New file. + * fixunssfdi.c: New file. + * fixunssfsi.c: New file. + * fixunstfdi.c: New file. + * fixunstfsi.c: New file. + * floatdidf.c: New file. + * floatdisf.c: New file. + * floatditf.c: New file. + * floatsidf.c: New file. + * floatsisf.c: New file. + * floatsitf.c: New file. + * gedf2.c: New file. + * gesf2.c: New file. + * getf2.c: New file. + * ledf2.c: New file. + * lesf2.c: New file. + * letf2.c: New file. + * muldf3.c: New file. + * mulsf3.c: New file. + * multf3.c: New file. + * negdf2.c: New file. + * negsf2.c: New file. + * negtf2.c: New file. + * op-1.h: New file. + * op-2.h: New file. + * op-4.h: New file. + * op-common.h: New file. + * quad.h: New file. + * single.h: New file. + * soft-fp.h: New file. + * subdf3.c: New file. + * subsf3.c: New file. + * subtf3.c: New file. + * testit.c: New file. + * truncdfsf2.c: New file. + * trunctfdf2.c: New file. + * trunctfsf2.c: New file. + * Banner: New file. + * configure: New file. + * op-8.h: New file. + * sqrtdf2.c: New file. + * extended.h: New file. + * sqrtsf2.c: New file. + * sqrttf2.c: New file. + * sysdeps/i386/sfp-machine.h: New file. + * sysdeps/alpha/sfp-machine.h: New file. + * sysdeps/sparc/sparc64/sfp-machine.h: New file. + * sysdeps/sparc/sparc64/Makefile: New file. + * sysdeps/sparc/sparc64/qp_qtoux.c: New file. + * sysdeps/sparc/sparc64/qp_add.c: New file. + * sysdeps/sparc/sparc64/qp_div.c: New file. + * sysdeps/sparc/sparc64/qp_dtoq.c: New file. + * sysdeps/sparc/sparc64/qp_feq.c: New file. + * sysdeps/sparc/sparc64/qp_fge.c: New file. + * sysdeps/sparc/sparc64/qp_fle.c: New file. + * sysdeps/sparc/sparc64/qp_itoq.c: New file. + * sysdeps/sparc/sparc64/qp_mul.c: New file. + * sysdeps/sparc/sparc64/qp_qtod.c: New file. + * sysdeps/sparc/sparc64/qp_qtoi.c: New file. + * sysdeps/sparc/sparc64/qp_qtos.c: New file. + * sysdeps/sparc/sparc64/Versions: New file. + * sysdeps/sparc/sparc64/qp_stoq.c: New file. + * sysdeps/sparc/sparc64/qp_sub.c: New file. + * sysdeps/sparc/sparc64/qp_fne.c: New file. + * sysdeps/sparc/sparc64/qp_cmp.c: New file. + * sysdeps/sparc/sparc64/qp_uxtoq.c: New file. + * sysdeps/sparc/sparc64/qp_fgt.c: New file. + * sysdeps/sparc/sparc64/qp_cmpe.c: New file. + * sysdeps/sparc/sparc64/s_frexpl.c: New file. + * sysdeps/sparc/sparc64/qp_qtox.c: New file. + * sysdeps/sparc/sparc64/qp_flt.c: New file. + * sysdeps/sparc/sparc64/qp_xtoq.c: New file. + * sysdeps/sparc/sparc64/qp_sqrt.c: New file. + * sysdeps/sparc/sparc64/s_ilogbl.c: New file. + * sysdeps/sparc/sparc64/s_scalblnl.c: New file. + * sysdeps/sparc/sparc64/s_scalbnl.c: New file. + * sysdeps/sparc/sparc64/qp_util.c: New file. + * sysdeps/sparc/sparc64/qp_neg.S: New file. + * sysdeps/sparc/sparc64/qp_uitoq.c: New file. + * sysdeps/sparc/sparc64/qp_qtoui.c: New file. + * sysdeps/sparc/sparc32/sfp-machine.h: New file. + * sysdeps/sparc/sparc32/Makefile: New file. + * sysdeps/sparc/sparc32/q_qtox.c: New file. + * sysdeps/sparc/sparc32/q_cmp.c: New file. + * sysdeps/sparc/sparc32/q_dtoq.c: New file. + * sysdeps/sparc/sparc32/q_feq.c: New file. + * sysdeps/sparc/sparc32/q_fge.c: New file. + * sysdeps/sparc/sparc32/q_fgt.c: New file. + * sysdeps/sparc/sparc32/q_flt.c: New file. + * sysdeps/sparc/sparc32/q_mul.c: New file. + * sysdeps/sparc/sparc32/q_neg.c: New file. + * sysdeps/sparc/sparc32/q_qtod.c: New file. + * sysdeps/sparc/sparc32/q_qtoi.c: New file. + * sysdeps/sparc/sparc32/q_qtos.c: New file. + * sysdeps/sparc/sparc32/q_qtoui.c: New file. + * sysdeps/sparc/sparc32/q_sqrt.c: New file. + * sysdeps/sparc/sparc32/q_sub.c: New file. + * sysdeps/sparc/sparc32/q_uitoq.c: New file. + * sysdeps/sparc/sparc32/q_itoq.c: New file. + * sysdeps/sparc/sparc32/q_cmpe.c: New file. + * sysdeps/sparc/sparc32/q_xtoq.c: New file. + * sysdeps/sparc/sparc32/q_fle.c: New file. + * sysdeps/sparc/sparc32/q_div.c: New file. + * sysdeps/sparc/sparc32/q_stoq.c: New file. + * sysdeps/sparc/sparc32/q_fne.c: New file. + * sysdeps/sparc/sparc32/q_uxtoq.c: New file. + * sysdeps/sparc/sparc32/q_util.c: New file. + * sysdeps/sparc/sparc32/q_qtoux.c: New file. + * sysdeps/sparc/sparc32/q_add.c: New file. + * sysdeps/mips/sfp-machine.h: New file. + * sysdeps/mips/mips64/sfp-machine.h: New file. + * sysdeps/powerpc/sfp-machine.h: New file. diff --git a/soft-fp/Makefile b/soft-fp/Makefile new file mode 100644 index 0000000000..e72e7f2976 --- /dev/null +++ b/soft-fp/Makefile @@ -0,0 +1,40 @@ +# Copyright (C) 1997, 1999 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The GNU C Library 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 +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# +# Makefile for software floating-point routines +# +subdir := soft-fp + +gcc-single-routines := negsf2 addsf3 subsf3 mulsf3 divsf3 eqsf2 \ + lesf2 gesf2 fixsfsi fixunssfsi floatsisf fixsfdi \ + fixunssfdi floatdisf sqrtsf2 + +gcc-double-routines := negdf2 adddf3 subdf3 muldf3 divdf3 eqdf2 \ + ledf2 gedf2 fixdfsi fixunsdfsi floatsidf fixdfdi \ + fixunsdfdi floatdidf extendsfdf2 truncdfsf2 sqrtdf2 + +gcc-quad-routines := negtf2 addtf3 subtf3 multf3 divtf3 eqtf2 \ + letf2 getf2 fixtfsi fixunstfsi floatsitf fixtfdi \ + fixunstfdi floatditf extendsftf2 trunctfsf2 extenddftf2 \ + trunctfdf2 sqrttf2 + +distribute := double.h op-1.h op-2.h op-4.h op-common.h quad.h \ + single.h soft-fp.h extended.h + +include ../Rules diff --git a/soft-fp/adddf3.c b/soft-fp/adddf3.c new file mode 100644 index 0000000000..373bbb198f --- /dev/null +++ b/soft-fp/adddf3.c @@ -0,0 +1,40 @@ +/* Software floating-point emulation. + Return a + b + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "double.h" + +double __adddf3(double a, double b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); + double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_D(A, a); + FP_UNPACK_D(B, b); + FP_ADD_D(R, A, B); + FP_PACK_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/addsf3.c b/soft-fp/addsf3.c new file mode 100644 index 0000000000..6ee36c5077 --- /dev/null +++ b/soft-fp/addsf3.c @@ -0,0 +1,41 @@ +/* Software floating-point emulation. + Return a + b + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" + +float __addsf3(float a, float b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); + float r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_S(A, a); + FP_UNPACK_S(B, b); + FP_ADD_S(R, A, B); + FP_PACK_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} + diff --git a/soft-fp/addtf3.c b/soft-fp/addtf3.c new file mode 100644 index 0000000000..5919df1abe --- /dev/null +++ b/soft-fp/addtf3.c @@ -0,0 +1,40 @@ +/* Software floating-point emulation. + Return a + b + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +long double __addtf3(long double a, long double b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); + long double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_Q(A, a); + FP_UNPACK_Q(B, b); + FP_ADD_Q(R, A, B); + FP_PACK_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/configure b/soft-fp/configure new file mode 100755 index 0000000000..d40d2d7ba2 --- /dev/null +++ b/soft-fp/configure @@ -0,0 +1,2 @@ +# This is only to keep the GNU C library configure mechanism happy. +exit 0 diff --git a/soft-fp/divdf3.c b/soft-fp/divdf3.c new file mode 100644 index 0000000000..f0bbbfdf50 --- /dev/null +++ b/soft-fp/divdf3.c @@ -0,0 +1,40 @@ +/* Software floating-point emulation. + Return a / b + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "double.h" + +double __divdf3(double a, double b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); + double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_D(A, a); + FP_UNPACK_D(B, b); + FP_DIV_D(R, A, B); + FP_PACK_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/divsf3.c b/soft-fp/divsf3.c new file mode 100644 index 0000000000..37d691b140 --- /dev/null +++ b/soft-fp/divsf3.c @@ -0,0 +1,40 @@ +/* Software floating-point emulation. + Return a / b + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" + +float __divsf3(float a, float b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); + float r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_S(A, a); + FP_UNPACK_S(B, b); + FP_DIV_S(R, A, B); + FP_PACK_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/divtf3.c b/soft-fp/divtf3.c new file mode 100644 index 0000000000..dfc4c01cb3 --- /dev/null +++ b/soft-fp/divtf3.c @@ -0,0 +1,40 @@ +/* Software floating-point emulation. + Return a / b + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +long double __divtf3(long double a, long double b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); + long double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_Q(A, a); + FP_UNPACK_Q(B, b); + FP_DIV_Q(R, A, B); + FP_PACK_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/double.h b/soft-fp/double.h new file mode 100644 index 0000000000..ee581c2da4 --- /dev/null +++ b/soft-fp/double.h @@ -0,0 +1,197 @@ +/* Software floating-point emulation. + Definitions for IEEE Double Precision + Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if _FP_W_TYPE_SIZE < 32 +#error "Here's a nickel kid. Go buy yourself a real computer." +#endif + +#if _FP_W_TYPE_SIZE < 64 +#define _FP_FRACTBITS_D (2 * _FP_W_TYPE_SIZE) +#else +#define _FP_FRACTBITS_D _FP_W_TYPE_SIZE +#endif + +#define _FP_FRACBITS_D 53 +#define _FP_FRACXBITS_D (_FP_FRACTBITS_D - _FP_FRACBITS_D) +#define _FP_WFRACBITS_D (_FP_WORKBITS + _FP_FRACBITS_D) +#define _FP_WFRACXBITS_D (_FP_FRACTBITS_D - _FP_WFRACBITS_D) +#define _FP_EXPBITS_D 11 +#define _FP_EXPBIAS_D 1023 +#define _FP_EXPMAX_D 2047 + +#define _FP_QNANBIT_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE) +#define _FP_OVERFLOW_D \ + ((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE) + +#if _FP_W_TYPE_SIZE < 64 + +union _FP_UNION_D +{ + double flt; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_D; + unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE; + unsigned frac0 : _FP_W_TYPE_SIZE; +#else + unsigned frac0 : _FP_W_TYPE_SIZE; + unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_D; + unsigned sign : 1; +#endif + } bits __attribute__((packed)); +}; + +#define FP_DECL_D(X) _FP_DECL(2,X) +#define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_2(D,X,val) +#define FP_UNPACK_RAW_DP(X,val) _FP_UNPACK_RAW_2_P(D,X,val) +#define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_2(D,val,X) +#define FP_PACK_RAW_DP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(D,val,X); \ + } while (0) + +#define FP_UNPACK_D(X,val) \ + do { \ + _FP_UNPACK_RAW_2(D,X,val); \ + _FP_UNPACK_CANONICAL(D,2,X); \ + } while (0) + +#define FP_UNPACK_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(D,X,val); \ + _FP_UNPACK_CANONICAL(D,2,X); \ + } while (0) + +#define FP_PACK_D(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,2,X); \ + _FP_PACK_RAW_2(D,val,X); \ + } while (0) + +#define FP_PACK_DP(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(D,val,X); \ + } while (0) + +#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,2,X) +#define FP_NEG_D(R,X) _FP_NEG(D,2,R,X) +#define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y) +#define FP_SUB_D(R,X,Y) _FP_SUB(D,2,R,X,Y) +#define FP_MUL_D(R,X,Y) _FP_MUL(D,2,R,X,Y) +#define FP_DIV_D(R,X,Y) _FP_DIV(D,2,R,X,Y) +#define FP_SQRT_D(R,X) _FP_SQRT(D,2,R,X) +#define _FP_SQRT_MEAT_D(R,S,T,X,Q) _FP_SQRT_MEAT_2(R,S,T,X,Q) + +#define FP_CMP_D(r,X,Y,un) _FP_CMP(D,2,r,X,Y,un) +#define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,2,r,X,Y) + +#define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,2,r,X,rsz,rsg) +#define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,2,X,r,rs,rt) + +#define _FP_FRAC_HIGH_D(X) _FP_FRAC_HIGH_2(X) +#define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_2(X) + +#else + +union _FP_UNION_D +{ + double flt; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_D; + unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0); +#else + unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0); + unsigned exp : _FP_EXPBITS_D; + unsigned sign : 1; +#endif + } bits __attribute__((packed)); +}; + +#define FP_DECL_D(X) _FP_DECL(1,X) +#define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_1(D,X,val) +#define FP_UNPACK_RAW_DP(X,val) _FP_UNPACK_RAW_1_P(D,X,val) +#define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_1(D,val,X) +#define FP_PACK_RAW_DP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(D,val,X); \ + } while (0) + +#define FP_UNPACK_D(X,val) \ + do { \ + _FP_UNPACK_RAW_1(D,X,val); \ + _FP_UNPACK_CANONICAL(D,1,X); \ + } while (0) + +#define FP_UNPACK_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_1_P(D,X,val); \ + _FP_UNPACK_CANONICAL(D,1,X); \ + } while (0) + +#define FP_PACK_D(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,1,X); \ + _FP_PACK_RAW_1(D,val,X); \ + } while (0) + +#define FP_PACK_DP(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(D,val,X); \ + } while (0) + +#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,1,X) +#define FP_NEG_D(R,X) _FP_NEG(D,1,R,X) +#define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y) +#define FP_SUB_D(R,X,Y) _FP_SUB(D,1,R,X,Y) +#define FP_MUL_D(R,X,Y) _FP_MUL(D,1,R,X,Y) +#define FP_DIV_D(R,X,Y) _FP_DIV(D,1,R,X,Y) +#define FP_SQRT_D(R,X) _FP_SQRT(D,1,R,X) +#define _FP_SQRT_MEAT_D(R,S,T,X,Q) _FP_SQRT_MEAT_1(R,S,T,X,Q) + +/* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by + the target machine. */ + +#define FP_CMP_D(r,X,Y,un) _FP_CMP(D,1,r,X,Y,un) +#define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,1,r,X,Y) + +#define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,1,r,X,rsz,rsg) +#define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,1,X,r,rs,rt) + +#define _FP_FRAC_HIGH_D(X) _FP_FRAC_HIGH_1(X) +#define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_1(X) + +#endif /* W_TYPE_SIZE < 64 */ diff --git a/soft-fp/eqdf2.c b/soft-fp/eqdf2.c new file mode 100644 index 0000000000..b32b4e1e32 --- /dev/null +++ b/soft-fp/eqdf2.c @@ -0,0 +1,42 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 otherwise + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "double.h" + +int __eqdf2(double a, double b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); + int r; + + FP_UNPACK_RAW_D(A, a); + FP_UNPACK_RAW_D(B, b); + FP_CMP_EQ_D(r, A, B); + if (r && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__eqdf2, __nedf2); diff --git a/soft-fp/eqsf2.c b/soft-fp/eqsf2.c new file mode 100644 index 0000000000..93373f1695 --- /dev/null +++ b/soft-fp/eqsf2.c @@ -0,0 +1,42 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 otherwise + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" + +int __eqsf2(float a, float b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); + int r; + + FP_UNPACK_RAW_S(A, a); + FP_UNPACK_RAW_S(B, b); + FP_CMP_EQ_S(r, A, B); + if (r && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__eqsf2, __nesf2); diff --git a/soft-fp/eqtf2.c b/soft-fp/eqtf2.c new file mode 100644 index 0000000000..7af2f92128 --- /dev/null +++ b/soft-fp/eqtf2.c @@ -0,0 +1,42 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 otherwise + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +int __eqtf2(long double a, long double b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); + int r; + + FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_RAW_Q(B, b); + FP_CMP_EQ_Q(r, A, B); + if (r && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__eqtf2, __netf2); diff --git a/soft-fp/extenddftf2.c b/soft-fp/extenddftf2.c new file mode 100644 index 0000000000..36a4d49f10 --- /dev/null +++ b/soft-fp/extenddftf2.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return a converted to IEEE quad + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "double.h" +#include "quad.h" + +long double __extenddftf2(double a) +{ + FP_DECL_EX; + FP_DECL_D(A); + FP_DECL_Q(R); + long double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_D(A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_CONV(Q,D,4,2,R,A); +#else + FP_CONV(Q,D,2,1,R,A); +#endif + FP_PACK_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/extended.h b/soft-fp/extended.h new file mode 100644 index 0000000000..4a1d7e711c --- /dev/null +++ b/soft-fp/extended.h @@ -0,0 +1,388 @@ +/* Software floating-point emulation. + Definitions for IEEE Extended Precision. + Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if _FP_W_TYPE_SIZE < 32 +#error "Here's a nickel, kid. Go buy yourself a real computer." +#endif + +#if _FP_W_TYPE_SIZE < 64 +#define _FP_FRACTBITS_E (4*_FP_W_TYPE_SIZE) +#else +#define _FP_FRACTBITS_E (2*_FP_W_TYPE_SIZE) +#endif + +#define _FP_FRACBITS_E 64 +#define _FP_FRACXBITS_E (_FP_FRACTBITS_E - _FP_FRACBITS_E) +#define _FP_WFRACBITS_E (_FP_WORKBITS + _FP_FRACBITS_E) +#define _FP_WFRACXBITS_E (_FP_FRACTBITS_E - _FP_WFRACBITS_E) +#define _FP_EXPBITS_E 15 +#define _FP_EXPBIAS_E 16383 +#define _FP_EXPMAX_E 32767 + +#define _FP_QNANBIT_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1) % _FP_W_TYPE_SIZE) +#define _FP_OVERFLOW_E \ + ((_FP_W_TYPE)1 << (_FP_WFRACBITS_E % _FP_W_TYPE_SIZE)) + +#if _FP_W_TYPE_SIZE < 64 + +union _FP_UNION_E +{ + long double flt; + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned long pad1 : _FP_W_TYPE_SIZE; + unsigned long pad2 : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E); + unsigned long sign : 1; + unsigned long exp : _FP_EXPBITS_E; + unsigned long frac1 : _FP_W_TYPE_SIZE; + unsigned long frac0 : _FP_W_TYPE_SIZE; +#else + unsigned long frac0 : _FP_W_TYPE_SIZE; + unsigned long frac1 : _FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_E; + unsigned sign : 1; +#endif /* not bigendian */ + } bits __attribute__((packed)); +}; + + +#define FP_DECL_E(X) _FP_DECL(4,X) + +#define FP_UNPACK_RAW_E(X, val) \ + do { \ + union _FP_UNION_E _flo; _flo.flt = (val); \ + \ + X##_f[2] = 0; X##_f[3] = 0; \ + X##_f[0] = _flo.bits.frac0; \ + X##_f[1] = _flo.bits.frac1; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + if (!X##_e && (X##_f[1] || X##_f[0]) \ + && !(X##_f[1] & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_UNPACK_RAW_EP(X, val) \ + do { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + X##_f[2] = 0; X##_f[3] = 0; \ + X##_f[0] = _flo->bits.frac0; \ + X##_f[1] = _flo->bits.frac1; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + if (!X##_e && (X##_f[1] || X##_f[0]) \ + && !(X##_f[1] & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_PACK_RAW_E(val, X) \ + do { \ + union _FP_UNION_E _flo; \ + \ + if (X##_e) X##_f[1] |= _FP_IMPLBIT_E; \ + else X##_f[1] &= ~(_FP_IMPLBIT_E); \ + _flo.bits.frac0 = X##_f[0]; \ + _flo.bits.frac1 = X##_f[1]; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + \ + (val) = _flo.flt; \ + } while (0) + +#define FP_PACK_RAW_EP(val, X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + if (X##_e) X##_f[1] |= _FP_IMPLBIT_E; \ + else X##_f[1] &= ~(_FP_IMPLBIT_E); \ + _flo->bits.frac0 = X##_f[0]; \ + _flo->bits.frac1 = X##_f[1]; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } \ + } while (0) + +#define FP_UNPACK_E(X,val) \ + do { \ + FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_CANONICAL(E,4,X); \ + } while (0) + +#define FP_UNPACK_EP(X,val) \ + do { \ + FP_UNPACK_RAW_2_P(X,val); \ + _FP_UNPACK_CANONICAL(E,4,X); \ + } while (0) + +#define FP_PACK_E(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,4,X); \ + FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_EP(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,4,X); \ + FP_PACK_RAW_EP(val,X); \ + } while (0) + +#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X) +#define FP_NEG_E(R,X) _FP_NEG(E,4,R,X) +#define FP_ADD_E(R,X,Y) _FP_ADD(E,4,R,X,Y) +#define FP_SUB_E(R,X,Y) _FP_SUB(E,4,R,X,Y) +#define FP_MUL_E(R,X,Y) _FP_MUL(E,4,R,X,Y) +#define FP_DIV_E(R,X,Y) _FP_DIV(E,4,R,X,Y) +#define FP_SQRT_E(R,X) _FP_SQRT(E,4,R,X) + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + * This has special _E version because standard _4 square + * root would not work (it has to start normally with the + * second word and not the first), but as we have to do it + * anyway, we optimize it by doing most of the calculations + * in two UWtype registers instead of four. + */ + +#define _FP_SQRT_MEAT_E(R, S, T, X, q) \ + do { \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + _FP_FRAC_SRL_4(X, (_FP_WORKBITS)); \ + while (q) \ + { \ + T##_f[1] = S##_f[1] + q; \ + if (T##_f[1] <= X##_f[1]) \ + { \ + S##_f[1] = T##_f[1] + q; \ + X##_f[1] -= T##_f[1]; \ + R##_f[1] += q; \ + } \ + _FP_FRAC_SLL_2(X, 1); \ + q >>= 1; \ + } \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + while (q) \ + { \ + T##_f[0] = S##_f[0] + q; \ + T##_f[1] = S##_f[1]; \ + if (T##_f[1] < X##_f[1] || \ + (T##_f[1] == X##_f[1] && \ + T##_f[0] <= X##_f[0])) \ + { \ + S##_f[0] = T##_f[0] + q; \ + S##_f[1] += (T##_f[0] > S##_f[0]); \ + _FP_FRAC_DEC_2(X, T); \ + R##_f[0] += q; \ + } \ + _FP_FRAC_SLL_2(X, 1); \ + q >>= 1; \ + } \ + _FP_FRAC_SLL_4(R, (_FP_WORKBITS)); \ + if (X##_f[0] | X##_f[1]) \ + { \ + if (S##_f[1] < X##_f[1] || \ + (S##_f[1] == X##_f[1] && \ + S##_f[0] < X##_f[0])) \ + R##_f[0] |= _FP_WORK_ROUND; \ + R##_f[0] |= _FP_WORK_STICKY; \ + } \ + } while (0) + +#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,4,r,X,Y,un) +#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,4,r,X,Y) + +#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,4,r,X,rsz,rsg) +#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,4,X,r,rs,rt) + +#define _FP_FRAC_HIGH_E(X) (X##_f[2]) +#define _FP_FRAC_HIGH_RAW_E(X) (X##_f[1]) + +#else /* not _FP_W_TYPE_SIZE < 64 */ +union _FP_UNION_E +{ + long double flt /* __attribute__((mode(TF))) */ ; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E); + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_E; + unsigned long frac : _FP_W_TYPE_SIZE; +#else + unsigned long frac : _FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_E; + unsigned sign : 1; +#endif + } bits; +}; + +#define FP_DECL_E(X) _FP_DECL(2,X) + +#define FP_UNPACK_RAW_E(X, val) \ + do { \ + union _FP_UNION_E _flo; _flo.flt = (val); \ + \ + X##_f0 = _flo.bits.frac; \ + X##_f1 = 0; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_UNPACK_RAW_EP(X, val) \ + do { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + X##_f0 = _flo->bits.frac; \ + X##_f1 = 0; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_PACK_RAW_E(val, X) \ + do { \ + union _FP_UNION_E _flo; \ + \ + if (X##_e) X##_f0 |= _FP_IMPLBIT_E; \ + else X##_f0 &= ~(_FP_IMPLBIT_E); \ + _flo.bits.frac = X##_f0; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + \ + (val) = _flo.flt; \ + } while (0) + +#define FP_PACK_RAW_EP(fs, val, X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + if (X##_e) X##_f0 |= _FP_IMPLBIT_E; \ + else X##_f0 &= ~(_FP_IMPLBIT_E); \ + _flo->bits.frac = X##_f0; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } \ + } while (0) + + +#define FP_UNPACK_E(X,val) \ + do { \ + FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_CANONICAL(E,2,X); \ + } while (0) + +#define FP_UNPACK_EP(X,val) \ + do { \ + FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_CANONICAL(E,2,X); \ + } while (0) + +#define FP_PACK_E(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,2,X); \ + FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_EP(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,2,X); \ + FP_PACK_RAW_EP(val,X); \ + } while (0) + +#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X) +#define FP_NEG_E(R,X) _FP_NEG(E,2,R,X) +#define FP_ADD_E(R,X,Y) _FP_ADD(E,2,R,X,Y) +#define FP_SUB_E(R,X,Y) _FP_SUB(E,2,R,X,Y) +#define FP_MUL_E(R,X,Y) _FP_MUL(E,2,R,X,Y) +#define FP_DIV_E(R,X,Y) _FP_DIV(E,2,R,X,Y) +#define FP_SQRT_E(R,X) _FP_SQRT(E,2,R,X) + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + * We optimize it by doing most of the calculations + * in one UWtype registers instead of two, although we don't + * have to. + */ +#define _FP_SQRT_MEAT_E(R, S, T, X, q) \ + do { \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + _FP_FRAC_SRL_2(X, (_FP_WORKBITS)); \ + while (q) \ + { \ + T##_f0 = S##_f0 + q; \ + if (T##_f0 <= X##_f0) \ + { \ + S##_f0 = T##_f0 + q; \ + X##_f0 -= T##_f0; \ + R##_f0 += q; \ + } \ + _FP_FRAC_SLL_1(X, 1); \ + q >>= 1; \ + } \ + _FP_FRAC_SLL_2(R, (_FP_WORKBITS)); \ + if (X##_f0) \ + { \ + if (S##_f0 < X##_f0) \ + R##_f0 |= _FP_WORK_ROUND; \ + R##_f0 |= _FP_WORK_STICKY; \ + } \ + } while (0) + +#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,2,r,X,Y,un) +#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,2,r,X,Y) + +#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,2,r,X,rsz,rsg) +#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,2,X,r,rs,rt) + +#define _FP_FRAC_HIGH_E(X) (X##_f1) +#define _FP_FRAC_HIGH_RAW_E(X) (X##_f0) + +#endif /* not _FP_W_TYPE_SIZE < 64 */ diff --git a/soft-fp/extendsfdf2.c b/soft-fp/extendsfdf2.c new file mode 100644 index 0000000000..8e5fefe4e8 --- /dev/null +++ b/soft-fp/extendsfdf2.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return a converted to IEEE double + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" +#include "double.h" + +double __extendsfdf2(float a) +{ + FP_DECL_EX; + FP_DECL_S(A); + FP_DECL_D(R); + double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_S(A, a); +#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D + FP_CONV(D,S,2,1,R,A); +#else + FP_CONV(D,S,1,1,R,A); +#endif + FP_PACK_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/extendsftf2.c b/soft-fp/extendsftf2.c new file mode 100644 index 0000000000..8902683f14 --- /dev/null +++ b/soft-fp/extendsftf2.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return a converted to IEEE quad + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" +#include "quad.h" + +long double __extendsftf2(float a) +{ + FP_DECL_EX; + FP_DECL_S(A); + FP_DECL_Q(R); + long double r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_S(A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_CONV(Q,S,4,1,R,A); +#else + FP_CONV(Q,S,2,1,R,A); +#endif + FP_PACK_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/fixdfdi.c b/soft-fp/fixdfdi.c new file mode 100644 index 0000000000..5805d972ea --- /dev/null +++ b/soft-fp/fixdfdi.c @@ -0,0 +1,37 @@ +/* Software floating-point emulation. + Convert a to 64bit signed integer + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DItype __fixdfdi(double a) +{ + FP_DECL_EX; + FP_DECL_D(A); + DItype r; + + FP_UNPACK_D(A, a); + FP_TO_INT_D(r, A, 64, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/fixdfsi.c b/soft-fp/fixdfsi.c new file mode 100644 index 0000000000..e7dcea8f1b --- /dev/null +++ b/soft-fp/fixdfsi.c @@ -0,0 +1,37 @@ +/* Software floating-point emulation. + Convert a to 32bit signed integer + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "double.h" + +SItype __fixdfsi(double a) +{ + FP_DECL_EX; + FP_DECL_D(A); + SItype r; + + FP_UNPACK_D(A, a); + FP_TO_INT_D(r, A, 32, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/fixsfdi.c b/soft-fp/fixsfdi.c new file mode 100644 index 0000000000..76ca858c65 --- /dev/null +++ b/soft-fp/fixsfdi.c @@ -0,0 +1,37 @@ +/* Software floating-point emulation. + Convert a to 64bit signed integer + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" + +DItype __fixsfdi(float a) +{ + FP_DECL_EX; + FP_DECL_S(A); + DItype r; + + FP_UNPACK_S(A, a); + FP_TO_INT_S(r, A, 64, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/soft-fp/fixsfsi.c b/soft-fp/fixsfsi.c new file mode 100644 index 0000000000..7e745dc8d4 --- /dev/null +++ b/soft-fp/fixsfsi.c @@ -0,0 +1,37 @@ +/* Software floating-point emulation. + Convert a to 32bit signed integer + Copyright (C) 1997,1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If + not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SItype __fixsfsi(float a) +{ + FP_DECL_EX; + FP_DECL_S(A); + SItype r; + + FP_UNPACK_S(A, a); + FP_TO_INT_S(r, A, 32, 1); + FP_HANDLE_EXCEPTIONS; + + ret