public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]  PR libgcc/59714 complex division is surprising on aarch64
@ 2018-01-25 20:40 vladimir.mezentsev
  2018-01-26  3:39 ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2018-01-25 20:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: vladimir.mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and sparc64-unknown-linux-gnu.
No regression. New tests now passed.
There is a performance degradation for complex double type:

              failed cases  |    time
               old   new    |   old  new
complex-32      15    0     |  3.51  3.56
complex-64      19    0     |  1.88  2.34
complex-128     34    0     |  3.71  2.88

ChangeLog:
2018-01-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR libgcc/59714
* libgcc/libgcc2.c: New complex division implementation
* libgcc/config/sparc/sfp-machine.h: New
* gcc/testsuite/gcc.c-torture/execute/pr59714_128.c: New test
* gcc/testsuite/gcc.c-torture/execute/pr59714_32.c: New test
* gcc/testsuite/gcc.c-torture/execute/pr59714_64.c: New test
---
 gcc/testsuite/gcc.c-torture/execute/pr59714_128.c | 506 ++++++++++++++++++++++
 gcc/testsuite/gcc.c-torture/execute/pr59714_32.c  | 506 ++++++++++++++++++++++
 gcc/testsuite/gcc.c-torture/execute/pr59714_64.c  | 506 ++++++++++++++++++++++
 libgcc/config/sparc/sfp-machine.h                 |  13 +
 libgcc/libgcc2.c                                  | 175 +++++++-
 5 files changed, 1700 insertions(+), 6 deletions(-)
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr59714_128.c
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr59714_32.c
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr59714_64.c
 create mode 100644 libgcc/config/sparc/sfp-machine.h

diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59714_128.c b/gcc/testsuite/gcc.c-torture/execute/pr59714_128.c
new file mode 100644
index 0000000..e26f40a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59714_128.c
@@ -0,0 +1,506 @@
+#include <stdio.h>
+#include <math.h>
+
+extern void abort (void);
+#define FABS(x) ((x) >= 0 ? (x) : -(x))
+#define FTYPE   long double
+#define FMT     "%-39.28La"
+
+/*
+   Tables of numbers for complex division testing
+   All values in hex format
+   z[i] == correctly rounded value of x[i]/y[i];
+ */
+
+#define NUMCNT 100
+
+__complex FTYPE x[NUMCNT] =
+  {
+    0x1.0p0L + 0x1.0p0Li,		/* #1 */
+    0x1.0p0L + 0x1.0p0Li,		/* #2 */
+    0x1.0p1023L + 0x1.0p-1023Li,	/* #3 */
+    0x1.0p1023L + 0x1.0p1023Li,		/* #4 */
+    0x1.0p1020L + 0x1.0p-844Li,		/* #5 */
+    0x1.0p-71L + 0x1.0p1021Li,		/* #6 */
+    0x1.0p-347L + 0x1.0p-54Li,		/* #7 */
+    0x1.0p-1074L + 0x1.0p-1074Li,	/* #8 */
+    0x1.0p1015L + 0x1.0p-989Li,		/* #9 */
+    0x1.0p-622L + 0x1.0p-1071Li,	/* #10 */
+    0x1.0p0L + 0x3.0p0Li,		/* #11 */
+    -0x1.0p0L + 0x3.0p0Li,		/* #12 */
+    0x1.0p0L - 0x3.0p0Li,		/* #13 */
+    0x3.0p0L + 0x1.0p0Li,		/* #14 */
+    0x3.0p0L + 0x4.0p0Li,		/* #15 */
+    0x1.0p0L - 0x3.000000001p-20Li,	/* #16 */
+    0x1.0p0L + 0x3.00000000001p-20Li,	/* #17 */
+    0x1.0p0L + 0x1.8000000000002p1Li,	/* #18 */
+    0x1.0p0L + 0x1.8000000000004p1Li,	/* #19 */
+    0x1.0p0L + 0x1.8000000000008p1Li,	/* #20 */
+    0x1.0p0L + 0x1.8000000000010p1Li,	/* #21 */
+    0x1.0p0L + 0x1.8000000000020p1Li,	/* #22 */
+    0x1.0p0L + 0x1.8000000000040p1Li,	/* #23 */
+    0x1.0p0L + 0x1.8000000000080p1Li,	/* #24 */
+    0x1.0p0L + 0x1.7ffffffffff8p1Li,	/* #25 */
+    0x1.0p0L + 0x1.7ffffffffff0p1Li,	/* #26 */
+    0x1.0p0L + 0x1.7fffffffff80p1Li,	/* #27 */
+    0x1.0p0L + 0x1.7fffffffff00p1Li,	/* #28 */
+    0x5.0p0L + 0x5.0p0Li,		/* #29 */
+    0x4.0p0L + 0x3.0p0Li,		/* #30 */
+    -0x4.0p0L + 0x3.000000001p0Li,	/* #31 */
+    0x3.00000000001p-20L + 0x1.0p0Li,	/* #32 */
+    0x1.00000000001p-80L + 0x1.0p0Li,	/* #33 */
+    0x1.00000000001p-8000L + 0x1.0p0Li,	/* #34 */
+    0x1.0p0L + 0x1.00000000001p-8000Li,	/* #35 */
+    -0x1.0p0L + 0x1.00000000001p-8000Li,/* #36 */
+    -0x1.0p0L + 0x1.00000000001p-8000Li,/* #37 */
+    -0x1.0p0L + 0x1.00000000001p-8000Li,/* #38 */
+    0x1.0p0L - 0x1.00000000001p-8000Li,	/* #39 */
+    0x1.0p1000L - 0x1.00000000001p-8000Li,	/* #40 */
+    0x1.97530p1000L - 0x1.00000000001p-8000Li,	/* #41 */
+    0x1.97530p3000L - 0x1.00000000001p-8000Li,	/* #42 */
+    0x1.97530p3770L - 0x1.00000000001p-8000Li,	/* #43 */
+    0x1.97530p4770L - 0x1.00000000001p-7000Li,	/* #44 */
+    0x1.97530p0L - 0x1.00000000001p-12000Li,	/* #45 */
+    0x1.97530p1000L - 0x1.00000000001p-11000Li,	/* #46 */
+    0x1.97530p2000L - 0x1.00000000001p-9000Li,	/* #47 */
+    0x1.97530p3000L - 0x1.00000000001p-8000Li,	/* #48 */
+    0x1.97530p4000L - 0x1.00000000001p-7000Li,	/* #49 */
+    0x1.97530p5000L - 0x1.00000000001p-6000Li,	/* #50 */
+    0x1.97530p6000L - 0x1.00000000001p-5000Li,	/* #51 */
+    0x1.97530p7000L - 0x1.00000000001p-4000Li,	/* #52 */
+    0x1.97530p8000L - 0x1.00000000001p-1000Li,	/* #53 */
+    0x1.97530p9000L - 0x1.00000000001p-0Li,	/* #54 */
+    0x1.97530p10000L + 0x1.00000000001p2000Li,	/* #55 */
+    0x1.97530p10100L + 0x1.00000000000p3000Li,	/* #56 */
+    0x1.97530p8000L + 0x1.00000000000p4000Li,	/* #57 */
+    0x1.97530p7000L + 0x1.00000000000p5000Li,	/* #58 */
+    0x1.97530p6000L + 0x1.00000000000p6000Li,	/* #59 */
+    0x1.97530p5200L + 0x1.00000000000p5200Li,	/* #60 */
+    0x1.0p1020L + 0x1.0p-844Li,		/* #61 */
+    0x1.0p920L + 0x1.0p-844Li,		/* #62 */
+    0x1.0p504L + 0x1.0p523Li,		/* #63 */
+    0x1.0p1004L + 0x1.0p-512Li,		/* #64 */
+    0x1.0p910L + 0x1.0p-512Li,		/* #65 */
+    0x1.0p865L + 0x1.0p-512Li,		/* #66 */
+    0x1.0p864L + 0x1.0p-512Li,		/* #67 */
+    0x1.0p860L + 0x1.0p-512Li,		/* #68 */
+    0x1.0p810L + 0x1.0p-512Li,		/* #69 */
+    0x1.0p710L + 0x1.0p-512Li,		/* #70 */
+    0x1.0p610L + 0x1.0p-512Li,		/* #71 */
+    0x1.0p510L + 0x1.0p-512Li,		/* #72 */
+    0x1.0p410L + 0x1.0p-512Li,		/* #73 */
+    0x13.0p4L + 0x1.0p-4Li,		/* #74 */
+    0x13.0p2L + 0x13.0p2Li,		/* #75 */
+    0x13.0p4L + 0x1.0p4Li,		/* #76 */
+    0x12.0p4L + 0x12.0p-4Li,		/* #77 */
+    0x1.0p1L + 0x12.0p1Li,		/* #78 */
+    0x1.0p2L + 0x1.0p4Li,		/* #79 */
+    0x13.0p0L + 0x0.0p0Li,		/* #80 */
+    0x1.01p12L - 0x1.037p-12Li,		/* #81 */
+    -0x1.01p12L - 0x1.037p-12Li,	/* #82 */
+    0x1.01p12L - 0x1.037p-12Li,		/* #83 */
+    -0x1.01p12L - 0x1.037p-12Li,	/* #84 */
+    0x1.01p12L - 0x1.037p-12Li,		/* #85 */
+    0x1.123456p3L - 0x1.789123p4Li,	/* #86 */
+    0x1.123457p3L - 0x1.789123p4Li,	/* #87 */
+    0x1.123458p3L + 0x1.789123p4Li,	/* #88 */
+    0x1.123456p3L + 0x1.789122p4Li,	/* #89 */
+    0x1.123456p3L + 0x1.789121p4Li,	/* #90 */
+    0x1.123456p3L + 0x1.789120p4Li,	/* #91 */
+    0x1.123455p3L - 0x1.789123p4Li,	/* #92 */
+    0x1.123454p3L - 0x1.789122p4Li,	/* #93 */
+    -0x1.123453p3L + 0x1.789121p4Li,	/* #94 */
+    0x1.123452p3L + 0x1.789120p4Li,	/* #95 */
+    0x1.123451p3L - 0x1.789127p4Li,	/* #96 */
+    0x1.123459p3L - 0x1.789125p4Li,	/* #97 */
+    -0x1.123450p3L + 0x1.789124p4Li,	/* #98 */
+    0x1.1234561p3L + 0x1.7891231p4Li,	/* #99 */
+    0x1.1234561p3L - 0x1.7891231p4Li	/* #100 */
+  };
+
+__complex FTYPE y[NUMCNT] =
+  {
+    0x1.0p0L + 0x1.0p1023Li,		/* #1 */
+    0x1.0p-1023L + 0x1.0p-1023Li,	/* #2 */
+    0x1.0p677L + 0x1.0p-677Li,		/* #3 */
+    0x1.0p0L + 0x1.0p0Li,		/* #4 */
+    0x1.0p656L + 0x1.0p-780Li,		/* #5 */
+    0x1.0p1001L + 0x1.0p-323Li,		/* #6 */
+    0x1.0p-1037L + 0x1.0p-1058Li,	/* #7 */
+    0x1.0p-1073L + 0x1.0p-1074Li,	/* #8 */
+    0x1.0p1023L + 0x1.0p1023Li,		/* #9 */
+    0x1.0p-343L + 0x1.0p-798Li,		/* #10 */
+    0x1.0p0L + 0x3.0p0Li,		/* #11 */
+    -0x1.0p0L + 0x3.0p0Li,		/* #12 */
+    0x1.0p0L - 0x3.0p0Li,		/* #13 */
+    0x3.0p0L + 0x1.0p0Li,		/* #14 */
+    0x3.0p0L + 0x4.0p0Li,		/* #15 */
+    -0x2.0p0L + 0x8.0p-10Li,		/* #16 */
+    0x1.0p0L + 0x3.0p-20Li,		/* #17 */
+    0x1.0p0L + 0x3.0p0Li,		/* #18 */
+    0x1.0p0L + 0x3.0p0Li,		/* #19 */
+    0x1.0p0L + 0x3.0p0Li,		/* #20 */
+    0x1.0p0L + 0x3.0p0Li,		/* #21 */
+    0x1.0p0L + 0x3.0p0Li,		/* #22 */
+    0x1.0p0L + 0x3.0p0Li,		/* #23 */
+    0x1.0p0L + 0x3.0p0Li,		/* #24 */
+    0x1.0p0L + 0x3.0p0Li,		/* #25 */
+    0x1.0p0L + 0x3.0p0Li,		/* #26 */
+    0x1.0p0L + 0x3.0p0Li,		/* #27 */
+    0x1.0p0L + 0x3.0p0Li,		/* #28 */
+    0x3.0p0L + 0x4.0p0Li,		/* #29 */
+    0x3.0p0L - 0x4.0p0Li,		/* #30 */
+    -0x3.0p0L - 0x4.0p0Li,		/* #31 */
+    0x3.0p-20L + 0x1.0p0Li,		/* #32 */
+    0x1.0p-80L + 0x1.0p0Li,		/* #33 */
+    0x1.0p-80L + 0x1.0p0Li,		/* #34 */
+    0x1.0p0L + 0x1.0p-8000Li,		/* #35 */
+    0x1.0p0L + 0x1.0p-8000Li,		/* #36 */
+    -0x1.0p0L + 0x1.0p-8000Li,		/* #37 */
+    0x1.0p0L - 0x1.0p-8000Li,		/* #38 */
+    0x1.0p0L + 0x1.0p-8000Li,		/* #39 */
+    0x1.0p100L + 0x1.0p-8000Li,		/* #40 */
+    0x1.97530p100L + 0x1.0p-8000Li,	/* #41 */
+    0x1.97530p300L + 0x1.0p-8000Li,	/* #42 */
+    0x1.0p-6000L + 0x1.97530p3770Li,	/* #43 */
+    0x1.0p-5000L + 0x1.97530p4770Li,	/* #44 */
+    0x1.0p-9000L + 0x1.97530p0Li,	/* #45 */
+    0x1.0p-8000L + 0x1.97530p1000Li,	/* #46 */
+    0x1.0p-7000L + 0x1.97530p2000Li,	/* #47 */
+    0x1.0p-6000L + 0x1.97530p3000Li,	/* #48 */
+    0x1.0p-5000L + 0x1.97530p4000Li,	/* #49 */
+    0x1.0p-4000L + 0x1.97530p5000Li,	/* #50 */
+    0x1.0p-3000L + 0x1.97530p6000Li,	/* #51 */
+    0x1.0p-2000L + 0x1.97530p7000Li,	/* #52 */
+    0x1.0p-1000L + 0x1.97530p8000Li,	/* #53 */
+    0x1.0p-0L + 0x1.97530p900Li,	/* #54 */
+    0x1.97530p100L + 0x1.0000p100Li,	/* #55 */
+    0x1.97530p50L + 0x1.0000p50Li,	/* #56 */
+    0x1.97530p100L + 0x1.0000p50Li,	/* #57 */
+    0x1.97530p1L + 0x1.0000p1Li,	/* #58 */
+    0x1.97530p1L + 0x1.0000p1Li,	/* #59 */
+    0x1.97530p1L + 0x1.0000p1Li,	/* #60 */
+    0x1.0p656L + 0x1.0p-730Li,		/* #61 */
+    0x1.0p656L + 0x1.0p-730Li,		/* #62 */
+    0x1.0p-500L + 0x1.0p-1000Li,	/* #63 */
+    0x1.0p0L + 0x1.0p-500Li,		/* #64 */
+    0x1.0p-110L + 0x1.0p-500Li,		/* #65 */
+    0x1.0p-155L + 0x1.0p-500Li,		/* #66 */
+    0x1.0p-156L + 0x1.0p-500Li,		/* #67 */
+    0x1.0p-160L + 0x1.0p-500Li,		/* #68 */
+    0x1.0p-210L + 0x1.0p-500Li,		/* #69 */
+    0x1.0p-310L + 0x1.0p-500Li,		/* #70 */
+    0x1.0p-410L + 0x1.0p-500Li,		/* #71 */
+    0x1.0p-510L + 0x1.0p-600Li,		/* #72 */
+    0x1.0p-610L + 0x1.0p-700Li,		/* #73 */
+    0x5.0p1L + 0x12.0p1Li,		/* #74 */
+    0x5.0p1L + 0x12.0p1Li,		/* #75 */
+    0x5.0p1L + 0x12.0p1Li,		/* #76 */
+    0x5.0p1L + 0x12.0p1Li,		/* #77 */
+    0x5.0p1L + 0x12.0p1Li,		/* #78 */
+    0x5.0p1L + 0x12.0p1Li,		/* #79 */
+    0x5.0p1L + 0x12.0p1Li,		/* #80 */
+    0x3.1p0L + 0x1.1p0Li,		/* #81 */
+    -0x3.0p0L + 0x1.1p0Li,		/* #82 */
+    -0x3.0p0L + 0x1.1p0Li,		/* #83 */
+    0x3.0p0L + 0x1.1p0Li,		/* #84 */
+    0x3.0p0L + 0x1.1p0Li,		/* #85 */
+    0x1.456789p2L - 0x1.789123p1Li,	/* #86 */
+    0x1.124569p2L - 0x1.781239p3Li,	/* #87 */
+    0x1.123457p3L - 0x1.789126p4Li,	/* #88 */
+    0x1.123456p1L + 0x1.891237p4Li,	/* #89 */
+    0x1.123456p2L + 0x1.357123p3Li,	/* #90 */
+    0x1.123456p3L - 0x1.789123p1Li,	/* #91 */
+    0x1.123456p1L - 0x1.789123p4Li,	/* #92 */
+    0x1.123456p2L + 0x1.789123p1Li,	/* #93 */
+    0x1.123456p3L + 0x1.789123p0Li,	/* #94 */
+    -0x1.123456p1L - 0x1.789153p-2Li,	/* #95 */
+    -0x1.123456p2L - 0x1.785123p7Li,	/* #96 */
+    -0x1.123456p3L + 0x1.789123p9Li,	/* #97 */
+    0x1.123456p1L - 0x1.789123p20Li,	/* #98 */
+    0x1.123456p2L - 0x1.337788p21Li,	/* #99 */
+    0x1.123457p3L - 0x1.789991p3Li	/* #100 */
+  };
+
+__complex FTYPE z[NUMCNT] =
+  {
+    0x1.0p-1023L - 0x1.0p-1023Li,	/* #1 */
+    0x1.0p1023L + 0x0.0p0Li,		/* #2 */
+    0x1.0p346L - 0x1.0p-1008Li,		/* #3 */
+    0x1.0p1023L + 0x0.0p0Li,		/* #4 */
+    0x1.0p364L - 0x1.0p-1072Li,		/* #5 */
+    0x1.0p-1072L + 0x1.0p20Li,		/* #6 */
+    0x1.ffffffffff800000000020p+961L + 0x1.ffffffffff800000000020p+982Li,/* #7 */
+    0x1.3333333333333333333333333333p-1L + 0x1.999999999999999999999999999ap-3Li,/* #8 */
+    0.001953125L - 0.001953125Li,	/* #9 */
+    0x1.000000000000000000000000000p-279L + 0x1.f800000000000000000000000000p-729Li,/* #10 */
+    0x1.0p0L + 0x0.0p0Li,		/* #11 */
+    0x1.0p0L + 0x0.0p0Li,		/* #12 */
+    0x1.0p0L + 0x0.0p0Li,		/* #13 */
+    0x1.0p0L + 0x0.0p0Li,		/* #14 */
+    0x1.0p0L + 0x0.0p0Li,		/* #15 */
+    -0x1.fffe0061ff9e0063ff9c0063ff9cp-2L - 0x1.ff9e0061ff9c0063ff9c0063ff9cp-10Li,/* #16 */
+    0x1.0000000000000000000030000000p+0L + 0x1.ffffffffee00000000a1fffffffap-65Li,/* #17 */
+    0x1.0000000000001333333333333333p+0L + 0x1.9999999999999999999999999999p-54Li,/* #18 */
+    0x1.0000000000002666666666666666p+0L + 0x1.9999999999999999999999999999p-53Li,/* #19 */
+    0x1.0000000000004ccccccccccccccdp+0L + 0x1.9999999999999999999999999999p-52Li,/* #20 */
+    0x1.000000000000999999999999999ap+0L + 0x1.999999999999999999999999999ap-51Li,/* #21 */
+    0x1.0000000000013333333333333333p+0L + 0x1.999999999999999999999999999ap-50Li,/* #22 */
+    0x1.0000000000026666666666666666p+0L + 0x1.999999999999999999999999999ap-49Li,/* #23 */
+    0x1.000000000004cccccccccccccccdp+0L + 0x1.999999999999999999999999999ap-48Li,/* #24 */
+    0x1.fffffffffff66666666666666666p-1L - 0x1.999999999999999999999999999ap-48Li,/* #25 */
+    0x1.ffffffffffeccccccccccccccccdp-1L - 0x1.999999999999999999999999999ap-47Li,/* #26 */
+    0x1.ffffffffff666666666666666666p-1L - 0x1.999999999999999999999999999ap-44Li,/* #27 */
+    0x1.fffffffffecccccccccccccccccdp-1L - 0x1.999999999999999999999999999ap-43Li,/* #28 */
+    0x1.6666666666666666666666666666p+0L - 0x1.999999999999999999999999999ap-3Li,/* #29 */
+    0x0.0p0L + 0x1.0p0Li,				/* #30 */
+    -0x1.47ae147ae147ae147ae147ae147bp-39L - 0x1.0000000001eb851eb851eb851eb8p+0Li,/* #31 */
+    0x1.0000000000000000000030000000p+0L - 0x1.ffffffffee00000000a1fffffffap-65Li,/* #32 */
+    0x1.00000000000000p0L - 0x1.0000000000000p-124Li,	/* #33 */
+    0x1.00000000000000p0L + 0x1.0000000000000p-80Li,	/* #34 */
+    0x1.00000000000000p0L + 0x1.0000000000000p-8044Li,	/* #35 */
+    -0x1.00000000000000p0L + 0x1.0000000000080p-7999Li,	/* #36 */
+    0x1.00000000000000p0L - 0x1.0000000000000p-8044Li,	/* #37 */
+    -0x1.00000000000000p0L + 0x1.0000000000000p-8044Li,	/* #38 */
+    0x1.00000000000000p0L - 0x1.0000000000080p-7999Li,	/* #39 */
+    0x1.00000000000000p+900L - 0x1.0000000000000p-7200Li,/* #40 */
+    0x1.0000000000000000000000000000p+900L - 0x1.41c9b303bfbf1bb3465e771d2c5fp-7201Li,/* #41 */
+    0x1.0000000000000000000000000000p+2700L - 0x1.41c9b303bfbf1bb3465e771d2c5fp-5601Li,/* #42 */
+    0x1.41c9b303bfb510p-9771L - 0x1.0000000000000p0Li,	/* #43 */
+    0x1.41c9b303bfb510p-9771L - 0x1.0000000000000p0Li,	/* #44 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #45 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #46 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #47 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #48 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #49 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #50 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #51 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #52 */
+    -0x1.41c9b303bfb50d65ae407974c131p-9045L - 0x1.0000000000000000000000000000p+0Li,/* #53 */
+    0x1.41c9b303bfb50d65ae407974c131p+7199L - 0x1.0000000000000000000000000000p+8100Li,/* #54 */
+    0x1.6f0647208a31a185daaf720445b3p+9899L - 0x1.cd580bc4697c9439a5da55b27b9dp+9898Li,/* #55 */
+    0x1.6f0647208a31a185daaf720445b3p+10049L - 0x1.cd580bc4697c9439a5da55b27b9dp+10048Li,/* #56 */
+    0x1.fffffffffffffffffffffffff35cp+7899L - 0x1.41c9b303bfb50d65ae407974b940p+7849Li,/* #57 */
+    0x1.6f0647208a31a185daaf720445b3p+6998L -0x1.cd580bc4697c9439a5da55b27b9dp+6997Li,/* #58 */
+    0x1.00000000000000p5999L + 0x0.0000000000000p0Li,	/* #59 */
+    0x1.00000000000000p5199L + 0x0.0000000000000p0Li,	/* #60 */
+    0x1.0p364L - 0x1.0p-1022Li,				/* #61 */
+    0x1.0p264L + 0x0.0p0Li,				/* #62 */
+    0x1.0p1004L + 0x1.0p1023Li,				/* #63 */
+    0x1.0p1004L - 0x1.0p504Li,				/* #64 */
+    0x1.0p1020L - 0x1.0p630Li,				/* #65 */
+    0x1.0p1020L - 0x1.0p675Li,				/* #66 */
+    0x1.0p1020L - 0x1.0p676Li,				/* #67 */
+    0x1.0p1020L - 0x1.0p680Li,				/* #68 */
+    0x1.0p1020L - 0x1.0p730Li,				/* #69 */
+    0x1.0p1020L - 0x1.0p830Li,				/* #70 */
+    0x1.0p1020L - 0x1.0p930Li,				/* #71 */
+    0x1.0p1020L - 0x1.0p930Li,				/* #72 */
+    0x1.0p1020L - 0x1.0p930Li,				/* #73 */
+    0x1.16f21023358c1a682913ce1ecedbp+1L - 0x1.f5b3b6a5c6c8fc5516bd3fd10df0p+2Li,/* #74 */
+    0x1.408cd63069a0a44f387b3b6a5c6dp+1L - 0x1.6a5c6c8fc5516bd3fd10defdcca7p+0Li,/* #75 */
+    0x1.4b8d91f8aa2d7a7fa21bdfb994e8p+1L - 0x1.ee6539f2cbeb7618f09892b4726ep+2Li,/* #76 */
+    0x1.0bc8408cd63069a0a44f387b3b6ap+1L - 0x1.daceda971b23f1545af4ff4437bfp+2Li,/* #77 */
+    0x1.e2a8b5e9fe886f7ee6539f2cbeb7p-1L + 0x1.a682913ce1eceda971b23f1545afp-3Li,/* #78 */
+    0x1.c3d9db52e3647e2a8b5e9fe886f8p-2L + 0x1.77908119ac60d341489e70f676d5p-7Li,/* #79 */
+    0x1.16bd3fd10defdcca73e597d6ec32p-3L - 0x1.f5bb0c784c495a393703aae942c0p-2Li,/* #80 */
+    0x1.2b9c43596635aca22a41182c285ap+10L - 0x1.9fc933bd0b3ad039dc99076c4ce5p+8Li,/* #81 */
+    0x1.3079a1638e441f32a5aa1b723a40p+10L + 0x1.af56ff5f5ee08187c006518c7d30p+8Li,/* #82 */
+    -0x1.3079a23d4567c32f17cb15076791p+10L - 0x1.af56f5c477a85482b70a5dca7d62p+8Li,/* #83 */
+    -0x1.3079a23d4567c32f17cb15076791p+10L + 0x1.af56f5c477a85482b70a5dca7d62p+8Li,/* #84 */
+    0x1.3079a1638e441f32a5aa1b723a40p+10L - 0x1.af56ff5f5ee08187c006518c7d30p+8Li,/* #85 */
+    0x1.a27419691d7845d82a1a772258e1p+1L - 0x1.5e60a434afdfd9c1419d2d842cc2p+1Li,/* #86 */
+    0x1.004a6235052b9121263d9c6bbcf4p+1L - 0x1.077970d2017e9637b3c295f86c7cp-10Li,/* #87 */
+    -0x1.8825f329396f03f5c813952be304p-1L + 0x1.492fb9aef1c34c5b463f22218a07p-1Li,/* #88 */
+    0x1.f6417093502e5e03be9d91d13905p-1L - 0x1.0d936b36d23867a75c17114df9ecp-2Li,/* #89 */ 
+    0x1.2e6b76d3c1a73913587096f2fbbdp+1L + 0x1.4911f033da9e45b4f001b864e760p-3Li,/* #90 */
+    0x1.a1ced84e145e8f5819427f5ea14ep-5L + 0x1.61ced4d722d37f7966cd7c068306p+1Li,/* #91 */
+    0x1.064f7bc3e4833b1e0eff54a3a904p+0L + 0x1.1551c3ae74bd101253588f742243p-2Li,/* #92 */
+    -0x1.344545d341aa8a2f9369a5ec3128p+0L - 0x1.2aa5da272dd3d1102e6c406cbc70p+2Li,/* #93 */
+    -0x1.06d98474fe894386c4fbcde25e3bp-1L + 0x1.6ad8d7df1b0c7bd93084ecbd82ebp+1Li,/* #94 */
+    -0x1.6deb5a7bec3179206289e83a4b65p+2L - 0x1.4028b8d0a2fc1a39d6eea3f8bb57p+3Li,/* #95 */
+    0x1.fbd4560086545ef1cd464e251162p-4L + 0x1.8c3278a9ca9b4301daab9f0d2131p-5Li,/* #96 */
+    -0x1.0106f72f51797fe080e71a8997a9p-5L - 0x1.69200e9aa701c65e7069852801a9p-7Li,/* #97 */ 
+    -0x1.00000929d9955dc02885e23cfb27p-16L - 0x1.74d2319d4234332ac55f42cc52d5p-18Li,/* #98 */
+    -0x1.39887db89b6869b8281a9f4222eep-17L + 0x1.c89cdfee34a155f4544297ef8798p-19Li,/* #99 */
+    0x1.a746a452d342fdd9745efdf4d52ap+0L - 0x1.e72d9f35e28e6208e42c8cc5a560p-2Li/* #100 */
+  };
+
+
+__complex FTYPE errmax[NUMCNT] =
+  {
+    0x0.000000000000000000000000p0L + 0x0.000000000000000000000000p0Li,/* #1 */
+    0x0.000000000000000000000001p1023+ 0x0.000000000000000000000001p0Li,/* #2 */
+    0x0.000000000000000000000001p346L + 0x0.000000000000000100000000p-1008Li,/* #3 */
+    0x0.000000000000000000000001p1023+ 0x0.000000000000000000000001p0Li,/* #4 */
+    0x0.000000000000000000000001p364L + 0x0.000000000000000000000000p0Li,/* #5 */
+    0x0.000000000000000000000000p0L + 0x0.000000000000000000000001p20Li,/* #6 */
+    0x0.000000000000000000000001p961L + 0x0.00000000000000000000001p982Li,/* #7 */
+    0x0.000000000000000000000001p-1L + 0x0.00000000000000000000001p-3Li,	/* #8 */
+    0x0.000000000000000000000001p-9L + 0x0.000000000000000000000001p-9Li,/* #9 */
+    0x0.000000000000000000000001p279L + 0x0.0000000000000000000000001p-171Li,/* #10 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000000001p0Li,/* #11 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #12 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #13 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #14 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #15 */
+    0x0.000000000000000000000001p33L + 0x0.0000000000000000000001p-10Li,/* #16 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-65Li,/* #17 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-54Li,/* #18 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-53Li,/* #19 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-52Li,/* #20 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-51Li,/* #21 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-50Li,/* #22 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-49Li,/* #23 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-48Li,/* #24 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-48Li,/* #25 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-47Li,/* #26 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-44Li,/* #27 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-43Li,/* #28 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-3Li,/* #29 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #30 */
+    0x0.000000000000000000000001p-39L + 0x0.0000000000000000000001p0Li,/* #31 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-65Li,/* #32 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-124Li,/* #33 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-80Li,/* #34 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-8044Li,/* #35 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-7999Li,/* #36 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-8044Li,/* #37 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-8044Li,/* #38 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-7999Li,/* #39 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-7200Li,/* #40 */
+    0x0.000000000000000000000001p900L + 0x0.0000000000000000000001p-720Li,/* #41 */
+    0x0.000000000000000000000001p2700L + 0x0.0000000000000000000001p-560Li,/* #42 */
+    0x0.000000000000100000000000p-9771L+ 0x0.0000000000000000000001p0Li,/* #43 */
+    0x0.000000000000100000000001p-9771L+ 0x0.0000000000000000000001p0Li,/* #44 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #45 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #46 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #47 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #48 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #49 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #50 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #51 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #52 */
+    0x0.000000000000000000000001p-9045L+ 0x0.0000000000000000000001p0Li,/* #53 */
+    0x0.000000000000000000000001p7199L+ 0x0.0000000000000000000001p8100Li,/* #54 */
+    0x0.000000000000000000000001p9899L+ 0x0.0000000000000000000001p9898Li,/* #55 */
+    0x0.000000000000000000000001p10049L+ 0x0.0000000000000000000001p10048Li,/* #56 */
+    0x0.000000000000000000000001p7899L+ 0x0.0000000000000000000001p7849Li,/* #57 */
+    0x0.000000000000000000000001p6998L+ 0x0.0000000000000000000001p6997Li,/* #58 */
+    0x0.000000000000000000000001p5999L+ 0x0.0000000000000000000001p0Li,/* #59 */
+    0x0.000000000000000000000001p5199L+ 0x0.0000000000000000000001p0Li,/* #60 */
+    0x0.000000000000000000000001p364L+ 0x0.0000000000000000000000p0Li,/* #61 */
+    0x0.000000000000000000000001p264L+ 0x0.0000000000000000000001p0Li,/* #62 */
+    0x0.000000000000000000000001p1004L+ 0x0.0000000000000000000001p1023Li,/* #63 */
+    0x0.000000000000000000000001p1004L+ 0x0.0000000000000000000001p504Li,/* #64 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p630Li,/* #65 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p675Li,/* #66 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p676Li,/* #67 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p680Li,/* #68 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p730Li,/* #69 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p830Li,/* #70 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p930Li,/* #71 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p930Li,/* #72 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p930Li,/* #73 */
+    0x0.000000000000000000000001p7L + 0x0.0000000000000000000001p0Li,/* #74 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p0Li,/* #75 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p2Li,/* #76 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p2Li,/* #77 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-3Li,/* #78 */
+    0x0.000000000000000000000001p-2L + 0x0.0000000000000000000001p-7Li,/* #79 */
+    0x0.000000000000000000000001p-3L + 0x0.0000000000000000000001p-2Li,/* #80 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #81 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #82 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #83 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #84 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #85 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p1Li,/* #86 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p-10Li,/* #87 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-1Li,/* #88 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-2Li,/* #89 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p-3Li,/* #90 */
+    0x0.000000000000000000000001p-5L + 0x0.0000000000000000000001p1Li,/* #91 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-2Li,/* #92 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p2Li,/* #93 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p1Li,/* #94 */
+    0x0.000000000000000000000001p2L + 0x0.0000000000000000000001p3Li,/* #95 */
+    0x0.000000000000000000000001p-4L + 0x0.0000000000000000000001p-5Li,/* #96 */
+    0x0.000000000000000000000001p-5L + 0x0.0000000000000000000001p-7Li,/* #97 */
+    0x0.000000000000000000000001p-16L + 0x0.0000000000000000000001p-18Li,/* #98 */
+    0x0.000000000000000000000001p-17L + 0x0.0000000000000000000001p-19Li,/* #99 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-2Li/* #100 */
+  };
+
+
+int main(int argc, char** argv)
+{
+  int i;
+  FTYPE xr, xi, yr, yi, zr, zi, zzr, zzi;
+  FTYPE er, ei;
+  __complex FTYPE ans[NUMCNT];
+  int errcnt;
+
+  errcnt = 0;
+  for (i = 0; i < NUMCNT; i++)
+    {
+      ans[i] = x[i] / y[i];
+      if( z[i] != z[i] )   /* Check for nan/inf case */
+	{
+	  zr = __real__ z[i];
+	  zi = __imag__ z[i];
+	  zzr = __real__ ans[i];
+	  zzi = __imag__ ans[i];
+	  er = __real__ errmax[i];
+	  ei = __imag__ errmax[i];
+	  errcnt++;
+	  printf("x %3d    " FMT " " FMT "i\n",
+		 i + 1, __real__ x[i], __imag__ x[i]);
+	  printf ("y %3d   " FMT " " FMT "i\n",
+		  i + 1, __real__ y[i], __imag__ y[i]);
+	  printf("expected " FMT " " FMT "i\n",
+		 __real__ z[i], __imag__ z[i]);
+	  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+		 __real__ ans[i], __imag__ ans[i], i + 1);
+	  printf("diff     " FMT " " FMT "i\n",
+		 zr - zzr, zi - zzi);
+	  printf("errmax   " FMT " " FMT "i\n\n",
+		 er, ei);
+	}
+      else
+	{
+	  if( z[i] != ans[i] )
+	    {
+	      zr = __real__ z[i];
+	      zi = __imag__ z[i];
+	      zzr = __real__ ans[i];
+	      zzi = __imag__ ans[i];
+	      er = __real__ errmax[i];
+	      ei = __imag__ errmax[i];
+	      if( (FABS(zr-zzr) > er) || (FABS(zi-zzi) > ei))
+		{	 /* report if error exceeds error max */
+		  errcnt++;
+		  printf("x %3d    " FMT " " FMT "i\n",
+			 i + 1, __real__ x[i], __imag__ x[i]);
+		  printf ("y %3d    " FMT " " FMT "i\n",
+			  i + 1, __real__ y[i], __imag__ y[i]);
+		  printf("expected " FMT " " FMT "i\n",
+			 __real__ z[i], __imag__ z[i]);
+		  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+			 __real__ ans[i], __imag__ ans[i], i + 1);
+		  printf("diff     " FMT " " FMT "i\n",
+			 zr - zzr, zi - zzi);
+		  printf("errmax   " FMT " " FMT "i\n\n",
+			 er, ei);
+		}
+	    }
+	}
+    }
+  if( errcnt > 0)
+    {
+      printf("%2d Failures\n",errcnt);
+      abort();
+    }
+  printf("PASS\n");
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59714_32.c b/gcc/testsuite/gcc.c-torture/execute/pr59714_32.c
new file mode 100644
index 0000000..170e363
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59714_32.c
@@ -0,0 +1,506 @@
+#include <stdio.h>
+#include <math.h>
+
+extern void abort (void);
+#define FABS(x) ((x) >= 0 ? (x) : -(x))
+#define FTYPE   float
+#define FMT     "%-17.6a"
+
+/*
+   Tables of numbers for complex division testing
+   All values in hex format
+   z[i] == correctly rounded value of x[i]/y[i];
+ */
+
+#define NUMCNT 100
+
+__complex FTYPE x[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p0i,			/* #1 */
+    0x1.0p0 + 0x1.0p0i,			/* #2 */
+    0x1.0p127 + 0x1.0p-126i,		/* #3 */
+    0x1.0p127 + 0x1.0p127i,		/* #4 */
+    0x1.0p124 + 0x1.0p-44i,		/* #5 */
+    0x1.0p-71 + 0x1.0p125i,		/* #6 */
+    0x1.0p-47 + 0x1.0p-54i,		/* #7 */
+    0x1.0p-149 + 0x1.0p-149i,		/* #8 */
+    0x1.0p120 + 0x1.0p-89i,		/* #9 */
+    0x1.0p-22 + 0x1.0p-146i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    0x1.0p0 - 0x3.000002p-20i,		/* #16 */
+    0x1.0p0 + 0x3.000002p-20i,		/* #17 */
+    0x1.0p0 + 0x1.800002p1i,		/* #18 */
+    0x1.0p0 + 0x1.800004p1i,		/* #19 */
+    0x1.0p0 + 0x1.800008p1i,		/* #20 */
+    0x1.0p0 + 0x1.800010p1i,		/* #21 */
+    0x1.0p0 + 0x1.800020p1i,		/* #22 */
+    0x1.0p0 + 0x1.800040p1i,		/* #23 */
+    0x1.0p0 + 0x1.800080p1i,		/* #24 */
+    0x1.0p0 + 0x1.7ffff8p1i,		/* #25 */
+    0x1.0p0 + 0x1.7ffff0p1i,		/* #26 */
+    0x1.0p0 + 0x1.7fff80p1i,		/* #27 */
+    0x1.0p0 + 0x1.7fff00p1i,		/* #28 */
+    0x5.0p0 + 0x5.0p0i,			/* #29 */
+    0x4.0p0 + 0x3.0p0i,			/* #30 */
+    -0x4.0p0 + 0x3.000004p0i,           /* #31 */
+    0x3.000004p-20 + 0x1.0p0i,		/* #32 */
+    0x1.000002p-80 + 0x1.0p0i,		/* #33 */
+    0x1.000002p-100 + 0x1.0p0i,		/* #34 */
+    0x1.0p0 + 0x1.000002p-100i,		/* #35 */
+    -0x1.0p0 + 0x1.000002p-100i,	/* #36 */
+    -0x1.0p0 + 0x1.000002p-100i,	/* #37 */
+    -0x1.0p0 + 0x1.000002p-100i,	/* #38 */
+    0x1.0p0 - 0x1.000002p-100i,		/* #39 */
+    0x1.0p40 - 0x1.000010p-60i,		/* #40 */
+    0x1.975300p50 - 0x1.000002p-100i,	/* #41 */
+    0x1.975300p100 - 0x1.000002p-100i,	/* #42 */
+    0x1.975300p77 - 0x1.000002p-60i,	/* #43 */
+    0x1.975300p87 - 0x1.000002p-60i,	/* #44 */
+    0x1.975300p0 - 0x1.000002p-60i,	/* #45 */
+    0x1.975300p50 - 0x1.000002p-60i,	/* #46 */
+    0x1.975300p60 - 0x1.000002p-60i,	/* #47 */
+    0x1.975300p70 - 0x1.000002p-60i,	/* #48 */
+    0x1.975300p80 - 0x1.000002p-60i,	/* #49 */
+    0x1.975300p90 - 0x1.000002p-60i,	/* #50 */
+    0x1.975300p100 - 0x1.000002p-60i,	/* #51 */
+    0x1.975300p110 - 0x1.000002p-60i,	/* #52 */
+    0x1.975300p115 - 0x1.000002p-60i,	/* #53 */
+    0x1.975300p120 - 0x1.000002p-0i,	/* #54 */
+    0x1.975300p125 + 0x1.000002p70i,	/* #55 */
+    0x1.975300p126 + 0x1.000000p80i,	/* #56 */
+    0x1.975300p100 + 0x1.000000p90i,	/* #57 */
+    0x1.975300p90 + 0x1.000000p95i,	/* #58 */
+    0x1.975300p80 + 0x1.000000p100i,	/* #59 */
+    0x1.97530p72 + 0x1.000000p72i,	/* #60 */
+    0x1.0p120 + 0x1.0p-844i,		/* #61 */
+    0x1.0p90 + 0x1.0p-844i,		/* #62 */
+    0x1.0p54 + 0x1.0p53i,		/* #63 */
+    0x1.0p14 + 0x1.0p-51i,		/* #64 */
+    0x1.0p90 + 0x1.0p-51i,		/* #65 */
+    0x1.0p85 + 0x1.0p-51i,		/* #66 */
+    0x1.0p84 + 0x1.0p-51i,		/* #67 */
+    0x1.0p80 + 0x1.0p-51i,		/* #68 */
+    0x1.0p81 + 0x1.0p-51i,		/* #69 */
+    0x1.0p71 + 0x1.0p-51i,		/* #70 */
+    0x1.0p61 + 0x1.0p-51i,		/* #71 */
+    0x1.0p51 + 0x1.0p-51i,		/* #72 */
+    0x1.0p41 + 0x1.0p-51i,		/* #73 */
+    0x13.0p4 + 0x1.0p-4i,		/* #74 */
+    0x13.0p2 + 0x13.0p2i,		/* #75 */
+    0x13.0p4 + 0x1.0p4i,		/* #76 */
+    0x12.0p4 + 0x12.0p-4i,		/* #77 */
+    0x1.0p1 + 0x12.0p1i,		/* #78 */
+    0x1.0p2 + 0x1.0p4i,			/* #79 */
+    0x13.0p0 + 0x0.0p0i,		/* #80 */
+    0x1.01p12 - 0x1.037p-12i,		/* #81 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #82 */
+    0x1.01p12 - 0x1.037p-12i,		/* #83 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #84 */
+    0x1.01p12 - 0x1.037p-12i,		/* #85 */
+    0x1.123456p3 - 0x1.789123p4i,	/* #86 */
+    0x1.123457p3 - 0x1.789123p4i,	/* #87 */
+    0x1.123458p3 + 0x1.789123p4i,	/* #88 */
+    0x1.123456p3 + 0x1.789122p4i,	/* #89 */
+    0x1.123456p3 + 0x1.789121p4i,	/* #90 */
+    0x1.123456p3 + 0x1.789120p4i,	/* #91 */
+    0x1.123455p3 - 0x1.789123p4i,	/* #92 */
+    0x1.123454p3 - 0x1.789122p4i,	/* #93 */
+    -0x1.123453p3 + 0x1.789121p4i,	/* #94 */
+    0x1.123452p3 + 0x1.789120p4i,	/* #95 */
+    0x1.123451p3 - 0x1.789127p4i,	/* #96 */
+    0x1.123459p3 - 0x1.789125p4i,	/* #97 */
+    -0x1.123450p3 + 0x1.789124p4i,	/* #98 */
+    0x1.123456p3 + 0x1.789123p4i,	/* #99 */
+    0x1.123456p3 - 0x1.789123p4i	/* #100 */
+  };
+
+__complex FTYPE y[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p127i,		/* #1 */
+    0x1.0p-126 + 0x1.0p-126i,		/* #2 */
+    0x1.0p77 + 0x1.0p-77i,		/* #3 */
+    0x1.0p0 + 0x1.0p0i,			/* #4 */
+    0x1.0p65 + 0x1.0p-78i,		/* #5 */
+    0x1.0p99 + 0x1.0p-33i,		/* #6 */
+    0x1.0p-133 + 0x1.0p-140i,		/* #7 */
+    0x1.0p-148 + 0x1.0p-148i,		/* #8 */
+    0x1.0p127 + 0x1.0p127i,		/* #9 */
+    0x1.0p-34 + 0x1.0p-79i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    -0x2.0p0 + 0x8.0p-10i,		/* #16 */
+    0x1.0p0 + 0x3.0p-20i,		/* #17 */
+    0x1.0p0 + 0x3.0p0i,			/* #18 */
+    0x1.0p0 + 0x3.0p0i,			/* #19 */
+    0x1.0p0 + 0x3.0p0i,			/* #20 */
+    0x1.0p0 + 0x3.0p0i,			/* #21 */
+    0x1.0p0 + 0x3.0p0i,			/* #22 */
+    0x1.0p0 + 0x3.0p0i,			/* #23 */
+    0x1.0p0 + 0x3.0p0i,			/* #24 */
+    0x1.0p0 + 0x3.0p0i,			/* #25 */
+    0x1.0p0 + 0x3.0p0i,			/* #26 */
+    0x1.0p0 + 0x3.0p0i,			/* #27 */
+    0x1.0p0 + 0x3.0p0i,			/* #28 */
+    0x3.0p0 + 0x4.0p0i,			/* #29 */
+    0x3.0p0 - 0x4.0p0i,			/* #30 */
+    -0x3.0p0 - 0x4.0p0i,		/* #31 */
+    0x3.0p-20 + 0x1.0p0i,		/* #32 */
+    0x1.000000p-80 + 0x1.0p0i,		/* #33 */
+    0x1.0p-80 + 0x1.0p0i,		/* #34 */
+    0x1.0p0 + 0x1.0p-60i,		/* #35 */
+    0x1.0p0 + 0x1.0p-60i,		/* #36 */
+    -0x1.0p0 + 0x1.0p-60i,		/* #37 */
+    0x1.0p0 - 0x1.0p-60i,		/* #38 */
+    0x1.0p0 + 0x1.0p-60i,		/* #39 */
+    0x1.0p40 + 0x1.0p-60i,		/* #40 */
+    0x1.97530p50 + 0x1.0p-60i,		/* #41 */
+    0x1.97530p80 + 0x1.0p-60i,		/* #42 */
+    0x1.0p-60 + 0x1.97530p57i,		/* #43 */
+    0x1.0p-50 + 0x1.97530p57i,		/* #44 */
+    0x1.0p-90 + 0x1.97530p0i,		/* #45 */
+    0x1.0p-80 + 0x1.97530p10i,		/* #46 */
+    0x1.0p-70 + 0x1.97530p20i,		/* #47 */
+    0x1.0p-60 + 0x1.97530p30i,		/* #48 */
+    0x1.0p-50 + 0x1.97530p40i,		/* #49 */
+    0x1.0p-40 + 0x1.97530p50i,		/* #50 */
+    0x1.0p-30 + 0x1.97530p60i,		/* #51 */
+    0x1.0p-20 + 0x1.97530p70i,		/* #52 */
+    0x1.0p-10 + 0x1.97530p80i,		/* #53 */
+    0x1.0p-0 + 0x1.97530p90i,		/* #54 */
+    0x1.97530p10 + 0x1.0000p10i,	/* #55 */
+    0x1.97530p50 + 0x1.0000p50i,	/* #56 */
+    0x1.97530p10 + 0x1.0000p50i,	/* #57 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #58 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #59 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #60 */
+    0x1.0p66 + 0x1.0p-73i,		/* #61 */
+    0x1.0p66 + 0x1.0p-73i,		/* #62 */
+    0x1.0p-50 + 0x1.0p-100i,		/* #63 */
+    0x1.0p0 + 0x1.0p-50i,		/* #64 */
+    0x1.0p-11 + 0x1.0p-50i,		/* #65 */
+    0x1.0p-14 + 0x1.0p-50i,		/* #66 */
+    0x1.0p-15 + 0x1.0p-50i,		/* #67 */
+    0x1.0p-16 + 0x1.0p-50i,		/* #68 */
+    0x1.0p-21 + 0x1.0p-50i,		/* #69 */
+    0x1.0p-31 + 0x1.0p-50i,		/* #70 */
+    0x1.0p-41 + 0x1.0p-50i,		/* #71 */
+    0x1.0p-51 + 0x1.0p-60i,		/* #72 */
+    0x1.0p-61 + 0x1.0p-70i,		/* #73 */
+    0x5.0p1 + 0x12.0p1i,		/* #74 */
+    0x5.0p1 + 0x12.0p1i,		/* #75 */
+    0x5.0p1 + 0x12.0p1i,		/* #76 */
+    0x5.0p1 + 0x12.0p1i,		/* #77 */
+    0x5.0p1 + 0x12.0p1i,		/* #78 */
+    0x5.0p1 + 0x12.0p1i,		/* #79 */
+    0x5.0p1 + 0x12.0p1i,		/* #80 */
+    0x3.1p0 + 0x1.1p0i,			/* #81 */
+    -0x3.0p0 + 0x1.1p0i,		/* #82 */
+    -0x3.0p0 + 0x1.1p0i,		/* #83 */
+    0x3.0p0 + 0x1.1p0i,			/* #84 */
+    0x3.0p0 + 0x1.1p0i,			/* #85 */
+    0x1.456789p2 - 0x1.789123p1i,	/* #86 */
+    0x1.124569p2 - 0x1.781239p3i,	/* #87 */
+    0x1.123457p3 - 0x1.789126p4i,	/* #88 */
+    0x1.123456p1 + 0x1.891237p4i,	/* #89 */
+    0x1.123456p2 + 0x1.357123p3i,	/* #90 */
+    0x1.123456p3 - 0x1.789123p1i,	/* #91 */
+    0x1.123456p1 - 0x1.789123p4i,	/* #92 */
+    0x1.123456p2 + 0x1.789123p1i,	/* #93 */
+    0x1.123456p3 + 0x1.789123p0i,	/* #94 */
+    -0x1.123456p1 - 0x1.789153p-2i,	/* #95 */
+    -0x1.123456p2 - 0x1.785123p7i,	/* #96 */
+    -0x1.123456p3 + 0x1.789123p9i,	/* #97 */
+    0x1.123456p1 - 0x1.789123p20i,	/* #98 */
+    0x1.123456p2 - 0x1.337788p21i,	/* #99 */
+    0x1.123457p3 - 0x1.789991p3i	/* #100 */
+  };
+
+__complex FTYPE z[NUMCNT] =
+  {
+    0x1.0p-127 - 0x1.0p-127i,		/* #1 */
+    0x1.0p126 + 0x0.0p0i,		/* #2 */
+    0x1.0p50 - 0x1.0p-104i,		/* #3 */
+    0x1.0p127 + 0x0.0p0i,		/* #4 */
+    0x1.0p59 - 0x1.0p-84i,		/* #5 */
+    0x1.0p-106 + 0x1.0p26i,		/* #6 */
+    0x1.0p86 + 0x0.0p0i,		/* #7 */
+    0x1.0p-1 + 0x0.0p0i,		/* #8 */
+    0x1.0p-8  - 0x1.0p-8i,		/* #9 */
+    0x1.0p12 - 0x1.0p-33i,		/* #10 */
+    0x1.0p0 + 0x0.0p0i,			/* #11 */
+    0x1.0p0 + 0x0.0p0i,			/* #12 */
+    0x1.0p0 + 0x0.0p0i,			/* #13 */
+    0x1.0p0 + 0x0.0p0i,			/* #14 */
+    0x1.0p0 + 0x0.0p0i,			/* #15 */
+    -0x1.fffe00p-2 - 0x1.ff9e00p-10i,	/* #16 */
+    0x1.000000p0 + 0x0.000000p0i,	/* #17 */
+    0x1.000002p0 + 0x1.99999ap-26i,	/* #18 */
+    0x1.000002p0 + 0x1.99999ap-25i,	/* #19 */
+    0x1.000004p0 + 0x1.99999ap-24i,	/* #20 */
+    0x1.00000ap0 + 0x1.99999ap-23i,	/* #21 */
+    0x1.000014p0 + 0x1.99999ap-22i,	/* #22 */
+    0x1.000026p0 + 0x1.99999ap-21i,	/* #23 */
+    0x1.00004cp0 + 0x1.99999ap-20i,	/* #24 */
+    0x1.fffff6p-1 - 0x1.99999ap-24i,	/* #25 */
+    0x1.ffffecp-1 - 0x1.99999ap-23i,	/* #26 */
+    0x1.ffff66p-1 - 0x1.99999ap-20i,	/* #27 */
+    0x1.fffeccp-1 - 0x1.99999ap-19i,	/* #28 */
+    0x1.666666p0 - 0x1.99999ap-3i,	/* #29 */
+    0x0.0p0 + 0x1.0p0i,			/* #30 */
+    -0x1.47ae14p-25 - 0x1.000000p0i,	/* #31 */
+    0x1.000000p0 - 0x1.000000p-42i,	/* #32 */
+    0x1.000000p0 - 0x1.000000p-103i,	/* #33 */
+    0x1.000000p0 + 0x1.ffffe0p-81i,	/* #34 */
+    0x1.000000p0 - 0x1.000000p-60i,	/* #35 */
+    -0x1.000000p0 + 0x1.000000p-60i,	/* #36 */
+    0x1.000000p0 + 0x1.000000p-60i,	/* #37 */
+    -0x1.0000000p0 - 0x1.000000p-60i,	/* #38 */
+    0x1.000000p0 - 0x1.000000p-60i,	/* #39 */
+    0x1.000000p0 - 0x1.000008p-99i,	/* #40 */
+    0x1.000000p0 - 0x1.41c9b4p-111i,	/* #41 */
+    0x1.000000p20 - 0x1.41c9b4p-121i,	/* #42 */
+    0x1.41c99ep-98 - 0x1.000000p20i,	/* #43 */
+    0x1.41c9b4p-78 - 0x1.000000p30i,	/* #44 */
+    -0x1.41c9b6p-61 - 0x1.000000p0i,	/* #45 */
+    0x1.41c99ep-51 - 0x1.000000p40i,	/* #46 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #47 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #48 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #49 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #50 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #51 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #52 */
+    0x1.41c9b4p-56 - 0x1.000000p35i,	/* #53 */
+    0x1.41c9b4p-61 - 0x1.000000p30i,	/* #54 */
+    0x1.6f0648p114 - 0x1.cd580cp113i,	/* #55 */
+    0x1.6f0648p75 - 0x1.cd580cp74i,	/* #56 */
+    0x1.000000p40 - 0x1.975300p50i,	/* #57 */
+    0x1.38e3d6p92 + 0x1.beed4cp92i,	/* #58 */
+    0x1.21f3a0p97 + 0x1.cd57eep97i,	/* #59 */
+    0x1.000000p71 + 0x0.000000p0i,	/* #60 */
+    0x1.000000p54 - 0x1.000000p-85i,	/* #61 */
+    0x1.000000p24 - 0x1.000000p-115i,	/* #62 */
+    0x1.000000p104 + 0x1.000000p103i,	/* #63 */
+    0x1.000000p14 - 0x1.fffc00p-37i,	/* #64 */
+    0x1.000000p101 - 0x1.000000p62i,	/* #65 */
+    0x1.000000p99 - 0x1.000000p63i,	/* #66 */
+    0x1.000000p99 - 0x1.000000p64i,	/* #67 */
+    0x1.000000p96 - 0x1.000000p62i,	/* #68 */
+    0x1.000000p102 - 0x1.000000p73i,	/* #69 */
+    0x1.000000p102 - 0x1.000000p83i,	/* #70 */
+    0x1.ffff80p101 - 0x1.ffff80p92i,	/* #71 */
+    0x1.ffff80p101 - 0x1.ffff80p92i,	/* #72 */
+    0x1.ffff80p101 - 0x1.ffff80p92i,	/* #73 */
+    0x1.16f210p1 - 0x1.f5b3b6p2i,	/* #74 */
+    0x1.408cd6p1 - 0x1.6a5c6cp0i,	/* #75 */
+    0x1.4b8d92p1 - 0x1.ee653ap2i,	/* #76 */
+    0x1.0bc840p1 - 0x1.dacedap2i,	/* #77 */
+    0x1.e2a8b6p-1 + 0x1.a68292p-3i,	/* #78 */
+    0x1.c3d9dcp-2 + 0x1.779082p-7i,	/* #79 */
+    0x1.16bd40p-3 - 0x1.f5bb0cp-2i,	/* #80 */
+    0x1.2b9c44p10 - 0x1.9fc934p8i,	/* #81 */
+    0x1.3079a2p10 + 0x1.af5700p8i,	/* #82 */
+    -0x1.3079a2p10 - 0x1.af56f6p8i,	/* #83 */
+    -0x1.3079a2p10 + 0x1.af56f6p8i,	/* #84 */
+    0x1.3079a2p10 - 0x1.af5700p8i,	/* #85 */
+    0x1.a2741cp1 - 0x1.5e60a4p1i,	/* #86 */
+    0x1.004a64p1 - 0x1.077824p-10i,	/* #87 */
+    -0x1.8825f4p-1 + 0x1.492fbap-1i,	/* #88 */
+    0x1.f64170p-1 - 0x1.0d936ap-2i,	/* #89 */ 
+    0x1.2e6b76p1 + 0x1.4911e4p-3i,	/* #90 */
+    0x1.a1cec6p-5 + 0x1.61ced4p1i,	/* #91 */
+    0x1.064f7cp0 + 0x1.1551c2p-2i,	/* #92 */
+    -0x1.344548p0 - 0x1.2aa5dap2i,	/* #93 */
+    -0x1.06d986p-1 + 0x1.6ad8d8p1i,	/* #94 */
+    -0x1.6deb5ap2 - 0x1.4028b8p3i,	/* #95 */
+    0x1.fbd456p-4 + 0x1.8c3276p-5i,	/* #96 */
+    -0x1.0106f6p-5 - 0x1.69200cp-7i,	/* #97 */ 
+    -0x1.000008p-16 - 0x1.74d230p-18i,	/* #98 */
+    -0x1.39887ep-17 + 0x1.c89ce0p-19i,	/* #99 */
+    0x1.a746a4p0 - 0x1.e72da8p-2i	/* #100 */
+  };
+
+
+__complex FTYPE errmax[NUMCNT] =
+  {
+    0x0.000000p0    + 0x0.000000p0i,	/* #1 */
+    0x0.000002p126  + 0x0.000002p-126i,	/* #2 */
+    0x0.000002p50   + 0x0.000002p-104i,	/* #3 */
+    0x0.000002p127  + 0x0.000002p0i,	/* #4 */
+    0x0.000002p59   + 0x0.000002p-84i,	/* #5 */
+    0x0.000000p-106 + 0x0.000002p26i,	/* #6 */
+    0x0.000002p86   + 0x0.000002p0i,	/* #7 */
+    0x0.000002p-1   + 0x0.000002p0i,	/* #8 */
+    0x0.000002p-8   + 0x0.000002p-8i,	/* #9 */
+    0x0.000002p12   + 0x0.000002p-33i,	/* #10 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #11 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #12 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #13 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #14 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #15 */
+    0x0.000002p-2   + 0x0.000002p-10i,	/* #16 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #17 */
+    0x0.000002p0    + 0x0.000002p-26i,	/* #18 */
+    0x0.000002p0    + 0x0.000002p-25i,	/* #19 */
+    0x0.000002p0    + 0x0.000002p-24i,	/* #20 */
+    0x0.000002p0    + 0x0.000002p-23i,	/* #21 */
+    0x0.000002p0    + 0x0.000002p-22i,	/* #22 */
+    0x0.000002p0    + 0x0.000002p-21i,	/* #23 */
+    0x0.000002p0    + 0x0.000002p-20i,	/* #24 */
+    0x0.000002p-1   + 0x0.000002p-24i,	/* #25 */
+    0x0.000002p-1   + 0x0.000002p-23i,	/* #26 */
+    0x0.000002p-1   + 0x0.000002p-20i,	/* #27 */
+    0x0.000002p-1   + 0x0.000002p-19i,	/* #28 */
+    0x0.000002p0    + 0x0.000002p-3i,	/* #29 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #30 */
+    0x0.000002p-25  + 0x0.000002p0i,	/* #31 */
+    0x0.000002p0    + 0x0.000002p-42i,	/* #32 */
+    0x0.000002p0    + 0x0.000002p-103i,	/* #33 */
+    0x0.000002p0    + 0x0.000002p-81i,	/* #34 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #35 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #36 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #37 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #38 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #39 */
+    0x0.000002p0    + 0x0.000002p-99i,	/* #40 */
+    0x0.000002p0    + 0x0.000002p-111i,	/* #41 */
+    0x0.000002p20   + 0x0.000002p-121i,	/* #42 */
+    0x0.0042000p-98 + 0x0.000002p20i,	/* #43 */
+    0x0.0042000p-78 + 0x0.000002p30i,	/* #44 */
+    0x0.004201p-61 + 0x0.000002p0i,	/* #45 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #46 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #47 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #48 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #49 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #50 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #51 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #52 */
+    0x0.004201p-56 + 0x0.000002p35i,	/* #53 */
+    0x0.004201p-61 + 0x0.000002p30i,	/* #54 */
+    0x0.000002p114 + 0x0.000002p113i,	/* #55 */
+    0x0.000002p75  + 0x0.000002p74i,	/* #56 */
+    0x0.000002p40  + 0x0.000002p50i,	/* #57 */
+    0x0.000002p92  + 0x0.000002p92i,	/* #58 */
+    0x0.000002p97  + 0x0.000002p97i,	/* #59 */
+    0x0.000002p71  + 0x0.000002p0i,	/* #60 */
+    0x0.000002p54  + 0x0.000000p-85i,	/* #61 */
+    0x0.000002p24  + 0x0.000002p-115i,	/* #62 */
+    0x0.000002p104 + 0x0.000002p103i,	/* #63 */
+    0x0.000002p14 + 0x0.000002p-37i,	/* #64 */
+    0x0.000002p101 + 0x0.000002p62i,	/* #65 */
+    0x0.000002p99 + 0x0.000002p63i,	/* #66 */
+    0x0.000002p99 + 0x0.000002p64i,	/* #67 */
+    0x0.000002p96 + 0x0.000002p62i,	/* #68 */
+    0x0.000002p102 + 0x0.000002p73i,	/* #69 */
+    0x0.000002p102 + 0x0.000002p83i,	/* #70 */
+    0x0.000002p101 + 0x0.000002p92i,	/* #71 */
+    0x0.000002p101 + 0x0.000002p92i,	/* #72 */
+    0x0.000002p101 + 0x0.000002p92i,	/* #73 */
+    0x0.000002p1    + 0x0.000002p2i,	/* #74 */
+    0x0.000002p1    + 0x0.000002p0i,	/* #75 */
+    0x0.000002p1    + 0x0.000002p2i,	/* #76 */
+    0x0.000002p1    + 0x0.000002p2i,	/* #77 */
+    0x0.000002p-1   + 0x0.000002p-3i,	/* #78 */
+    0x0.000002p-2   + 0x0.00000ap-7i,	/* #79 */
+    0x0.000002p-3   + 0x0.000002p-2i,	/* #80 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #81 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #82 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #83 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #84 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #85 */
+    0x0.000002p1    + 0x0.000002p1i,	/* #86 */
+    0x0.000002p1    + 0x0.0000c0p-9i,	/* #87 */
+    0x0.000002p-1   + 0x0.000002p-1i,	/* #88 */
+    0x0.000002p-1   + 0x0.000002p-2i,	/* #89 */
+    0x0.000002p1    + 0x0.000004p-3i,	/* #90 */
+    0x0.000152p-5   + 0x0.000002p1i,	/* #91 */
+    0x0.000002p0    + 0x0.000002p-2i,	/* #92 */
+    0x0.000002p0    + 0x0.000002p2i,	/* #93 */
+    0x0.000002p-1   + 0x0.000002p1i,	/* #94 */
+    0x0.000002p2    + 0x0.000002p3i,	/* #95 */
+    0x0.000002p-4   + 0x0.000002p-5i,	/* #96 */
+    0x0.000002p-5   + 0x0.000002p-7i,	/* #97 */
+    0x0.000002p-16  + 0x0.000002p-18i,	/* #98 */
+    0x0.000002p-17  + 0x0.000002p-19i,	/* #99 */
+    0x0.000002p0    + 0x0.000004p-2i	/* #100 */
+  };
+
+
+int main(int argc, char** argv)
+{
+  int i;
+  FTYPE xr, xi, yr, yi, zr, zi, zzr, zzi;
+  FTYPE er, ei;
+  __complex FTYPE ans[NUMCNT];
+  int errcnt;
+
+  errcnt = 0;
+  for (i = 0; i < NUMCNT; i++)
+    {
+      ans[i] = x[i] / y[i];
+      if( z[i] != z[i] )   /* Check for nan/inf case */
+	{
+	  zr = __real__ z[i];
+	  zi = __imag__ z[i];
+	  zzr = __real__ ans[i];
+	  zzi = __imag__ ans[i];
+	  er = __real__ errmax[i];
+	  ei = __imag__ errmax[i];
+	  errcnt++;
+	  printf("x %3d    " FMT " " FMT "i\n",
+		 i + 1, __real__ x[i], __imag__ x[i]);
+	  printf ("y %3d   " FMT " " FMT "i\n",
+		  i + 1, __real__ y[i], __imag__ y[i]);
+	  printf("expected " FMT " " FMT "i\n",
+		 __real__ z[i], __imag__ z[i]);
+	  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+		 __real__ ans[i], __imag__ ans[i], i + 1);
+	  printf("diff     " FMT " " FMT "i\n",
+		 zr - zzr, zi - zzi);
+	  printf("errmax   " FMT " " FMT "i\n\n",
+		 er, ei);
+	}
+      else
+	{
+	  if( z[i] != ans[i] )
+	    {
+	      zr = __real__ z[i];
+	      zi = __imag__ z[i];
+	      zzr = __real__ ans[i];
+	      zzi = __imag__ ans[i];
+	      er = __real__ errmax[i];
+	      ei = __imag__ errmax[i];
+	      if( (FABS(zr-zzr) > er) || (FABS(zi-zzi) > ei))
+		{	 /* report if error exceeds error max */
+		  errcnt++;
+		  printf("x %3d    " FMT " " FMT "i\n",
+			 i + 1, __real__ x[i], __imag__ x[i]);
+		  printf ("y %3d    " FMT " " FMT "i\n",
+			  i + 1, __real__ y[i], __imag__ y[i]);
+		  printf("expected " FMT " " FMT "i\n",
+			 __real__ z[i], __imag__ z[i]);
+		  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+			 __real__ ans[i], __imag__ ans[i], i + 1);
+		  printf("diff     " FMT " " FMT "i\n",
+			 zr - zzr, zi - zzi);
+		  printf("errmax   " FMT " " FMT "i\n\n",
+			 er, ei);
+		}
+	    }
+	}
+    }
+  if( errcnt > 0)
+    {
+      printf("%2d Failures\n",errcnt);
+      abort();
+    }
+  printf("PASS\n");
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59714_64.c b/gcc/testsuite/gcc.c-torture/execute/pr59714_64.c
new file mode 100644
index 0000000..0a41174
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59714_64.c
@@ -0,0 +1,506 @@
+#include <stdio.h>
+#include <math.h>
+
+extern void abort (void);
+#define FABS(x) ((x) >= 0 ? (x) : -(x))
+#define FTYPE   double
+#define FMT     "%-24.13a"
+
+/*
+   Tables of numbers for complex division testing
+   All values in hex format
+   z[i] == correctly rounded value of x[i]/y[i];
+ */
+
+#define NUMCNT 100
+
+__complex FTYPE x[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p0i,			/* #1 */
+    0x1.0p0 + 0x1.0p0i,			/* #2 */
+    0x1.0p1023 + 0x1.0p-1023i,		/* #3 */
+    0x1.0p1023 + 0x1.0p1023i,		/* #4 */
+    0x1.0p1020 + 0x1.0p-844i,		/* #5 */
+    0x1.0p-71 + 0x1.0p1021i,		/* #6 */
+    0x1.0p-347 + 0x1.0p-54i,		/* #7 */
+    0x1.0p-1074 + 0x1.0p-1074i,		/* #8 */
+    0x1.0p1015 + 0x1.0p-989i,		/* #9 */
+    0x1.0p-622 + 0x1.0p-1071i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    0x1.0p0 - 0x3.000000001p-20i,	/* #16 */
+    0x1.0p0 + 0x3.00000000001p-20i,	/* #17 */
+    0x1.0p0 + 0x1.8000000000002p1i,	/* #18 */
+    0x1.0p0 + 0x1.8000000000004p1i,	/* #19 */
+    0x1.0p0 + 0x1.8000000000008p1i,	/* #20 */
+    0x1.0p0 + 0x1.8000000000010p1i,	/* #21 */
+    0x1.0p0 + 0x1.8000000000020p1i,	/* #22 */
+    0x1.0p0 + 0x1.8000000000040p1i,	/* #23 */
+    0x1.0p0 + 0x1.8000000000080p1i,	/* #24 */
+    0x1.0p0 + 0x1.7ffffffffff8p1i,	/* #25 */
+    0x1.0p0 + 0x1.7ffffffffff0p1i,	/* #26 */
+    0x1.0p0 + 0x1.7fffffffff80p1i,	/* #27 */
+    0x1.0p0 + 0x1.7fffffffff00p1i,	/* #28 */
+    0x5.0p0 + 0x5.0p0i,			/* #29 */
+    0x4.0p0 + 0x3.0p0i,			/* #30 */
+    -0x4.0p0 + 0x3.000000001p0i,	/* #31 */
+    0x3.00000000001p-20 + 0x1.0p0i,	/* #32 */
+    0x1.00000000001p-80 + 0x1.0p0i,	/* #33 */
+    0x1.00000000001p-600 + 0x1.0p0i,	/* #34 */
+    0x1.0p0 + 0x1.00000000001p-600i,	/* #35 */
+    -0x1.0p0 + 0x1.00000000001p-600i,	/* #36 */
+    -0x1.0p0 + 0x1.00000000001p-600i,	/* #37 */
+    -0x1.0p0 + 0x1.00000000001p-600i,	/* #38 */
+    0x1.0p0 - 0x1.00000000001p-600i,	/* #39 */
+    0x1.0p100 - 0x1.00000000001p-600i,	/* #40 */
+    0x1.97530p100 - 0x1.00000000001p-600i,	/* #41 */
+    0x1.97530p300 - 0x1.00000000001p-600i,	/* #42 */
+    0x1.97530p377 - 0x1.00000000001p-600i,	/* #43 */
+    0x1.97530p477 - 0x1.00000000001p-500i,	/* #44 */
+    0x1.97530p0 - 0x1.00000000001p-900i,	/* #45 */
+    0x1.97530p100 - 0x1.00000000001p-800i,	/* #46 */
+    0x1.97530p200 - 0x1.00000000001p-700i,	/* #47 */
+    0x1.97530p300 - 0x1.00000000001p-600i,	/* #48 */
+    0x1.97530p400 - 0x1.00000000001p-500i,	/* #49 */
+    0x1.97530p500 - 0x1.00000000001p-400i,	/* #50 */
+    0x1.97530p600 - 0x1.00000000001p-300i,	/* #51 */
+    0x1.97530p700 - 0x1.00000000001p-200i,	/* #52 */
+    0x1.97530p800 - 0x1.00000000001p-100i,	/* #53 */
+    0x1.97530p900 - 0x1.00000000001p-0i,	/* #54 */
+    0x1.97530p1000 + 0x1.00000000001p200i,	/* #55 */
+    0x1.97530p1010 + 0x1.00000000000p300i,	/* #56 */
+    0x1.97530p800 + 0x1.00000000000p400i,	/* #57 */
+    0x1.97530p700 + 0x1.00000000000p500i,	/* #58 */
+    0x1.97530p600 + 0x1.00000000000p600i,	/* #59 */
+    0x1.97530p520 + 0x1.00000000000p520i,	/* #60 */
+    0x1.0p1020 + 0x1.0p-844i,		/* #61 */
+    0x1.0p920 + 0x1.0p-844i,		/* #62 */
+    0x1.0p504 + 0x1.0p523i,		/* #63 */
+    0x1.0p1004 + 0x1.0p-512i,		/* #64 */
+    0x1.0p910 + 0x1.0p-512i,		/* #65 */
+    0x1.0p865 + 0x1.0p-512i,		/* #66 */
+    0x1.0p864 + 0x1.0p-512i,		/* #67 */
+    0x1.0p860 + 0x1.0p-512i,		/* #68 */
+    0x1.0p810 + 0x1.0p-512i,		/* #69 */
+    0x1.0p710 + 0x1.0p-512i,		/* #70 */
+    0x1.0p610 + 0x1.0p-512i,		/* #71 */
+    0x1.0p510 + 0x1.0p-512i,		/* #72 */
+    0x1.0p410 + 0x1.0p-512i,		/* #73 */
+    0x13.0p4 + 0x1.0p-4i,		/* #74 */
+    0x13.0p2 + 0x13.0p2i,		/* #75 */
+    0x13.0p4 + 0x1.0p4i,		/* #76 */
+    0x12.0p4 + 0x12.0p-4i,		/* #77 */
+    0x1.0p1 + 0x12.0p1i,		/* #78 */
+    0x1.0p2 + 0x1.0p4i,			/* #79 */
+    0x13.0p0 + 0x0.0p0i,		/* #80 */
+    0x1.01p12 - 0x1.037p-12i,		/* #81 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #82 */
+    0x1.01p12 - 0x1.037p-12i,		/* #83 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #84 */
+    0x1.01p12 - 0x1.037p-12i,		/* #85 */
+    0x1.123456p3 - 0x1.789123p4i,	/* #86 */
+    0x1.123457p3 - 0x1.789123p4i,	/* #87 */
+    0x1.123458p3 + 0x1.789123p4i,	/* #88 */
+    0x1.123456p3 + 0x1.789122p4i,	/* #89 */
+    0x1.123456p3 + 0x1.789121p4i,	/* #90 */
+    0x1.123456p3 + 0x1.789120p4i,	/* #91 */
+    0x1.123455p3 - 0x1.789123p4i,	/* #92 */
+    0x1.123454p3 - 0x1.789122p4i,	/* #93 */
+    -0x1.123453p3 + 0x1.789121p4i,	/* #94 */
+    0x1.123452p3 + 0x1.789120p4i,	/* #95 */
+    0x1.123451p3 - 0x1.789127p4i,	/* #96 */
+    0x1.123459p3 - 0x1.789125p4i,	/* #97 */
+    -0x1.123450p3 + 0x1.789124p4i,	/* #98 */
+    0x1.1234561p3 + 0x1.7891231p4i,	/* #99 */
+    0x1.1234561p3 - 0x1.7891231p4i	/* #100 */
+  };
+
+__complex FTYPE y[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p1023i,		/* #1 */
+    0x1.0p-1023 + 0x1.0p-1023i,		/* #2 */
+    0x1.0p677 + 0x1.0p-677i,		/* #3 */
+    0x1.0p0 + 0x1.0p0i,			/* #4 */
+    0x1.0p656 + 0x1.0p-780i,		/* #5 */
+    0x1.0p1001 + 0x1.0p-323i,		/* #6 */
+    0x1.0p-1037 + 0x1.0p-1058i,		/* #7 */
+    0x1.0p-1073 + 0x1.0p-1074i,		/* #8 */
+    0x1.0p1023 + 0x1.0p1023i,		/* #9 */
+    0x1.0p-343 + 0x1.0p-798i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    -0x2.0p0 + 0x8.0p-10i,		/* #16 */
+    0x1.0p0 + 0x3.0p-20i,		/* #17 */
+    0x1.0p0 + 0x3.0p0i,			/* #18 */
+    0x1.0p0 + 0x3.0p0i,			/* #19 */
+    0x1.0p0 + 0x3.0p0i,			/* #20 */
+    0x1.0p0 + 0x3.0p0i,			/* #21 */
+    0x1.0p0 + 0x3.0p0i,			/* #22 */
+    0x1.0p0 + 0x3.0p0i,			/* #23 */
+    0x1.0p0 + 0x3.0p0i,			/* #24 */
+    0x1.0p0 + 0x3.0p0i,			/* #25 */
+    0x1.0p0 + 0x3.0p0i,			/* #26 */
+    0x1.0p0 + 0x3.0p0i,			/* #27 */
+    0x1.0p0 + 0x3.0p0i,			/* #28 */
+    0x3.0p0 + 0x4.0p0i,			/* #29 */
+    0x3.0p0 - 0x4.0p0i,			/* #30 */
+    -0x3.0p0 - 0x4.0p0i,		/* #31 */
+    0x3.0p-20 + 0x1.0p0i,		/* #32 */
+    0x1.0p-80 + 0x1.0p0i,		/* #33 */
+    0x1.0p-80 + 0x1.0p0i,		/* #34 */
+    0x1.0p0 + 0x1.0p-600i,		/* #35 */
+    0x1.0p0 + 0x1.0p-600i,		/* #36 */
+    -0x1.0p0 + 0x1.0p-600i,		/* #37 */
+    0x1.0p0 - 0x1.0p-600i,		/* #38 */
+    0x1.0p0 + 0x1.0p-600i,		/* #39 */
+    0x1.0p100 + 0x1.0p-600i,		/* #40 */
+    0x1.97530p100 + 0x1.0p-600i,	/* #41 */
+    0x1.97530p300 + 0x1.0p-600i,	/* #42 */
+    0x1.0p-600 + 0x1.97530p377i,	/* #43 */
+    0x1.0p-500 + 0x1.97530p477i,	/* #44 */
+    0x1.0p-900 + 0x1.97530p0i,		/* #45 */
+    0x1.0p-800 + 0x1.97530p100i,	/* #46 */
+    0x1.0p-700 + 0x1.97530p200i,	/* #47 */
+    0x1.0p-600 + 0x1.97530p300i,	/* #48 */
+    0x1.0p-500 + 0x1.97530p400i,	/* #49 */
+    0x1.0p-400 + 0x1.97530p500i,	/* #50 */
+    0x1.0p-300 + 0x1.97530p600i,	/* #51 */
+    0x1.0p-200 + 0x1.97530p700i,	/* #52 */
+    0x1.0p-100 + 0x1.97530p800i,	/* #53 */
+    0x1.0p-0 + 0x1.97530p900i,		/* #54 */
+    0x1.97530p100 + 0x1.0000p100i,	/* #55 */
+    0x1.97530p50 + 0x1.0000p50i,	/* #56 */
+    0x1.97530p100 + 0x1.0000p50i,	/* #57 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #58 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #59 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #60 */
+    0x1.0p656 + 0x1.0p-730i,		/* #61 */
+    0x1.0p656 + 0x1.0p-730i,		/* #62 */
+    0x1.0p-500 + 0x1.0p-1000i,		/* #63 */
+    0x1.0p0 + 0x1.0p-500i,		/* #64 */
+    0x1.0p-110 + 0x1.0p-500i,		/* #65 */
+    0x1.0p-155 + 0x1.0p-500i,		/* #66 */
+    0x1.0p-156 + 0x1.0p-500i,		/* #67 */
+    0x1.0p-160 + 0x1.0p-500i,		/* #68 */
+    0x1.0p-210 + 0x1.0p-500i,		/* #69 */
+    0x1.0p-310 + 0x1.0p-500i,		/* #70 */
+    0x1.0p-410 + 0x1.0p-500i,		/* #71 */
+    0x1.0p-510 + 0x1.0p-600i,		/* #72 */
+    0x1.0p-610 + 0x1.0p-700i,		/* #73 */
+    0x5.0p1 + 0x12.0p1i,		/* #74 */
+    0x5.0p1 + 0x12.0p1i,		/* #75 */
+    0x5.0p1 + 0x12.0p1i,		/* #76 */
+    0x5.0p1 + 0x12.0p1i,		/* #77 */
+    0x5.0p1 + 0x12.0p1i,		/* #78 */
+    0x5.0p1 + 0x12.0p1i,		/* #79 */
+    0x5.0p1 + 0x12.0p1i,		/* #80 */
+    0x3.1p0 + 0x1.1p0i,			/* #81 */
+    -0x3.0p0 + 0x1.1p0i,		/* #82 */
+    -0x3.0p0 + 0x1.1p0i,		/* #83 */
+    0x3.0p0 + 0x1.1p0i,			/* #84 */
+    0x3.0p0 + 0x1.1p0i,			/* #85 */
+    0x1.456789p2 - 0x1.789123p1i,	/* #86 */
+    0x1.124569p2 - 0x1.781239p3i,	/* #87 */
+    0x1.123457p3 - 0x1.789126p4i,	/* #88 */
+    0x1.123456p1 + 0x1.891237p4i,	/* #89 */
+    0x1.123456p2 + 0x1.357123p3i,	/* #90 */
+    0x1.123456p3 - 0x1.789123p1i,	/* #91 */
+    0x1.123456p1 - 0x1.789123p4i,	/* #92 */
+    0x1.123456p2 + 0x1.789123p1i,	/* #93 */
+    0x1.123456p3 + 0x1.789123p0i,	/* #94 */
+    -0x1.123456p1 - 0x1.789153p-2i,	/* #95 */
+    -0x1.123456p2 - 0x1.785123p7i,	/* #96 */
+    -0x1.123456p3 + 0x1.789123p9i,	/* #97 */
+    0x1.123456p1 - 0x1.789123p20i,	/* #98 */
+    0x1.123456p2 - 0x1.337788p21i,	/* #99 */
+    0x1.123457p3 - 0x1.789991p3i	/* #100 */
+  };
+
+__complex FTYPE z[NUMCNT] =
+  {
+    0x1.0p-1023 - 0x1.0p-1023i,		/* #1 */
+    0x1.0p1023 + 0x0.0p0i,		/* #2 */
+    0x1.0p346 - 0x1.0p-1008i,		/* #3 */
+    0x1.0p1023 + 0x0.0p0i,		/* #4 */
+    0x1.0p364 - 0x1.0p-1072i,		/* #5 */
+    0x1.0p-1072 + 0x1.0p20i,		/* #6 */
+    3.898125604559113300e289 + 8.174961907852353577e295i,	/* #7 */
+    0.6 + 0.2i,				/* #8 */
+    0.001953125 - 0.001953125i,		/* #9 */
+    1.02951151789360578e-84 + 6.97145987515076231e-220i,	/* #10 */
+    0x1.0p0 + 0x0.0p0i,			/* #11 */
+    0x1.0p0 + 0x0.0p0i,			/* #12 */
+    0x1.0p0 + 0x0.0p0i,			/* #13 */
+    0x1.0p0 + 0x0.0p0i,			/* #14 */
+    0x1.0p0 + 0x0.0p0i,			/* #15 */
+    -0x1.fffe0061ff9e0p-2 - 0x1.ff9e0061ff9c0p-10i,	/* #16 */
+    0x1.00000000000000p0 + 0x1.ffffffffee000p-65i,	/* #17 */
+    0x1.0000000000002p0 + 0x1.999999999999ap-54i,	/* #18 */
+    0x1.0000000000003p0 + 0x1.999999999999ap-53i,	/* #19 */
+    0x1.0000000000005p0 + 0x1.999999999999ap-52i,	/* #20 */
+    0x1.000000000000ap0 + 0x1.999999999999ap-51i,	/* #21 */
+    0x1.0000000000013p0 + 0x1.999999999999ap-50i,	/* #22 */
+    0x1.0000000000027p0 + 0x1.999999999999ap-49i,	/* #23 */
+    0x1.000000000004dp0 + 0x1.999999999999ap-48i,	/* #24 */
+    0x1.fffffffffff66p-1 - 0x1.999999999999ap-48i,	/* #25 */
+    0x1.ffffffffffecdp-1 - 0x1.999999999999ap-47i,	/* #26 */
+    0x1.ffffffffff666p-1 - 0x1.999999999999ap-44i,	/* #27 */
+    0x1.fffffffffeccdp-1 - 0x1.999999999999ap-43i,	/* #28 */
+    0x1.6666666666667p0 - 0x1.999999999999ap-3i,	/* #29 */
+    0x0.0p0 + 0x1.0p0i,					/* #30 */
+    -0x1.47ae147ae147b00000p-39 - 0x1.0000000001eb8p0i,	/* #31 */
+    0x1.00000000000000p0 - 0x1.ffffffffee000p-65i,	/* #32 */
+    0x1.00000000000000p0 - 0x1.0000000000000p-124i,	/* #33 */
+    0x1.00000000000000p0 + 0x1.0000000000000p-80i,	/* #34 */
+    0x1.00000000000000p0 + 0x1.0000000000000p-644i,	/* #35 */
+    -0x1.00000000000000p0 + 0x1.0000000000080p-599i,	/* #36 */
+    0x1.00000000000000p0 - 0x1.0000000000000p-644i,	/* #37 */
+    -0x1.00000000000000p0 + 0x1.0000000000000p-644i,	/* #38 */
+    0x1.00000000000000p0 - 0x1.0000000000080p-599i,	/* #39 */
+    0x1.00000000000000p0 - 0x1.0000000000080p-699i,	/* #40 */
+    0x1.00000000000000p0 - 0x1.41c9b303bfbf2p-700i,	/* #41 */
+    0x1.00000000000000p0 - 0x1.41c9b303bfbf2p-900i,	/* #42 */
+    -0x1.41c9b303bfb510p-1022 - 0x1.0000000000000p0i,	/* #43 */
+    -0x1.41c9b303bfb510p-1022 - 0x1.0000000000000p0i,	/* #44 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #45 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #46 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #47 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #48 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #49 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #50 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #51 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #52 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #53 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #54 */
+    0x1.6f0647208a31a0p899 - 0x1.cd580bc4697cap898i,	/* #55 */
+    0x1.6f0647208a31a0p959 - 0x1.cd580bc4697cap958i,	/* #56 */
+    0x1.00000000000000p700 - 0x1.41c9b303bfb51p649i,	/* #57 */
+    0x1.6f0647208a31a0p698 - 0x1.cd580bc4697cap697i,	/* #58 */
+    0x1.00000000000000p599 + 0x0.0000000000000p0i,	/* #59 */
+    0x1.00000000000000p519 + 0x0.0000000000000p0i,	/* #60 */
+    0x1.0p364 - 0x1.0p-1022i,				/* #61 */
+    0x1.0p264 + 0x0.0p0i,				/* #62 */
+    0x1.0p1004 + 0x1.0p1023i,				/* #63 */
+    0x1.0p1004 - 0x1.0p504i,				/* #64 */
+    0x1.0p1020 - 0x1.0p630i,				/* #65 */
+    0x1.0p1020 - 0x1.0p675i,				/* #66 */
+    0x1.0p1020 - 0x1.0p676i,				/* #67 */
+    0x1.0p1020 - 0x1.0p680i,				/* #68 */
+    0x1.0p1020 - 0x1.0p730i,				/* #69 */
+    0x1.0p1020 - 0x1.0p830i,				/* #70 */
+    0x1.0p1020 - 0x1.0p930i,				/* #71 */
+    0x1.0p1020 - 0x1.0p930i,				/* #72 */
+    0x1.0p1020 - 0x1.0p930i,				/* #73 */
+    0x1.16f21023358c2p1 - 0x1.f5b3b6a5c6c90p2i,		/* #74 */
+    0x1.408cd63069a0ap1 - 0x1.6a5c6c8fc5517p0i,		/* #75 */
+    0x1.4b8d91f8aa2d8p1 - 0x1.ee6539f2cbeb7p2i,		/* #76 */
+    0x1.0bc8408cd6307p1 - 0x1.daceda971b23fp2i,		/* #77 */
+    0x1.e2a8b5e9fe887p-1 + 0x1.a682913ce1ecfp-3i,	/* #78 */
+    0x1.c3d9db52e3648p-2 + 0x1.77908119ac60dp-7i,	/* #79 */
+    0x1.16bd3fd10defep-3 - 0x1.f5bb0c784c496p-2i,	/* #80 */
+    0x1.2b9c43596635bp10 - 0x1.9fc933bd0b3adp8i,	/* #81 */
+    0x1.3079a1638e442p10 + 0x1.af56ff5f5ee08p8i,	/* #82 */
+    -0x1.3079a23d4567cp10 - 0x1.af56f5c477a85p8i,	/* #83 */
+    -0x1.3079a23d4567cp10 + 0x1.af56f5c477a85p8i,	/* #84 */
+    0x1.3079a1638e442p10 - 0x1.af56ff5f5ee08p8i,	/* #85 */
+    0x1.a27419691d785p+1 - 0x1.5e60a434afdfep1i,	/* #86 */
+    0x1.004a6235052b9p1 - 0x1.077970d2017e9p-10i,	/* #87 */
+    -0x1.8825f329396f0p-1 + 0x1.492fb9aef1c35p-1i,	/* #88 */
+    0x1.f6417093502e6p-1 - 0x1.0d936b36d2386p-2i,	/* #89 */ 
+    0x1.2e6b76d3c1a74p1 + 0x1.4911f033da9e4p-3i,	/* #90 */
+    0x1.a1ced84e145e9p-5 + 0x1.61ced4d722d38p1i,	/* #91 */
+    0x1.064f7bc3e4834p0 + 0x1.1551c3ae74bd1p-2i,	/* #92 */
+    -0x1.344545d341aa8p0 - 0x1.2aa5da272dd3dp2i,	/* #93 */
+    -0x1.06d98474fe895p-1 + 0x1.6ad8d7df1b0c8p1i,	/* #94 */
+    -0x1.6deb5a7bec317p2 - 0x1.4028b8d0a2fc1p3i,	/* #95 */
+    0x1.fbd4560086546p-4 + 0x1.8c3278a9ca9b4p-5i,	/* #96 */
+    -0x1.0106f72f51798p-5 - 0x1.69200e9aa701dp-7i,	/* #97 */ 
+    -0x1.00000929d9956p-16 - 0x1.74d2319d42342p-18i,	/* #98 */
+    -0x1.39887db89b686p-17 + 0x1.c89cdfee34a14p-19i,	/* #99 */
+    0x1.a746a452d3430p0 - 0x1.e72d9f35e28e6p-2i		/* #100 */
+  };
+
+
+__complex FTYPE errmax[NUMCNT] =
+  {
+    0x0.0000000000000p0    + 0x0.0000000000000p0i,	/* #1 */
+    0x0.0000000000001p1023 + 0x0.0000000000001p0i,	/* #2 */
+    0x0.0000000000001p346  + 0x0.0000000000001p-1008i,	/* #3 */
+    0x0.0000000000001p1023 + 0x0.0000000000001p0i,	/* #4 */
+    0x0.0000000000001p364  + 0x0.0000000000000p0i,	/* #5 */
+    0x0.0000000000000p0    + 0x0.0000000000001p20i,	/* #6 */
+    0x0.0000000000001p961  + 0x0.0000000000001p982i,	/* #7 */
+    0x0.0000000000001p-1   + 0x0.0000000000010p-3i,	/* #8 */
+    0x0.0000000000001p-9   + 0x0.0000000000001p-9i,	/* #9 */
+    0x0.0000000000001p279  + 0x0.0000000000001p-171i,	/* #10 */
+    0x0.0000000000001p0    + 0x0.0000000000001p0i,	/* #11 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #12 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #13 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #14 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #15 */
+    0x1.0000000000001p-2   + 0x0.000000000001p-10i,	/* #16 */
+    0x0.0000000000001p0    + 0x0.000000000001p-65i,	/* #17 */
+    0x0.0000000000001p0    + 0x0.000000000001p-54i,	/* #18 */
+    0x0.0000000000001p0    + 0x0.000000000001p-53i,	/* #19 */
+    0x0.0000000000001p0    + 0x0.000000000001p-52i,	/* #20 */
+    0x0.0000000000001p0    + 0x0.000000000001p-51i,	/* #21 */
+    0x0.0000000000001p0    + 0x0.000000000001p-50i,	/* #22 */
+    0x0.0000000000001p0    + 0x0.000000000001p-49i,	/* #23 */
+    0x0.0000000000001p0    + 0x0.000000000001p-48i,	/* #24 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-48i,	/* #25 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-47i,	/* #26 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-44i,	/* #27 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-43i,	/* #28 */
+    0x0.0000000000001p0    + 0x0.000000000001p-3i,	/* #29 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #30 */
+    0x0.0000000000001p-39  + 0x0.000000000001p0i,	/* #31 */
+    0x0.0000000000001p0    + 0x0.000000000001p-65i,	/* #32 */
+    0x0.0000000000001p0    + 0x0.000000000001p-124i,	/* #33 */
+    0x0.0000000000001p0    + 0x0.000000000001p-80i,	/* #34 */
+    0x0.0000000000001p0    + 0x0.000000000001p-644i,	/* #35 */
+    0x0.0000000000001p0    + 0x0.000000000001p-599i,	/* #36 */
+    0x0.0000000000001p0    + 0x0.000000000001p-644i,	/* #37 */
+    0x0.0000000000001p0    + 0x0.000000000001p-644i,	/* #38 */
+    0x0.0000000000001p0    + 0x0.000000000001p-599i,	/* #39 */
+    0x0.0000000000001p0    + 0x0.000000000001p-699i,	/* #40 */
+    0x0.0000000000001p0    + 0x0.000000000001p-700i,	/* #41 */
+    0x0.0000000000001p0    + 0x0.000000000001p-900i,	/* #42 */
+    0x0.0042000000000p-1022 + 0x0.000000000001p0i,	/* #43 */
+    0x0.0042000000000p-1022 + 0x0.000000000001p0i,	/* #44 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #45 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #46 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #47 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #48 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #49 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #50 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #51 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #52 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #53 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #54 */
+    0x0.0000000000001p899  + 0x0.000000000001p898i,	/* #55 */
+    0x0.0000000000001p959  + 0x0.000000000001p958i,	/* #56 */
+    0x0.0000000000001p700  + 0x0.000000000001p649i,	/* #57 */
+    0x0.0000000000001p698  + 0x0.000000000001p697i,	/* #58 */
+    0x0.0000000000001p599  + 0x0.000000000001p0i,	/* #59 */
+    0x0.0000000000001p519  + 0x0.000000000001p0i,	/* #60 */
+    0x0.0000000000001p364  + 0x0.000000000000p0i,	/* #61 */
+    0x0.0000000000001p264  + 0x0.000000000001p0i,	/* #62 */
+    0x0.0000000000001p1004 + 0x0.000000000001p1023i,	/* #63 */
+    0x0.0000000000001p1004 + 0x0.000000000001p504i,	/* #64 */
+    0x0.0000000000001p1020 + 0x0.000000000001p630i,	/* #65 */
+    0x0.0000000000001p1020 + 0x0.000000000001p675i,	/* #66 */
+    0x0.0000000000001p1020 + 0x0.000000000001p676i,	/* #67 */
+    0x0.0000000000001p1020 + 0x0.000000000001p680i,	/* #68 */
+    0x0.0000000000001p1020 + 0x0.000000000001p730i,	/* #69 */
+    0x0.0000000000001p1020 + 0x0.000000000001p830i,	/* #70 */
+    0x0.0000000000001p1020 + 0x0.000000000001p930i,	/* #71 */
+    0x0.0000000000001p1020 + 0x0.000000000001p930i,	/* #72 */
+    0x0.0000000000001p1020 + 0x0.000000000001p930i,	/* #73 */
+    0x0.0000000000001p7    + 0x0.000000000001p0i,	/* #74 */
+    0x0.0000000000001p1    + 0x0.000000000001p0i,	/* #75 */
+    0x0.0000000000001p1    + 0x0.000000000001p2i,	/* #76 */
+    0x0.0000000000001p1    + 0x0.000000000001p2i,	/* #77 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-3i,	/* #78 */
+    0x0.0000000000001p-2   + 0x0.000000000001p-7i,	/* #79 */
+    0x0.0000000000001p-3   + 0x0.000000000001p-2i,	/* #80 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #81 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #82 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #83 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #84 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #85 */
+    0x0.0000000000001p1    + 0x0.000000000001p1i,	/* #86 */
+    0x0.0000000000001p1    + 0x0.000000000001p-10i,	/* #87 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-1i,	/* #88 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-2i,	/* #89 */
+    0x0.0000000000001p1    + 0x0.000000000001p-3i,	/* #90 */
+    0x0.0000000000005p-5   + 0x0.000000000001p1i,	/* #91 */
+    0x0.0000000000001p0    + 0x0.000000000001p-2i,	/* #92 */
+    0x0.0000000000001p0    + 0x0.000000000001p2i,	/* #93 */
+    0x0.0000000000001p-1   + 0x0.000000000001p1i,	/* #94 */
+    0x0.0000000000001p2    + 0x0.000000000001p3i,	/* #95 */
+    0x0.0000000000001p-4   + 0x0.000000000001p-5i,	/* #96 */
+    0x0.0000000000001p-5   + 0x0.000000000001p-7i,	/* #97 */
+    0x0.0000000000001p-16  + 0x0.000000000001p-18i,	/* #98 */
+    0x0.0000000000001p-17  + 0x0.000000000001p-19i,	/* #99 */
+    0x0.0000000000001p0    + 0x0.000000000001p-2i	/* #100 */
+  };
+
+
+int main(int argc, char** argv)
+{
+  int i;
+  FTYPE xr, xi, yr, yi, zr, zi, zzr, zzi;
+  FTYPE er, ei;
+  __complex FTYPE ans[NUMCNT];
+  int errcnt;
+
+  errcnt = 0;
+  for (i = 0; i < NUMCNT; i++)
+    {
+      ans[i] = x[i] / y[i];
+      if( z[i] != z[i] )   /* Check for nan/inf case */
+	{
+	  zr = __real__ z[i];
+	  zi = __imag__ z[i];
+	  zzr = __real__ ans[i];
+	  zzi = __imag__ ans[i];
+	  er = __real__ errmax[i];
+	  ei = __imag__ errmax[i];
+	  errcnt++;
+	  printf("x %3d    " FMT " " FMT "i\n",
+		 i + 1, __real__ x[i], __imag__ x[i]);
+	  printf ("y %3d   " FMT " " FMT "i\n",
+		  i + 1, __real__ y[i], __imag__ y[i]);
+	  printf("expected " FMT " " FMT "i\n",
+		 __real__ z[i], __imag__ z[i]);
+	  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+		 __real__ ans[i], __imag__ ans[i], i + 1);
+	  printf("diff     " FMT " " FMT "i\n",
+		 zr - zzr, zi - zzi);
+	  printf("errmax   " FMT " " FMT "i\n\n",
+		 er, ei);
+	}
+      else
+	{
+	  if( z[i] != ans[i] )
+	    {
+	      zr = __real__ z[i];
+	      zi = __imag__ z[i];
+	      zzr = __real__ ans[i];
+	      zzi = __imag__ ans[i];
+	      er = __real__ errmax[i];
+	      ei = __imag__ errmax[i];
+	      if( (FABS(zr-zzr) > er) || (FABS(zi-zzi) > ei))
+		{	 /* report if error exceeds error max */
+		  errcnt++;
+		  printf("x %3d    " FMT " " FMT "i\n",
+			 i + 1, __real__ x[i], __imag__ x[i]);
+		  printf ("y %3d    " FMT " " FMT "i\n",
+			  i + 1, __real__ y[i], __imag__ y[i]);
+		  printf("expected " FMT " " FMT "i\n",
+			 __real__ z[i], __imag__ z[i]);
+		  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+			 __real__ ans[i], __imag__ ans[i], i + 1);
+		  printf("diff     " FMT " " FMT "i\n",
+			 zr - zzr, zi - zzi);
+		  printf("errmax   " FMT " " FMT "i\n\n",
+			 er, ei);
+		}
+	    }
+	}
+    }
+  if( errcnt > 0)
+    {
+      printf("%2d Failures\n",errcnt);
+      abort();
+    }
+  printf("PASS\n");
+  return 0;
+}
+
diff --git a/libgcc/config/sparc/sfp-machine.h b/libgcc/config/sparc/sfp-machine.h
new file mode 100644
index 0000000..d22b7ed
--- /dev/null
+++ b/libgcc/config/sparc/sfp-machine.h
@@ -0,0 +1,13 @@
+#ifndef SFP_MACHINE_H
+#define SFP_MACHINE_H
+
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE      unsigned long long
+#define _FP_WS_TYPE     signed long long
+#define _FP_I_TYPE      long long
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN    4321
+#define __BYTE_ORDER    __BIG_ENDIAN
+
+#endif
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c
index 83f865a..99e7bec 100644
--- a/libgcc/libgcc2.c
+++ b/libgcc/libgcc2.c
@@ -29,6 +29,41 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "tm.h"
 #include "libgcc_tm.h"
 
+#if defined(L_divsc3) && defined(__LIBGCC_HAS_SF_MODE__)
+#include "soft-fp/soft-fp.h"
+#include "soft-fp/single.h"
+typedef union _FP_UNION_S   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_S
+#endif
+
+#if defined(L_divdc3) && defined(__LIBGCC_HAS_DF_MODE__)
+#include "soft-fp/soft-fp.h"
+#include "soft-fp/double.h"
+typedef union _FP_UNION_D   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_D
+#endif
+
+#if defined(L_divhc3) && defined(__LIBGCC_HAS_HF_MODE__)
+#include "soft-fp/soft-fp.h"
+#include "soft-fp/half.h"
+typedef union _FP_UNION_H   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_H
+#endif
+
+#if defined(L_divxc3) && defined(__LIBGCC_HAS_XF_MODE__)
+#include "soft-fp/soft-fp.h"
+#include "soft-fp/extended.h"
+typedef union _FP_UNION_E   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_E
+#endif
+
+#if defined(L_divtc3) && defined(__LIBGCC_HAS_TF_MODE__)
+#include "soft-fp/soft-fp.h"
+#include "soft-fp/quad.h"
+typedef union _FP_UNION_Q   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_Q
+#endif
+
 #ifdef HAVE_GAS_HIDDEN
 #define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
 #else
@@ -2039,30 +2074,158 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
 #if defined(L_divhc3) || defined(L_divsc3) || defined(L_divdc3) \
     || defined(L_divxc3) || defined(L_divtc3)
 
+#if defined(FP_EXPBIAS)
+#undef int
+
+/* Return an exponent of d */
+static inline MTYPE fp_exp(MTYPE d)
+{
+  FP_UTYPE u;
+  u.flt = d;
+  return u.bits.exp - FP_EXPBIAS;
+}
+
+/* Return pow(2.0, n) */
+static inline MTYPE fp_pow2(int n)
+{
+  FP_UTYPE u, u1;
+  u.flt = 1.;
+  if (n > -FP_EXPBIAS)
+    {
+      u.bits.exp = n + FP_EXPBIAS;
+      return u.flt;
+    }
+  u.bits.exp = 1;
+  u1.flt = 1.;
+  u1.bits.exp = n - 1 + 2 * FP_EXPBIAS;
+  return u.flt * u1.flt;
+}
+
+static inline int get_cde(int c, int d)
+{
+  int maxe = c, mine = d;
+  if (c < d)
+    {
+      maxe = d;
+      mine = c;
+    }
+  if (maxe > FP_EXPBIAS / 2)
+    {
+      if (mine - maxe > -FP_EXPBIAS)
+        return maxe;
+      if (maxe - FP_EXPBIAS / 2 >= mine - maxe + FP_EXPBIAS)
+        return maxe - FP_EXPBIAS / 2;
+      return mine - maxe + FP_EXPBIAS;
+    }
+  if (-mine > FP_EXPBIAS / 2)
+    return mine + FP_EXPBIAS <= maxe ? mine + FP_EXPBIAS : maxe;
+  return 0;
+}
+
+static inline int get_abe(int e1, int e2)
+{
+  int maxe = e1, mine = e2;
+  if (e1 < e2)
+    {
+      maxe = e2;
+      mine = e1;
+    }
+  if (maxe >= FP_EXPBIAS)
+    return maxe - FP_EXPBIAS + 1;
+  if (mine <= -FP_EXPBIAS)
+    {
+      if (maxe < 0)
+        return maxe;
+      return FP_EXPBIAS - 1 - maxe;
+    }
+  return 0;
+}
+#endif /* FP_EXPBIAS */
+
 CTYPE
 CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
 {
   MTYPE denom, ratio, x, y;
   CTYPE res;
 
-  /* ??? We can get better behavior from logarithmic scaling instead of
-     the division.  But that would mean starting to link libgcc against
-     libm.  We could implement something akin to ldexp/frexp as gcc builtins
-     fairly easily...  */
+#if defined(FP_EXPBIAS)
+  /* By scaling the calculation with powers of 2.0 we can avoid any roundoff
+     errors.
+     1. Convert (a+bi)/(c+di) to ((a+bi)/((c/x)+(d/x)i))*(1.0/x), where
+       x is any power of 2, such that neither (c/x)**2 nor (d/x)**2 cause
+       an overflow. Try to avoid underflow in c/x and d/x.
+     2) Callculate a real part as
+       ((a/y)*(c/x)+(b/y)*(d/x)) / ((c/x)**2+(y/x)**2) * (y/x), where
+       y is any power of 2, such that neither (a/y)*(c/x) nor (b/y)*(d/x) cause
+       an overflow. Try to avoid underflow in a/y and b/y.
+     3) Callculate an imaginary part as
+       ((b/y)*(c/x)-(a/y)*(d/x)) / ((c/x)**2 + (y/x)**2) * (y/x), where
+       y is any power of 2, such that neither (b/y)*(c/x) nor (a/y)*(d/x) cause
+       an overflow. Try to avoid underflow in a/y and b/y.  */
+
+  int ae, be, ce, de, abe, cde;
+  ae = fp_exp (a);
+  be = fp_exp (b);
+  ce = fp_exp (c);
+  de = fp_exp (d);
+  cde = get_cde (ce, de);
+  if (cde != 0) {
+    ratio = fp_pow2 (-cde);
+    c *= ratio;
+    d *= ratio;
+    ce -= cde;
+    de -= cde;
+  }
+  denom = c * c + d * d;
+
+  // Calculate a real part
+  abe = get_abe (ae + ce, be + de);
+  if (abe != 0)
+    {
+      MTYPE a1, b1;
+      ratio = fp_pow2 (-abe);
+      a1 = a * ratio;
+      b1 = b * ratio;
+      x = a1 * c + b1 * d;
+    }
+  else
+    x = a * c + b * d;
+  x /= denom;
+  if (abe - cde != 0)
+    x *= fp_pow2(abe - cde);
+
+  // Calculate an imaginary part
+  abe = get_abe (be + ce, ae + de);
+  if (abe != 0)
+    {
+      MTYPE a1, b1;
+      ratio = fp_pow2 (-abe);
+      a1 = a * ratio;
+      b1 = b * ratio;
+      y = b1 * c - a1 * d;
+    }
+  else
+    y = b * c - a * d;
+  y /= denom;
+  if (abe - cde != 0)
+    y *= fp_pow2(abe - cde);
+
+#else
   if (FABS (c) < FABS (d))
     {
       ratio = c / d;
       denom = (c * ratio) + d;
       x = ((a * ratio) + b) / denom;
       y = ((b * ratio) - a) / denom;
-    }
-  else
+     }
+   else
     {
       ratio = d / c;
       denom = (d * ratio) + c;
       x = ((b * ratio) + a) / denom;
       y = (b - (a * ratio)) / denom;
     }
+#endif
 
   /* Recover infinities and zeros that computed as NaN+iNaN; the only cases
      are nonzero/zero, infinite/finite, and finite/infinite.  */
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH]  PR libgcc/59714 complex division is surprising on aarch64
  2018-01-25 20:40 [PATCH] PR libgcc/59714 complex division is surprising on aarch64 vladimir.mezentsev
@ 2018-01-26  3:39 ` Joseph Myers
  2018-01-29 20:54   ` vladimir.mezentsev
  0 siblings, 1 reply; 20+ messages in thread
From: Joseph Myers @ 2018-01-26  3:39 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

On Thu, 25 Jan 2018, vladimir.mezentsev@oracle.com wrote:

> From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
> 
> Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and sparc64-unknown-linux-gnu.
> No regression. New tests now passed.
> There is a performance degradation for complex double type:

This is, of course, something to consider for GCC 9; it's not suitable for 
the current development stage.

Could you provide a more extended writeup of the issue (starting with the 
argument for it being a bug at all), the approach you took and the 
rationale for the approach, when you resubmit the patch for GCC 9 stage 1?

> * libgcc/config/sparc/sfp-machine.h: New

Are you introducing a requirement for all architectures to provide 
sfp-machine.h?  If so, did you determine that SPARC was the only one 
lacking it?  If not the only one lacking it, you need to make sure that 
you do not break any existing architecture in GCC.

What about architectures using non-IEEE formats?  soft-fp is not suitable 
for those, but you mustn't break them.  Remember that e.g. TFmode can be 
IBM long double, and other ?Fmode similarly need not be IEEE; the name 
only indicates how many bytes are in the format, nothing else about it.

What about powerpc __divkc3?

What was the rationale for using soft-fp rather than adding appropriate 
built-in functions as suggested in a comment?

These are the sorts of issues you need to cover in your patch write-up, to 
demonstrate that you have allowed for the range of targets supported in 
GCC, have taken care to avoid breaking them and have made deliberate 
choices that are appropriate in each case (but might not be the same for 
every target).

> +static inline int get_cde(int c, int d)

Lots of the new functions need comments on them to explain their 
semantics.  Also, the formatting needs fixing to follow the GNU Coding 
Standards ("static inline int" on its own line, space before '(').

> +  if (cde != 0) {

Similarly, bad formatting, "{" goes on the next line.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2018-01-26  3:39 ` Joseph Myers
@ 2018-01-29 20:54   ` vladimir.mezentsev
  2018-01-29 21:01     ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2018-01-29 20:54 UTC (permalink / raw)
  To: Joseph Myers; +Cc: gcc-patches


On 01/25/2018 04:14 PM, Joseph Myers wrote:
> On Thu, 25 Jan 2018, vladimir.mezentsev@oracle.com wrote:
>
>> From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
>>
>> Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and sparc64-unknown-linux-gnu.
>> No regression. New tests now passed.
>> There is a performance degradation for complex double type:
> This is, of course, something to consider for GCC 9; it's not suitable for 
> the current development stage.
  Why ?

>
> Could you provide a more extended writeup of the issue (starting with the 
> argument for it being a bug at all), the approach you took and the 
> rationale for the approach, when you resubmit the patch for GCC 9 stage 1?

The formula for complex division (a+bi)/(c+di) is (a*c+b*d)/(c*c+d*d) +
(b*c-a*d)/(c*c+d*d)i

The current implementation avoids overflow in (c*c + d*d) using
x=MAX(|c|, |d|);  c1=c/x; d1=d/x;
and then calculating the result as
(a*c1+b*d1)/(c1*c1+d1*d1)*(1.0/x) + (b*c1-a*d1)/(c1*c1+d1*d1)*(1.0/x)i

This approach has two issues:
1. Unexpected rounding when x is not a power of 2.0
For example, (1.0+3.0i) /(1.0+3.0i) should be 1.0
but it is (1.0 - 1.66533e-17i) on aarch64 (PR59714)

2. Unexpected underflow in c/x or d/x.
For example, (0x1.0p+1023 + 0x0.8p-1022 i)/(0x1.0p+677 + 0x1.0p-677 i)
should be (0x1.0p+346 - 0x1.0p-1008 i) but it is (0x1.0p+346)

My implementation avoids these issues.


>
>> * libgcc/config/sparc/sfp-machine.h: New
> Are you introducing a requirement for all architectures to provide 
> sfp-machine.h?  If so, did you determine that SPARC was the only one 
> lacking it?  If not the only one lacking it, you need to make sure that 
> you do not break any existing architecture in GCC.
>
> What about architectures using non-IEEE formats?  soft-fp is not suitable 
> for those, but you mustn't break them.  Remember that e.g. TFmode can be 
> IBM long double, and other ?Fmode similarly need not be IEEE; the name 
> only indicates how many bytes are in the format, nothing else about it.
Agree. 
An additional fix is needed.
Build  can be broken without sfp-mashine.h or on  architectures using
non-IEEE format.

>
> What about powerpc __divkc3?
>
> What was the rationale for using soft-fp rather than adding appropriate 
> built-in functions as suggested in a comment?

I had a version with built-in functions and I can restore it.

Let's design what we want to use soft-fp or built-in function.
I'd prefer to use built-in functions but performance is in two times worse.

The test below demonstrates performance degradation:
% cat r1.c
#include <stdio.h>

int main(int argc, char** argv)
{
  int i;
  long long sum = 0;
  for(i = 1; i < 1000000000; i++)
    {
      int exp;
      double d = (double) i;
#ifdef BUITIN
      double v = __builtin_frexp(d, &exp);
#else
      union _FP_UNION_D
      {
        double flt;
        struct _FP_STRUCT_LAYOUT
        {
          unsigned frac0 : 32;
          unsigned frac1 : 20;
          unsigned exp   : 11;
          unsigned sign  : 1;
        } bits __attribute__ ((packed));
        long long LL;
      } u;
      u.flt = d;
      exp = u.bits.exp - 1022;
#endif
      sum += exp * (i % 2 == 0 ? 1 : -1);
    }
  printf("sum = %d\n", sum);
  return 0;
}

%gcc -O2 -DBUITIN r1.c ; time ./a.out
real    0m4.247s
user    0m4.243s
sys    0m0.001s

%gcc -O2 r1.c ; time ./a.out
real    0m1.977s
user    0m1.973s
sys    0m0.001s


  -Vladimir

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2018-01-29 20:54   ` vladimir.mezentsev
@ 2018-01-29 21:01     ` Joseph Myers
  2018-02-06  8:55       ` vladimir.mezentsev
  0 siblings, 1 reply; 20+ messages in thread
From: Joseph Myers @ 2018-01-29 21:01 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

On Mon, 29 Jan 2018, vladimir.mezentsev@oracle.com wrote:

> > What about powerpc __divkc3?
> >
> > What was the rationale for using soft-fp rather than adding appropriate 
> > built-in functions as suggested in a comment?
> 
> I had a version with built-in functions and I can restore it.
> 
> Let's design what we want to use soft-fp or built-in function.
> I'd prefer to use built-in functions but performance is in two times worse.
> 
> The test below demonstrates performance degradation:

So, this is comparing __builtin_frexp (extracting both exponent and 
mantissa, including appropriate handling of exponents of subnormal values) 
with just extracting the exponent and with no special handling of zero / 
infinity / NaN / subnormal values.

We need to consider what functionality is actually needed for this 
scaling, if we do wish to use such scaling based on integer exponents.  If 
what's needed corresponds exactly to some standard functions such as ilogb 
and scalbn with all their special cases, then built-in versions of those 
standard functions may make sense.  If what's needed does not correspond 
to standard functions and does not need to handle such special cases, 
that's more of an indication for examining the representation in libgcc - 
but it's still necessary to handle the many different variant 
floating-point formats supported, or to safely avoid using the new code 
for formats it can't handle.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2018-01-29 21:01     ` Joseph Myers
@ 2018-02-06  8:55       ` vladimir.mezentsev
  2018-02-06 17:13         ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2018-02-06  8:55 UTC (permalink / raw)
  To: Joseph Myers; +Cc: gcc-patches

On 01/29/2018 12:51 PM, Joseph Myers wrote:
> On Mon, 29 Jan 2018, vladimir.mezentsev@oracle.com wrote:
>
>>> What about powerpc __divkc3?
>>>
>>> What was the rationale for using soft-fp rather than adding appropriate 
>>> built-in functions as suggested in a comment?
>> I had a version with built-in functions and I can restore it.
>>
>> Let's design what we want to use soft-fp or built-in function.
>> I'd prefer to use built-in functions but performance is in two times worse.
>>
>> The test below demonstrates performance degradation:
> So, this is comparing __builtin_frexp (extracting both exponent and 
> mantissa, including appropriate handling of exponents of subnormal values) 
> with just extracting the exponent and with no special handling of zero / 
> infinity / NaN / subnormal values.
 I compared with __builtin_ilogb. There is a same performance degradation.

> We need to consider what functionality is actually needed for this 
> scaling, if we do wish to use such scaling based on integer exponents.  If 
> what's needed corresponds exactly to some standard functions such as ilogb 
> and scalbn with all their special cases, then built-in versions of those 
> standard functions may make sense.

 The IEEE format for double is    <sign : 1> <exponent : 11> <fraction :
52>.
We need a function like extract_exponent_field.

  All standard function make an additional work to get  exponent.
It is a reason why we see performance degradation.

% cat r2.c
#include <stdio.h>
int main(int argc, char** argv)
{
  double d = 0x0.004p-1023;
  printf("d=%-24.13a  exp=%d\n", d, __builtin_ilogb(d));
  return 0;
}

% gcc -O2 -lm r2.c ; ./a.out
d=0x0.0020000000000p-1022   *exp=-1033
*
-Vladimir

>   If what's needed does not correspond 
> to standard functions and does not need to handle such special cases, 
> that's more of an indication for examining the representation in libgcc - 
> but it's still necessary to handle the many different variant 
> floating-point formats supported, or to safely avoid using the new code 
> for formats it can't handle.
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2018-02-06  8:55       ` vladimir.mezentsev
@ 2018-02-06 17:13         ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2018-02-06 17:13 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3306 bytes --]

On Tue, 6 Feb 2018, vladimir.mezentsev@oracle.com wrote:

>  I compared with __builtin_ilogb. There is a same performance degradation.

I'm not clear on exactly what you compared with.

Do you mean the *existing* __builtin_ilogb?  That's only supported for 
constant arguments that are not zero, infinity or NaN, and with an i386 
optab for -funsafe-math-optimizations.  So it's not a useful comparison at 
all, because it would call a libm function.

Rather, if built-in functions were used for this, they'd be *new* built-in 
functions.  It would be entirely possible to implement __builtin_ilogb (at 
least for -fno-math-errno) that actually expands inline, using target 
hooks to provide the values of FP_ILOGB0 / FP_ILOGBNAN, though the 
expansion might be too big to be generally useful.

But a built-in function specifically to extract the exponent field of a 
floating-point number (without doing any biasing or adjusting for special 
cases) would be a more plausible comparison.  The existing description of 
floating-point number formats in real.h includes specification of 
signbit_ro and signbit_rw.  It would be possible to have such a 
specification of the location of an exponent field, where there's one that 
can be located simply within the floating-point number, and then 
machine-independent code to expand such a built-in function.

I'm not asserting that you should add such a function.  I *am* asserting 
that the patch proposal needs to include serious consideration of various 
options such as:

* Adding such a built-in function.

* Adding predefined macros (conditional on -fbuilding-libgcc) that assert 
that a particular floating-point mode has a particular IEEE format.

Such predefined macros have a clear precedent - we already have 
__LIBGCC_%s_MANT_DIG__, __LIBGCC_HAS_%s_MODE__, __LIBGCC_%s_FUNC_EXT__, 
__LIBGCC_%s_EXCESS_PRECISION__.  So why not something to describe IEEE 
properties of a machine mode?

The use of sfp-machine.h is problematic because, while having 
sfp-machine.h implies use of at least some IEEE formats, there is no 
implication the other way round: sfp-machine.h is only present if at least 
one format uses software floating point, not if all use hardware floating 
point (or use software floating point in libc not libgcc, or use software 
floating point from fp-bit instead of soft-fp).  That's not a particularly 
sensible criterion for whether to use the new logic.

Furthermore, it's entirely possible that only some formats are IEEE - 
thus, on powerpc64le, __LIBGCC_HAS_TF_MODE__ is true, and soft-fp.h is 
present, but TFmode is actually IBM long double not IEEE binary128, so 
your logic would handle that case incorrectly.  Thus you need "mode X has 
IEEE format Y" logic that avoids the case where mode X exists, and IEEE 
format Y is supported, and sfp-machine.h exists, but mode X has another 
format, because that's actually the case right now for TFmode on 
powerpc64le.

Again, I'm not saying you should add such predefined macros - but at a 
first look I think they are a better approach than the use of presence of 
sfp-machine.h to indicate which modes have IEEE formats, and I think they 
are among the options that any patch submission needs to discuss carefully 
if rejecting.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2018-02-07  0:25   ` vladimir.mezentsev
@ 2018-02-07  0:31     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2018-02-07  0:31 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

On Tue, 6 Feb 2018, vladimir.mezentsev@oracle.com wrote:

> We see 'struct _FP_STRUCT_LAYOUT' is declared twice (in lines 206 and

_FP_STRUCT_LAYOUT is not a struct tag.  It is a macro that may be defined 
to empty, or to an attribute, and defaults to empty in soft-fp.h if not 
otherwise defined in sfp-machine.h (for example, the x86 sfp-machine.h 
defines it for MinGW where default struct layout would otherwise be 
inappropriate).

If you're seeing it used as a struct tag, that means you're missing an 
inclusion of soft-fp.h which is required to be able to include the other 
soft-fp headers.  But really I suspect that using soft-fp headers is a 
mistake here, because of the dependence on per-machine sfp-machine.h that 
should generally be irrelevant for your purposes (beyond having some way 
to declare appropriate struct layouts).

> P.S.:
> gcc/libgcc/soft-fp/ and  glibc/soft-fp/ are not synchronized now. For
> example:

It's not necessary to update after every change in glibc if that change is 
not relevant to GCC.  But if any change is required in GCC it should be 
made first in glibc, and then all files updated from the versions in 
glibc.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2018-02-06 16:53 ` Joseph Myers
@ 2018-02-07  0:25   ` vladimir.mezentsev
  2018-02-07  0:31     ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2018-02-07  0:25 UTC (permalink / raw)
  To: Joseph Myers; +Cc: gcc-patches

On 02/06/2018 08:53 AM, Joseph Myers wrote:
> The files in libgcc/soft-fp must be verbatim copies of the master sources
> in glibc.  So you can't make any local changes to them, and if you think 
> changes are needed you need to patch things upstream in glibc first, with 
> a proper extended explanation of why the fix is needed and why it is safe 
> and the appropriate design for the fix.  There's nothing at all in this 
> patch submission to explain that change.

It is a bug/typo  in gcc/libgcc/soft-fp/quad.h when _FP_W_TYPE_SIZE is
64 (for example, on aarch64) .
It looks like a code after line 202 was never used.
% cat -n libgcc/soft-fp/quad.h
...
   201   
   202    #else   /* not _FP_W_TYPE_SIZE < 64 */
   203    union _FP_UNION_Q
   204    {
   205      TFtype flt /* __attribute__ ((mode (TF))) */ ;
   206      struct *_FP_STRUCT_LAYOUT*
   207      {
   208        _FP_W_TYPE a, b;
   209      } longs;
   210      struct *_FP_STRUCT_LAYOUT*
   211      {
   212    # if __BYTE_ORDER == __BIG_ENDIAN
   213        unsigned sign    : 1;
   214        unsigned exp     : _FP_EXPBITS_Q;
   215        _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) -
_FP_W_TYPE_SIZE;
   216        _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
   217    # else
   218        _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
   219        _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) -
_FP_W_TYPE_SIZE;
   220        unsigned exp     : _FP_EXPBITS_Q;
   221        unsigned sign    : 1;
   222    # endif
   223      } bits;
   224    };

We see 'struct _FP_STRUCT_LAYOUT' is declared twice (in lines 206 and
210) inside union _FP_UNION_Q.
Compiler reports warning.


-Vladimir

P.S.:
gcc/libgcc/soft-fp/ and  glibc/soft-fp/ are not synchronized now. For
example:

% diff gcc/libgcc/soft-fp/quad.h  glibc/soft-fp/
3c3
<    Copyright (C) 1997-2016 Free Software Foundation, Inc.
---
>    Copyright (C) 1997-2018 Free Software Foundation, Inc.
96c96
<   } bits __attribute__ ((packed));
---
>   } bits;

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH]  PR libgcc/59714 complex division is surprising on aarch64
  2018-02-06  7:20 vladimir.mezentsev
@ 2018-02-06 16:53 ` Joseph Myers
  2018-02-07  0:25   ` vladimir.mezentsev
  0 siblings, 1 reply; 20+ messages in thread
From: Joseph Myers @ 2018-02-06 16:53 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

On Mon, 5 Feb 2018, vladimir.mezentsev@oracle.com wrote:

> My implementation avoids these issues.
> I use soft-fp instead built-in functions because performance with built-in
> functions (like __builtin_ilogb) is in two times worse.
> Also libm is needed for built-in functions.

I think you still need to provide a more detailed explanation of the 
implementation approach (discussing the issues and choices made, how and 
why it's safe on all systems, how your code avoids any problems with 
subnormals, infinities and NaNs, etc.).

As far as I can tell, the argument for better performance compared to 
built-in functions is that a generally useful built-in function would need 
special handling of infinities, NaNs, zero and subnormals, which you 
avoid by e.g. extracting exponent fields directly.  This means that a 
detailed justification is needed of how it's safe for the exponent fields 
of such values to be passed straight through your various functions 
without special cases 0 - probably most of that should go in comments in 
the code explaining what happens for such values and why it successfully 
avoids overflow and underflow.

The files in libgcc/soft-fp must be verbatim copies of the master sources 
in glibc.  So you can't make any local changes to them, and if you think 
changes are needed you need to patch things upstream in glibc first, with 
a proper extended explanation of why the fix is needed and why it is safe 
and the appropriate design for the fix.  There's nothing at all in this 
patch submission to explain that change.

You shouldn't have any commented-out code like your "+//#include 
"soft-fp/soft-fp.h"" in the submitted patch.

All the new inline functions need more precise comments explaining what 
their semantics are in cases such as zero, subnormals, infinities, etc., 
or stating that the semantics are that such arguments must not be passed 
to those functions.  (They also need to be formatted according to the GNU 
Coding Standards - space before '(', function name starts a new line.)

> +/* Return an exponent N, such that neither (2**(ce-N))**2 nor (2**(de-N))**2
> +   cause an overflow. Also try to avoid underflow. */

So (for example), for this comment, I'd expect information about: what is 
the valid range of exponents N that this function may return (given that, 
I suppose, you want 2**N to be a representable floating-point value), and 
what are the valid ranges of CE and DE for which this function guarantees 
to achieve those semantics with an exponent within the required range?  
And are those semantics strictly for the actual numbers specified, or, 
given how a subnormal value may result in an exponent -EXPBIAS here 
despite the actual exponent being smaller, are there additional semantics 
required in the case where CE or DE is -EXPBIAS?

Once there are comments on these functions giving all the required 
semantics, we can start to reason about whether those semantics ensure the 
required higher-level properties (regarding overflow / underflow in 
__div*c3 functions) in the case where subnormals are involved.  I'd expect 
such reasoning to appear in comments in the code.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH]  PR libgcc/59714 complex division is surprising on aarch64
@ 2018-02-06  7:20 vladimir.mezentsev
  2018-02-06 16:53 ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2018-02-06  7:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: vladimir.mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and sparc64-unknown-linux-gnu.
No regression. New tests now passed.
There is a performance degradation for complex double type:

              failed cases  |    time
               old   new    |   old  new
complex-32      15    0     |  3.51  3.56
complex-64      19    0     |  1.88  2.34
complex-128     34    0     |  3.71  2.88

The formula for complex division (a+bi)/(c+di) is (a*c+b*d)/(c*c+d*d) + (b*c-a*d)/(c*c+d*d)i
The current implementation avoids overflow in (c*c + d*d) using
  x=MAX(|c|, |d|);  c1=c/x; d1=d/x;
and then calculating the result as
  (a*c1+b*d1)/(c1*c1+d1*d1)*(1.0/x) + (b*c1-a*d1)/(c1*c1+d1*d1)*(1.0/x)i

This approach has two issues:
  1. Unexpected rounding when x is not a power of 2.0
     For example, (1.0+3.0i) /(1.0+3.0i) should be 1.0
     but it is (1.0 - 1.66533e-17i) on aarch64 (PR59714)
  2. Unexpected underflow in c/x or d/x.
     For example, (0x1.0p+1023 + 0x0.8p-1022 i)/(0x1.0p+677 + 0x1.0p-677 i)
     should be (0x1.0p+346 - 0x1.0p-1008 i) but it is (0x1.0p+346)

My implementation avoids these issues.
I use soft-fp instead built-in functions because performance with built-in
functions (like __builtin_ilogb) is in two times worse.
Also libm is needed for built-in functions.

Restrictions:
  An old implementation is used when an architecture doesn't provide sfp-machine.h
  An old implementation is used for __divkc3 (I have no access on rs6000 for testing)

ChangeLog:
2018-02-05  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR libgcc/59714
* libgcc/libgcc2.c: New complex division implementation
* libgcc/soft-fp/quad.h: struct _FP_STRUCT_LAYOUT was redefined
* libgcc/config/no-sfp-machine.h: Add _NO_SFP_MACHINE_H
* libgcc/config/sparc/sfp-machine.h: New
* gcc/testsuite/gcc.c-torture/execute/pr59714_128.c: New test
* gcc/testsuite/gcc.c-torture/execute/pr59714_32.c: New test
* gcc/testsuite/gcc.c-torture/execute/pr59714_64.c: New test
---
 gcc/testsuite/gcc.c-torture/execute/pr59714_128.c | 506 ++++++++++++++++++++++
 gcc/testsuite/gcc.c-torture/execute/pr59714_32.c  | 506 ++++++++++++++++++++++
 gcc/testsuite/gcc.c-torture/execute/pr59714_64.c  | 506 ++++++++++++++++++++++
 libgcc/config/no-sfp-machine.h                    |   3 +
 libgcc/config/sparc/sfp-machine.h                 |  14 +
 libgcc/libgcc2.c                                  | 178 +++++++-
 libgcc/soft-fp/quad.h                             |   2 +-
 7 files changed, 1710 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr59714_128.c
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr59714_32.c
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr59714_64.c
 create mode 100644 libgcc/config/sparc/sfp-machine.h

diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59714_128.c b/gcc/testsuite/gcc.c-torture/execute/pr59714_128.c
new file mode 100644
index 0000000..e26f40a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59714_128.c
@@ -0,0 +1,506 @@
+#include <stdio.h>
+#include <math.h>
+
+extern void abort (void);
+#define FABS(x) ((x) >= 0 ? (x) : -(x))
+#define FTYPE   long double
+#define FMT     "%-39.28La"
+
+/*
+   Tables of numbers for complex division testing
+   All values in hex format
+   z[i] == correctly rounded value of x[i]/y[i];
+ */
+
+#define NUMCNT 100
+
+__complex FTYPE x[NUMCNT] =
+  {
+    0x1.0p0L + 0x1.0p0Li,		/* #1 */
+    0x1.0p0L + 0x1.0p0Li,		/* #2 */
+    0x1.0p1023L + 0x1.0p-1023Li,	/* #3 */
+    0x1.0p1023L + 0x1.0p1023Li,		/* #4 */
+    0x1.0p1020L + 0x1.0p-844Li,		/* #5 */
+    0x1.0p-71L + 0x1.0p1021Li,		/* #6 */
+    0x1.0p-347L + 0x1.0p-54Li,		/* #7 */
+    0x1.0p-1074L + 0x1.0p-1074Li,	/* #8 */
+    0x1.0p1015L + 0x1.0p-989Li,		/* #9 */
+    0x1.0p-622L + 0x1.0p-1071Li,	/* #10 */
+    0x1.0p0L + 0x3.0p0Li,		/* #11 */
+    -0x1.0p0L + 0x3.0p0Li,		/* #12 */
+    0x1.0p0L - 0x3.0p0Li,		/* #13 */
+    0x3.0p0L + 0x1.0p0Li,		/* #14 */
+    0x3.0p0L + 0x4.0p0Li,		/* #15 */
+    0x1.0p0L - 0x3.000000001p-20Li,	/* #16 */
+    0x1.0p0L + 0x3.00000000001p-20Li,	/* #17 */
+    0x1.0p0L + 0x1.8000000000002p1Li,	/* #18 */
+    0x1.0p0L + 0x1.8000000000004p1Li,	/* #19 */
+    0x1.0p0L + 0x1.8000000000008p1Li,	/* #20 */
+    0x1.0p0L + 0x1.8000000000010p1Li,	/* #21 */
+    0x1.0p0L + 0x1.8000000000020p1Li,	/* #22 */
+    0x1.0p0L + 0x1.8000000000040p1Li,	/* #23 */
+    0x1.0p0L + 0x1.8000000000080p1Li,	/* #24 */
+    0x1.0p0L + 0x1.7ffffffffff8p1Li,	/* #25 */
+    0x1.0p0L + 0x1.7ffffffffff0p1Li,	/* #26 */
+    0x1.0p0L + 0x1.7fffffffff80p1Li,	/* #27 */
+    0x1.0p0L + 0x1.7fffffffff00p1Li,	/* #28 */
+    0x5.0p0L + 0x5.0p0Li,		/* #29 */
+    0x4.0p0L + 0x3.0p0Li,		/* #30 */
+    -0x4.0p0L + 0x3.000000001p0Li,	/* #31 */
+    0x3.00000000001p-20L + 0x1.0p0Li,	/* #32 */
+    0x1.00000000001p-80L + 0x1.0p0Li,	/* #33 */
+    0x1.00000000001p-8000L + 0x1.0p0Li,	/* #34 */
+    0x1.0p0L + 0x1.00000000001p-8000Li,	/* #35 */
+    -0x1.0p0L + 0x1.00000000001p-8000Li,/* #36 */
+    -0x1.0p0L + 0x1.00000000001p-8000Li,/* #37 */
+    -0x1.0p0L + 0x1.00000000001p-8000Li,/* #38 */
+    0x1.0p0L - 0x1.00000000001p-8000Li,	/* #39 */
+    0x1.0p1000L - 0x1.00000000001p-8000Li,	/* #40 */
+    0x1.97530p1000L - 0x1.00000000001p-8000Li,	/* #41 */
+    0x1.97530p3000L - 0x1.00000000001p-8000Li,	/* #42 */
+    0x1.97530p3770L - 0x1.00000000001p-8000Li,	/* #43 */
+    0x1.97530p4770L - 0x1.00000000001p-7000Li,	/* #44 */
+    0x1.97530p0L - 0x1.00000000001p-12000Li,	/* #45 */
+    0x1.97530p1000L - 0x1.00000000001p-11000Li,	/* #46 */
+    0x1.97530p2000L - 0x1.00000000001p-9000Li,	/* #47 */
+    0x1.97530p3000L - 0x1.00000000001p-8000Li,	/* #48 */
+    0x1.97530p4000L - 0x1.00000000001p-7000Li,	/* #49 */
+    0x1.97530p5000L - 0x1.00000000001p-6000Li,	/* #50 */
+    0x1.97530p6000L - 0x1.00000000001p-5000Li,	/* #51 */
+    0x1.97530p7000L - 0x1.00000000001p-4000Li,	/* #52 */
+    0x1.97530p8000L - 0x1.00000000001p-1000Li,	/* #53 */
+    0x1.97530p9000L - 0x1.00000000001p-0Li,	/* #54 */
+    0x1.97530p10000L + 0x1.00000000001p2000Li,	/* #55 */
+    0x1.97530p10100L + 0x1.00000000000p3000Li,	/* #56 */
+    0x1.97530p8000L + 0x1.00000000000p4000Li,	/* #57 */
+    0x1.97530p7000L + 0x1.00000000000p5000Li,	/* #58 */
+    0x1.97530p6000L + 0x1.00000000000p6000Li,	/* #59 */
+    0x1.97530p5200L + 0x1.00000000000p5200Li,	/* #60 */
+    0x1.0p1020L + 0x1.0p-844Li,		/* #61 */
+    0x1.0p920L + 0x1.0p-844Li,		/* #62 */
+    0x1.0p504L + 0x1.0p523Li,		/* #63 */
+    0x1.0p1004L + 0x1.0p-512Li,		/* #64 */
+    0x1.0p910L + 0x1.0p-512Li,		/* #65 */
+    0x1.0p865L + 0x1.0p-512Li,		/* #66 */
+    0x1.0p864L + 0x1.0p-512Li,		/* #67 */
+    0x1.0p860L + 0x1.0p-512Li,		/* #68 */
+    0x1.0p810L + 0x1.0p-512Li,		/* #69 */
+    0x1.0p710L + 0x1.0p-512Li,		/* #70 */
+    0x1.0p610L + 0x1.0p-512Li,		/* #71 */
+    0x1.0p510L + 0x1.0p-512Li,		/* #72 */
+    0x1.0p410L + 0x1.0p-512Li,		/* #73 */
+    0x13.0p4L + 0x1.0p-4Li,		/* #74 */
+    0x13.0p2L + 0x13.0p2Li,		/* #75 */
+    0x13.0p4L + 0x1.0p4Li,		/* #76 */
+    0x12.0p4L + 0x12.0p-4Li,		/* #77 */
+    0x1.0p1L + 0x12.0p1Li,		/* #78 */
+    0x1.0p2L + 0x1.0p4Li,		/* #79 */
+    0x13.0p0L + 0x0.0p0Li,		/* #80 */
+    0x1.01p12L - 0x1.037p-12Li,		/* #81 */
+    -0x1.01p12L - 0x1.037p-12Li,	/* #82 */
+    0x1.01p12L - 0x1.037p-12Li,		/* #83 */
+    -0x1.01p12L - 0x1.037p-12Li,	/* #84 */
+    0x1.01p12L - 0x1.037p-12Li,		/* #85 */
+    0x1.123456p3L - 0x1.789123p4Li,	/* #86 */
+    0x1.123457p3L - 0x1.789123p4Li,	/* #87 */
+    0x1.123458p3L + 0x1.789123p4Li,	/* #88 */
+    0x1.123456p3L + 0x1.789122p4Li,	/* #89 */
+    0x1.123456p3L + 0x1.789121p4Li,	/* #90 */
+    0x1.123456p3L + 0x1.789120p4Li,	/* #91 */
+    0x1.123455p3L - 0x1.789123p4Li,	/* #92 */
+    0x1.123454p3L - 0x1.789122p4Li,	/* #93 */
+    -0x1.123453p3L + 0x1.789121p4Li,	/* #94 */
+    0x1.123452p3L + 0x1.789120p4Li,	/* #95 */
+    0x1.123451p3L - 0x1.789127p4Li,	/* #96 */
+    0x1.123459p3L - 0x1.789125p4Li,	/* #97 */
+    -0x1.123450p3L + 0x1.789124p4Li,	/* #98 */
+    0x1.1234561p3L + 0x1.7891231p4Li,	/* #99 */
+    0x1.1234561p3L - 0x1.7891231p4Li	/* #100 */
+  };
+
+__complex FTYPE y[NUMCNT] =
+  {
+    0x1.0p0L + 0x1.0p1023Li,		/* #1 */
+    0x1.0p-1023L + 0x1.0p-1023Li,	/* #2 */
+    0x1.0p677L + 0x1.0p-677Li,		/* #3 */
+    0x1.0p0L + 0x1.0p0Li,		/* #4 */
+    0x1.0p656L + 0x1.0p-780Li,		/* #5 */
+    0x1.0p1001L + 0x1.0p-323Li,		/* #6 */
+    0x1.0p-1037L + 0x1.0p-1058Li,	/* #7 */
+    0x1.0p-1073L + 0x1.0p-1074Li,	/* #8 */
+    0x1.0p1023L + 0x1.0p1023Li,		/* #9 */
+    0x1.0p-343L + 0x1.0p-798Li,		/* #10 */
+    0x1.0p0L + 0x3.0p0Li,		/* #11 */
+    -0x1.0p0L + 0x3.0p0Li,		/* #12 */
+    0x1.0p0L - 0x3.0p0Li,		/* #13 */
+    0x3.0p0L + 0x1.0p0Li,		/* #14 */
+    0x3.0p0L + 0x4.0p0Li,		/* #15 */
+    -0x2.0p0L + 0x8.0p-10Li,		/* #16 */
+    0x1.0p0L + 0x3.0p-20Li,		/* #17 */
+    0x1.0p0L + 0x3.0p0Li,		/* #18 */
+    0x1.0p0L + 0x3.0p0Li,		/* #19 */
+    0x1.0p0L + 0x3.0p0Li,		/* #20 */
+    0x1.0p0L + 0x3.0p0Li,		/* #21 */
+    0x1.0p0L + 0x3.0p0Li,		/* #22 */
+    0x1.0p0L + 0x3.0p0Li,		/* #23 */
+    0x1.0p0L + 0x3.0p0Li,		/* #24 */
+    0x1.0p0L + 0x3.0p0Li,		/* #25 */
+    0x1.0p0L + 0x3.0p0Li,		/* #26 */
+    0x1.0p0L + 0x3.0p0Li,		/* #27 */
+    0x1.0p0L + 0x3.0p0Li,		/* #28 */
+    0x3.0p0L + 0x4.0p0Li,		/* #29 */
+    0x3.0p0L - 0x4.0p0Li,		/* #30 */
+    -0x3.0p0L - 0x4.0p0Li,		/* #31 */
+    0x3.0p-20L + 0x1.0p0Li,		/* #32 */
+    0x1.0p-80L + 0x1.0p0Li,		/* #33 */
+    0x1.0p-80L + 0x1.0p0Li,		/* #34 */
+    0x1.0p0L + 0x1.0p-8000Li,		/* #35 */
+    0x1.0p0L + 0x1.0p-8000Li,		/* #36 */
+    -0x1.0p0L + 0x1.0p-8000Li,		/* #37 */
+    0x1.0p0L - 0x1.0p-8000Li,		/* #38 */
+    0x1.0p0L + 0x1.0p-8000Li,		/* #39 */
+    0x1.0p100L + 0x1.0p-8000Li,		/* #40 */
+    0x1.97530p100L + 0x1.0p-8000Li,	/* #41 */
+    0x1.97530p300L + 0x1.0p-8000Li,	/* #42 */
+    0x1.0p-6000L + 0x1.97530p3770Li,	/* #43 */
+    0x1.0p-5000L + 0x1.97530p4770Li,	/* #44 */
+    0x1.0p-9000L + 0x1.97530p0Li,	/* #45 */
+    0x1.0p-8000L + 0x1.97530p1000Li,	/* #46 */
+    0x1.0p-7000L + 0x1.97530p2000Li,	/* #47 */
+    0x1.0p-6000L + 0x1.97530p3000Li,	/* #48 */
+    0x1.0p-5000L + 0x1.97530p4000Li,	/* #49 */
+    0x1.0p-4000L + 0x1.97530p5000Li,	/* #50 */
+    0x1.0p-3000L + 0x1.97530p6000Li,	/* #51 */
+    0x1.0p-2000L + 0x1.97530p7000Li,	/* #52 */
+    0x1.0p-1000L + 0x1.97530p8000Li,	/* #53 */
+    0x1.0p-0L + 0x1.97530p900Li,	/* #54 */
+    0x1.97530p100L + 0x1.0000p100Li,	/* #55 */
+    0x1.97530p50L + 0x1.0000p50Li,	/* #56 */
+    0x1.97530p100L + 0x1.0000p50Li,	/* #57 */
+    0x1.97530p1L + 0x1.0000p1Li,	/* #58 */
+    0x1.97530p1L + 0x1.0000p1Li,	/* #59 */
+    0x1.97530p1L + 0x1.0000p1Li,	/* #60 */
+    0x1.0p656L + 0x1.0p-730Li,		/* #61 */
+    0x1.0p656L + 0x1.0p-730Li,		/* #62 */
+    0x1.0p-500L + 0x1.0p-1000Li,	/* #63 */
+    0x1.0p0L + 0x1.0p-500Li,		/* #64 */
+    0x1.0p-110L + 0x1.0p-500Li,		/* #65 */
+    0x1.0p-155L + 0x1.0p-500Li,		/* #66 */
+    0x1.0p-156L + 0x1.0p-500Li,		/* #67 */
+    0x1.0p-160L + 0x1.0p-500Li,		/* #68 */
+    0x1.0p-210L + 0x1.0p-500Li,		/* #69 */
+    0x1.0p-310L + 0x1.0p-500Li,		/* #70 */
+    0x1.0p-410L + 0x1.0p-500Li,		/* #71 */
+    0x1.0p-510L + 0x1.0p-600Li,		/* #72 */
+    0x1.0p-610L + 0x1.0p-700Li,		/* #73 */
+    0x5.0p1L + 0x12.0p1Li,		/* #74 */
+    0x5.0p1L + 0x12.0p1Li,		/* #75 */
+    0x5.0p1L + 0x12.0p1Li,		/* #76 */
+    0x5.0p1L + 0x12.0p1Li,		/* #77 */
+    0x5.0p1L + 0x12.0p1Li,		/* #78 */
+    0x5.0p1L + 0x12.0p1Li,		/* #79 */
+    0x5.0p1L + 0x12.0p1Li,		/* #80 */
+    0x3.1p0L + 0x1.1p0Li,		/* #81 */
+    -0x3.0p0L + 0x1.1p0Li,		/* #82 */
+    -0x3.0p0L + 0x1.1p0Li,		/* #83 */
+    0x3.0p0L + 0x1.1p0Li,		/* #84 */
+    0x3.0p0L + 0x1.1p0Li,		/* #85 */
+    0x1.456789p2L - 0x1.789123p1Li,	/* #86 */
+    0x1.124569p2L - 0x1.781239p3Li,	/* #87 */
+    0x1.123457p3L - 0x1.789126p4Li,	/* #88 */
+    0x1.123456p1L + 0x1.891237p4Li,	/* #89 */
+    0x1.123456p2L + 0x1.357123p3Li,	/* #90 */
+    0x1.123456p3L - 0x1.789123p1Li,	/* #91 */
+    0x1.123456p1L - 0x1.789123p4Li,	/* #92 */
+    0x1.123456p2L + 0x1.789123p1Li,	/* #93 */
+    0x1.123456p3L + 0x1.789123p0Li,	/* #94 */
+    -0x1.123456p1L - 0x1.789153p-2Li,	/* #95 */
+    -0x1.123456p2L - 0x1.785123p7Li,	/* #96 */
+    -0x1.123456p3L + 0x1.789123p9Li,	/* #97 */
+    0x1.123456p1L - 0x1.789123p20Li,	/* #98 */
+    0x1.123456p2L - 0x1.337788p21Li,	/* #99 */
+    0x1.123457p3L - 0x1.789991p3Li	/* #100 */
+  };
+
+__complex FTYPE z[NUMCNT] =
+  {
+    0x1.0p-1023L - 0x1.0p-1023Li,	/* #1 */
+    0x1.0p1023L + 0x0.0p0Li,		/* #2 */
+    0x1.0p346L - 0x1.0p-1008Li,		/* #3 */
+    0x1.0p1023L + 0x0.0p0Li,		/* #4 */
+    0x1.0p364L - 0x1.0p-1072Li,		/* #5 */
+    0x1.0p-1072L + 0x1.0p20Li,		/* #6 */
+    0x1.ffffffffff800000000020p+961L + 0x1.ffffffffff800000000020p+982Li,/* #7 */
+    0x1.3333333333333333333333333333p-1L + 0x1.999999999999999999999999999ap-3Li,/* #8 */
+    0.001953125L - 0.001953125Li,	/* #9 */
+    0x1.000000000000000000000000000p-279L + 0x1.f800000000000000000000000000p-729Li,/* #10 */
+    0x1.0p0L + 0x0.0p0Li,		/* #11 */
+    0x1.0p0L + 0x0.0p0Li,		/* #12 */
+    0x1.0p0L + 0x0.0p0Li,		/* #13 */
+    0x1.0p0L + 0x0.0p0Li,		/* #14 */
+    0x1.0p0L + 0x0.0p0Li,		/* #15 */
+    -0x1.fffe0061ff9e0063ff9c0063ff9cp-2L - 0x1.ff9e0061ff9c0063ff9c0063ff9cp-10Li,/* #16 */
+    0x1.0000000000000000000030000000p+0L + 0x1.ffffffffee00000000a1fffffffap-65Li,/* #17 */
+    0x1.0000000000001333333333333333p+0L + 0x1.9999999999999999999999999999p-54Li,/* #18 */
+    0x1.0000000000002666666666666666p+0L + 0x1.9999999999999999999999999999p-53Li,/* #19 */
+    0x1.0000000000004ccccccccccccccdp+0L + 0x1.9999999999999999999999999999p-52Li,/* #20 */
+    0x1.000000000000999999999999999ap+0L + 0x1.999999999999999999999999999ap-51Li,/* #21 */
+    0x1.0000000000013333333333333333p+0L + 0x1.999999999999999999999999999ap-50Li,/* #22 */
+    0x1.0000000000026666666666666666p+0L + 0x1.999999999999999999999999999ap-49Li,/* #23 */
+    0x1.000000000004cccccccccccccccdp+0L + 0x1.999999999999999999999999999ap-48Li,/* #24 */
+    0x1.fffffffffff66666666666666666p-1L - 0x1.999999999999999999999999999ap-48Li,/* #25 */
+    0x1.ffffffffffeccccccccccccccccdp-1L - 0x1.999999999999999999999999999ap-47Li,/* #26 */
+    0x1.ffffffffff666666666666666666p-1L - 0x1.999999999999999999999999999ap-44Li,/* #27 */
+    0x1.fffffffffecccccccccccccccccdp-1L - 0x1.999999999999999999999999999ap-43Li,/* #28 */
+    0x1.6666666666666666666666666666p+0L - 0x1.999999999999999999999999999ap-3Li,/* #29 */
+    0x0.0p0L + 0x1.0p0Li,				/* #30 */
+    -0x1.47ae147ae147ae147ae147ae147bp-39L - 0x1.0000000001eb851eb851eb851eb8p+0Li,/* #31 */
+    0x1.0000000000000000000030000000p+0L - 0x1.ffffffffee00000000a1fffffffap-65Li,/* #32 */
+    0x1.00000000000000p0L - 0x1.0000000000000p-124Li,	/* #33 */
+    0x1.00000000000000p0L + 0x1.0000000000000p-80Li,	/* #34 */
+    0x1.00000000000000p0L + 0x1.0000000000000p-8044Li,	/* #35 */
+    -0x1.00000000000000p0L + 0x1.0000000000080p-7999Li,	/* #36 */
+    0x1.00000000000000p0L - 0x1.0000000000000p-8044Li,	/* #37 */
+    -0x1.00000000000000p0L + 0x1.0000000000000p-8044Li,	/* #38 */
+    0x1.00000000000000p0L - 0x1.0000000000080p-7999Li,	/* #39 */
+    0x1.00000000000000p+900L - 0x1.0000000000000p-7200Li,/* #40 */
+    0x1.0000000000000000000000000000p+900L - 0x1.41c9b303bfbf1bb3465e771d2c5fp-7201Li,/* #41 */
+    0x1.0000000000000000000000000000p+2700L - 0x1.41c9b303bfbf1bb3465e771d2c5fp-5601Li,/* #42 */
+    0x1.41c9b303bfb510p-9771L - 0x1.0000000000000p0Li,	/* #43 */
+    0x1.41c9b303bfb510p-9771L - 0x1.0000000000000p0Li,	/* #44 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #45 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #46 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #47 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #48 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #49 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #50 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #51 */
+    0x1.41c9b303bfb50d65ae407974c131p-9001L - 0x1.0000000000000000000000000000p+0Li,/* #52 */
+    -0x1.41c9b303bfb50d65ae407974c131p-9045L - 0x1.0000000000000000000000000000p+0Li,/* #53 */
+    0x1.41c9b303bfb50d65ae407974c131p+7199L - 0x1.0000000000000000000000000000p+8100Li,/* #54 */
+    0x1.6f0647208a31a185daaf720445b3p+9899L - 0x1.cd580bc4697c9439a5da55b27b9dp+9898Li,/* #55 */
+    0x1.6f0647208a31a185daaf720445b3p+10049L - 0x1.cd580bc4697c9439a5da55b27b9dp+10048Li,/* #56 */
+    0x1.fffffffffffffffffffffffff35cp+7899L - 0x1.41c9b303bfb50d65ae407974b940p+7849Li,/* #57 */
+    0x1.6f0647208a31a185daaf720445b3p+6998L -0x1.cd580bc4697c9439a5da55b27b9dp+6997Li,/* #58 */
+    0x1.00000000000000p5999L + 0x0.0000000000000p0Li,	/* #59 */
+    0x1.00000000000000p5199L + 0x0.0000000000000p0Li,	/* #60 */
+    0x1.0p364L - 0x1.0p-1022Li,				/* #61 */
+    0x1.0p264L + 0x0.0p0Li,				/* #62 */
+    0x1.0p1004L + 0x1.0p1023Li,				/* #63 */
+    0x1.0p1004L - 0x1.0p504Li,				/* #64 */
+    0x1.0p1020L - 0x1.0p630Li,				/* #65 */
+    0x1.0p1020L - 0x1.0p675Li,				/* #66 */
+    0x1.0p1020L - 0x1.0p676Li,				/* #67 */
+    0x1.0p1020L - 0x1.0p680Li,				/* #68 */
+    0x1.0p1020L - 0x1.0p730Li,				/* #69 */
+    0x1.0p1020L - 0x1.0p830Li,				/* #70 */
+    0x1.0p1020L - 0x1.0p930Li,				/* #71 */
+    0x1.0p1020L - 0x1.0p930Li,				/* #72 */
+    0x1.0p1020L - 0x1.0p930Li,				/* #73 */
+    0x1.16f21023358c1a682913ce1ecedbp+1L - 0x1.f5b3b6a5c6c8fc5516bd3fd10df0p+2Li,/* #74 */
+    0x1.408cd63069a0a44f387b3b6a5c6dp+1L - 0x1.6a5c6c8fc5516bd3fd10defdcca7p+0Li,/* #75 */
+    0x1.4b8d91f8aa2d7a7fa21bdfb994e8p+1L - 0x1.ee6539f2cbeb7618f09892b4726ep+2Li,/* #76 */
+    0x1.0bc8408cd63069a0a44f387b3b6ap+1L - 0x1.daceda971b23f1545af4ff4437bfp+2Li,/* #77 */
+    0x1.e2a8b5e9fe886f7ee6539f2cbeb7p-1L + 0x1.a682913ce1eceda971b23f1545afp-3Li,/* #78 */
+    0x1.c3d9db52e3647e2a8b5e9fe886f8p-2L + 0x1.77908119ac60d341489e70f676d5p-7Li,/* #79 */
+    0x1.16bd3fd10defdcca73e597d6ec32p-3L - 0x1.f5bb0c784c495a393703aae942c0p-2Li,/* #80 */
+    0x1.2b9c43596635aca22a41182c285ap+10L - 0x1.9fc933bd0b3ad039dc99076c4ce5p+8Li,/* #81 */
+    0x1.3079a1638e441f32a5aa1b723a40p+10L + 0x1.af56ff5f5ee08187c006518c7d30p+8Li,/* #82 */
+    -0x1.3079a23d4567c32f17cb15076791p+10L - 0x1.af56f5c477a85482b70a5dca7d62p+8Li,/* #83 */
+    -0x1.3079a23d4567c32f17cb15076791p+10L + 0x1.af56f5c477a85482b70a5dca7d62p+8Li,/* #84 */
+    0x1.3079a1638e441f32a5aa1b723a40p+10L - 0x1.af56ff5f5ee08187c006518c7d30p+8Li,/* #85 */
+    0x1.a27419691d7845d82a1a772258e1p+1L - 0x1.5e60a434afdfd9c1419d2d842cc2p+1Li,/* #86 */
+    0x1.004a6235052b9121263d9c6bbcf4p+1L - 0x1.077970d2017e9637b3c295f86c7cp-10Li,/* #87 */
+    -0x1.8825f329396f03f5c813952be304p-1L + 0x1.492fb9aef1c34c5b463f22218a07p-1Li,/* #88 */
+    0x1.f6417093502e5e03be9d91d13905p-1L - 0x1.0d936b36d23867a75c17114df9ecp-2Li,/* #89 */ 
+    0x1.2e6b76d3c1a73913587096f2fbbdp+1L + 0x1.4911f033da9e45b4f001b864e760p-3Li,/* #90 */
+    0x1.a1ced84e145e8f5819427f5ea14ep-5L + 0x1.61ced4d722d37f7966cd7c068306p+1Li,/* #91 */
+    0x1.064f7bc3e4833b1e0eff54a3a904p+0L + 0x1.1551c3ae74bd101253588f742243p-2Li,/* #92 */
+    -0x1.344545d341aa8a2f9369a5ec3128p+0L - 0x1.2aa5da272dd3d1102e6c406cbc70p+2Li,/* #93 */
+    -0x1.06d98474fe894386c4fbcde25e3bp-1L + 0x1.6ad8d7df1b0c7bd93084ecbd82ebp+1Li,/* #94 */
+    -0x1.6deb5a7bec3179206289e83a4b65p+2L - 0x1.4028b8d0a2fc1a39d6eea3f8bb57p+3Li,/* #95 */
+    0x1.fbd4560086545ef1cd464e251162p-4L + 0x1.8c3278a9ca9b4301daab9f0d2131p-5Li,/* #96 */
+    -0x1.0106f72f51797fe080e71a8997a9p-5L - 0x1.69200e9aa701c65e7069852801a9p-7Li,/* #97 */ 
+    -0x1.00000929d9955dc02885e23cfb27p-16L - 0x1.74d2319d4234332ac55f42cc52d5p-18Li,/* #98 */
+    -0x1.39887db89b6869b8281a9f4222eep-17L + 0x1.c89cdfee34a155f4544297ef8798p-19Li,/* #99 */
+    0x1.a746a452d342fdd9745efdf4d52ap+0L - 0x1.e72d9f35e28e6208e42c8cc5a560p-2Li/* #100 */
+  };
+
+
+__complex FTYPE errmax[NUMCNT] =
+  {
+    0x0.000000000000000000000000p0L + 0x0.000000000000000000000000p0Li,/* #1 */
+    0x0.000000000000000000000001p1023+ 0x0.000000000000000000000001p0Li,/* #2 */
+    0x0.000000000000000000000001p346L + 0x0.000000000000000100000000p-1008Li,/* #3 */
+    0x0.000000000000000000000001p1023+ 0x0.000000000000000000000001p0Li,/* #4 */
+    0x0.000000000000000000000001p364L + 0x0.000000000000000000000000p0Li,/* #5 */
+    0x0.000000000000000000000000p0L + 0x0.000000000000000000000001p20Li,/* #6 */
+    0x0.000000000000000000000001p961L + 0x0.00000000000000000000001p982Li,/* #7 */
+    0x0.000000000000000000000001p-1L + 0x0.00000000000000000000001p-3Li,	/* #8 */
+    0x0.000000000000000000000001p-9L + 0x0.000000000000000000000001p-9Li,/* #9 */
+    0x0.000000000000000000000001p279L + 0x0.0000000000000000000000001p-171Li,/* #10 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000000001p0Li,/* #11 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #12 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #13 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #14 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #15 */
+    0x0.000000000000000000000001p33L + 0x0.0000000000000000000001p-10Li,/* #16 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-65Li,/* #17 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-54Li,/* #18 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-53Li,/* #19 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-52Li,/* #20 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-51Li,/* #21 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-50Li,/* #22 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-49Li,/* #23 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-48Li,/* #24 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-48Li,/* #25 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-47Li,/* #26 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-44Li,/* #27 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-43Li,/* #28 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-3Li,/* #29 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p0Li,/* #30 */
+    0x0.000000000000000000000001p-39L + 0x0.0000000000000000000001p0Li,/* #31 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-65Li,/* #32 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-124Li,/* #33 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-80Li,/* #34 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-8044Li,/* #35 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-7999Li,/* #36 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-8044Li,/* #37 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-8044Li,/* #38 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-7999Li,/* #39 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-7200Li,/* #40 */
+    0x0.000000000000000000000001p900L + 0x0.0000000000000000000001p-720Li,/* #41 */
+    0x0.000000000000000000000001p2700L + 0x0.0000000000000000000001p-560Li,/* #42 */
+    0x0.000000000000100000000000p-9771L+ 0x0.0000000000000000000001p0Li,/* #43 */
+    0x0.000000000000100000000001p-9771L+ 0x0.0000000000000000000001p0Li,/* #44 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #45 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #46 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #47 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #48 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #49 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #50 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #51 */
+    0x0.000000000000000000000001p-9001L+ 0x0.0000000000000000000001p0Li,/* #52 */
+    0x0.000000000000000000000001p-9045L+ 0x0.0000000000000000000001p0Li,/* #53 */
+    0x0.000000000000000000000001p7199L+ 0x0.0000000000000000000001p8100Li,/* #54 */
+    0x0.000000000000000000000001p9899L+ 0x0.0000000000000000000001p9898Li,/* #55 */
+    0x0.000000000000000000000001p10049L+ 0x0.0000000000000000000001p10048Li,/* #56 */
+    0x0.000000000000000000000001p7899L+ 0x0.0000000000000000000001p7849Li,/* #57 */
+    0x0.000000000000000000000001p6998L+ 0x0.0000000000000000000001p6997Li,/* #58 */
+    0x0.000000000000000000000001p5999L+ 0x0.0000000000000000000001p0Li,/* #59 */
+    0x0.000000000000000000000001p5199L+ 0x0.0000000000000000000001p0Li,/* #60 */
+    0x0.000000000000000000000001p364L+ 0x0.0000000000000000000000p0Li,/* #61 */
+    0x0.000000000000000000000001p264L+ 0x0.0000000000000000000001p0Li,/* #62 */
+    0x0.000000000000000000000001p1004L+ 0x0.0000000000000000000001p1023Li,/* #63 */
+    0x0.000000000000000000000001p1004L+ 0x0.0000000000000000000001p504Li,/* #64 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p630Li,/* #65 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p675Li,/* #66 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p676Li,/* #67 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p680Li,/* #68 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p730Li,/* #69 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p830Li,/* #70 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p930Li,/* #71 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p930Li,/* #72 */
+    0x0.000000000000000000000001p1020L+ 0x0.0000000000000000000001p930Li,/* #73 */
+    0x0.000000000000000000000001p7L + 0x0.0000000000000000000001p0Li,/* #74 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p0Li,/* #75 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p2Li,/* #76 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p2Li,/* #77 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-3Li,/* #78 */
+    0x0.000000000000000000000001p-2L + 0x0.0000000000000000000001p-7Li,/* #79 */
+    0x0.000000000000000000000001p-3L + 0x0.0000000000000000000001p-2Li,/* #80 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #81 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #82 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #83 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #84 */
+    0x0.000000000000000000000001p10L + 0x0.0000000000000000000001p8Li,/* #85 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p1Li,/* #86 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p-10Li,/* #87 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-1Li,/* #88 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p-2Li,/* #89 */
+    0x0.000000000000000000000001p1L + 0x0.0000000000000000000001p-3Li,/* #90 */
+    0x0.000000000000000000000001p-5L + 0x0.0000000000000000000001p1Li,/* #91 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-2Li,/* #92 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p2Li,/* #93 */
+    0x0.000000000000000000000001p-1L + 0x0.0000000000000000000001p1Li,/* #94 */
+    0x0.000000000000000000000001p2L + 0x0.0000000000000000000001p3Li,/* #95 */
+    0x0.000000000000000000000001p-4L + 0x0.0000000000000000000001p-5Li,/* #96 */
+    0x0.000000000000000000000001p-5L + 0x0.0000000000000000000001p-7Li,/* #97 */
+    0x0.000000000000000000000001p-16L + 0x0.0000000000000000000001p-18Li,/* #98 */
+    0x0.000000000000000000000001p-17L + 0x0.0000000000000000000001p-19Li,/* #99 */
+    0x0.000000000000000000000001p0L + 0x0.0000000000000000000001p-2Li/* #100 */
+  };
+
+
+int main(int argc, char** argv)
+{
+  int i;
+  FTYPE xr, xi, yr, yi, zr, zi, zzr, zzi;
+  FTYPE er, ei;
+  __complex FTYPE ans[NUMCNT];
+  int errcnt;
+
+  errcnt = 0;
+  for (i = 0; i < NUMCNT; i++)
+    {
+      ans[i] = x[i] / y[i];
+      if( z[i] != z[i] )   /* Check for nan/inf case */
+	{
+	  zr = __real__ z[i];
+	  zi = __imag__ z[i];
+	  zzr = __real__ ans[i];
+	  zzi = __imag__ ans[i];
+	  er = __real__ errmax[i];
+	  ei = __imag__ errmax[i];
+	  errcnt++;
+	  printf("x %3d    " FMT " " FMT "i\n",
+		 i + 1, __real__ x[i], __imag__ x[i]);
+	  printf ("y %3d   " FMT " " FMT "i\n",
+		  i + 1, __real__ y[i], __imag__ y[i]);
+	  printf("expected " FMT " " FMT "i\n",
+		 __real__ z[i], __imag__ z[i]);
+	  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+		 __real__ ans[i], __imag__ ans[i], i + 1);
+	  printf("diff     " FMT " " FMT "i\n",
+		 zr - zzr, zi - zzi);
+	  printf("errmax   " FMT " " FMT "i\n\n",
+		 er, ei);
+	}
+      else
+	{
+	  if( z[i] != ans[i] )
+	    {
+	      zr = __real__ z[i];
+	      zi = __imag__ z[i];
+	      zzr = __real__ ans[i];
+	      zzi = __imag__ ans[i];
+	      er = __real__ errmax[i];
+	      ei = __imag__ errmax[i];
+	      if( (FABS(zr-zzr) > er) || (FABS(zi-zzi) > ei))
+		{	 /* report if error exceeds error max */
+		  errcnt++;
+		  printf("x %3d    " FMT " " FMT "i\n",
+			 i + 1, __real__ x[i], __imag__ x[i]);
+		  printf ("y %3d    " FMT " " FMT "i\n",
+			  i + 1, __real__ y[i], __imag__ y[i]);
+		  printf("expected " FMT " " FMT "i\n",
+			 __real__ z[i], __imag__ z[i]);
+		  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+			 __real__ ans[i], __imag__ ans[i], i + 1);
+		  printf("diff     " FMT " " FMT "i\n",
+			 zr - zzr, zi - zzi);
+		  printf("errmax   " FMT " " FMT "i\n\n",
+			 er, ei);
+		}
+	    }
+	}
+    }
+  if( errcnt > 0)
+    {
+      printf("%2d Failures\n",errcnt);
+      abort();
+    }
+  printf("PASS\n");
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59714_32.c b/gcc/testsuite/gcc.c-torture/execute/pr59714_32.c
new file mode 100644
index 0000000..170e363
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59714_32.c
@@ -0,0 +1,506 @@
+#include <stdio.h>
+#include <math.h>
+
+extern void abort (void);
+#define FABS(x) ((x) >= 0 ? (x) : -(x))
+#define FTYPE   float
+#define FMT     "%-17.6a"
+
+/*
+   Tables of numbers for complex division testing
+   All values in hex format
+   z[i] == correctly rounded value of x[i]/y[i];
+ */
+
+#define NUMCNT 100
+
+__complex FTYPE x[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p0i,			/* #1 */
+    0x1.0p0 + 0x1.0p0i,			/* #2 */
+    0x1.0p127 + 0x1.0p-126i,		/* #3 */
+    0x1.0p127 + 0x1.0p127i,		/* #4 */
+    0x1.0p124 + 0x1.0p-44i,		/* #5 */
+    0x1.0p-71 + 0x1.0p125i,		/* #6 */
+    0x1.0p-47 + 0x1.0p-54i,		/* #7 */
+    0x1.0p-149 + 0x1.0p-149i,		/* #8 */
+    0x1.0p120 + 0x1.0p-89i,		/* #9 */
+    0x1.0p-22 + 0x1.0p-146i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    0x1.0p0 - 0x3.000002p-20i,		/* #16 */
+    0x1.0p0 + 0x3.000002p-20i,		/* #17 */
+    0x1.0p0 + 0x1.800002p1i,		/* #18 */
+    0x1.0p0 + 0x1.800004p1i,		/* #19 */
+    0x1.0p0 + 0x1.800008p1i,		/* #20 */
+    0x1.0p0 + 0x1.800010p1i,		/* #21 */
+    0x1.0p0 + 0x1.800020p1i,		/* #22 */
+    0x1.0p0 + 0x1.800040p1i,		/* #23 */
+    0x1.0p0 + 0x1.800080p1i,		/* #24 */
+    0x1.0p0 + 0x1.7ffff8p1i,		/* #25 */
+    0x1.0p0 + 0x1.7ffff0p1i,		/* #26 */
+    0x1.0p0 + 0x1.7fff80p1i,		/* #27 */
+    0x1.0p0 + 0x1.7fff00p1i,		/* #28 */
+    0x5.0p0 + 0x5.0p0i,			/* #29 */
+    0x4.0p0 + 0x3.0p0i,			/* #30 */
+    -0x4.0p0 + 0x3.000004p0i,           /* #31 */
+    0x3.000004p-20 + 0x1.0p0i,		/* #32 */
+    0x1.000002p-80 + 0x1.0p0i,		/* #33 */
+    0x1.000002p-100 + 0x1.0p0i,		/* #34 */
+    0x1.0p0 + 0x1.000002p-100i,		/* #35 */
+    -0x1.0p0 + 0x1.000002p-100i,	/* #36 */
+    -0x1.0p0 + 0x1.000002p-100i,	/* #37 */
+    -0x1.0p0 + 0x1.000002p-100i,	/* #38 */
+    0x1.0p0 - 0x1.000002p-100i,		/* #39 */
+    0x1.0p40 - 0x1.000010p-60i,		/* #40 */
+    0x1.975300p50 - 0x1.000002p-100i,	/* #41 */
+    0x1.975300p100 - 0x1.000002p-100i,	/* #42 */
+    0x1.975300p77 - 0x1.000002p-60i,	/* #43 */
+    0x1.975300p87 - 0x1.000002p-60i,	/* #44 */
+    0x1.975300p0 - 0x1.000002p-60i,	/* #45 */
+    0x1.975300p50 - 0x1.000002p-60i,	/* #46 */
+    0x1.975300p60 - 0x1.000002p-60i,	/* #47 */
+    0x1.975300p70 - 0x1.000002p-60i,	/* #48 */
+    0x1.975300p80 - 0x1.000002p-60i,	/* #49 */
+    0x1.975300p90 - 0x1.000002p-60i,	/* #50 */
+    0x1.975300p100 - 0x1.000002p-60i,	/* #51 */
+    0x1.975300p110 - 0x1.000002p-60i,	/* #52 */
+    0x1.975300p115 - 0x1.000002p-60i,	/* #53 */
+    0x1.975300p120 - 0x1.000002p-0i,	/* #54 */
+    0x1.975300p125 + 0x1.000002p70i,	/* #55 */
+    0x1.975300p126 + 0x1.000000p80i,	/* #56 */
+    0x1.975300p100 + 0x1.000000p90i,	/* #57 */
+    0x1.975300p90 + 0x1.000000p95i,	/* #58 */
+    0x1.975300p80 + 0x1.000000p100i,	/* #59 */
+    0x1.97530p72 + 0x1.000000p72i,	/* #60 */
+    0x1.0p120 + 0x1.0p-844i,		/* #61 */
+    0x1.0p90 + 0x1.0p-844i,		/* #62 */
+    0x1.0p54 + 0x1.0p53i,		/* #63 */
+    0x1.0p14 + 0x1.0p-51i,		/* #64 */
+    0x1.0p90 + 0x1.0p-51i,		/* #65 */
+    0x1.0p85 + 0x1.0p-51i,		/* #66 */
+    0x1.0p84 + 0x1.0p-51i,		/* #67 */
+    0x1.0p80 + 0x1.0p-51i,		/* #68 */
+    0x1.0p81 + 0x1.0p-51i,		/* #69 */
+    0x1.0p71 + 0x1.0p-51i,		/* #70 */
+    0x1.0p61 + 0x1.0p-51i,		/* #71 */
+    0x1.0p51 + 0x1.0p-51i,		/* #72 */
+    0x1.0p41 + 0x1.0p-51i,		/* #73 */
+    0x13.0p4 + 0x1.0p-4i,		/* #74 */
+    0x13.0p2 + 0x13.0p2i,		/* #75 */
+    0x13.0p4 + 0x1.0p4i,		/* #76 */
+    0x12.0p4 + 0x12.0p-4i,		/* #77 */
+    0x1.0p1 + 0x12.0p1i,		/* #78 */
+    0x1.0p2 + 0x1.0p4i,			/* #79 */
+    0x13.0p0 + 0x0.0p0i,		/* #80 */
+    0x1.01p12 - 0x1.037p-12i,		/* #81 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #82 */
+    0x1.01p12 - 0x1.037p-12i,		/* #83 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #84 */
+    0x1.01p12 - 0x1.037p-12i,		/* #85 */
+    0x1.123456p3 - 0x1.789123p4i,	/* #86 */
+    0x1.123457p3 - 0x1.789123p4i,	/* #87 */
+    0x1.123458p3 + 0x1.789123p4i,	/* #88 */
+    0x1.123456p3 + 0x1.789122p4i,	/* #89 */
+    0x1.123456p3 + 0x1.789121p4i,	/* #90 */
+    0x1.123456p3 + 0x1.789120p4i,	/* #91 */
+    0x1.123455p3 - 0x1.789123p4i,	/* #92 */
+    0x1.123454p3 - 0x1.789122p4i,	/* #93 */
+    -0x1.123453p3 + 0x1.789121p4i,	/* #94 */
+    0x1.123452p3 + 0x1.789120p4i,	/* #95 */
+    0x1.123451p3 - 0x1.789127p4i,	/* #96 */
+    0x1.123459p3 - 0x1.789125p4i,	/* #97 */
+    -0x1.123450p3 + 0x1.789124p4i,	/* #98 */
+    0x1.123456p3 + 0x1.789123p4i,	/* #99 */
+    0x1.123456p3 - 0x1.789123p4i	/* #100 */
+  };
+
+__complex FTYPE y[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p127i,		/* #1 */
+    0x1.0p-126 + 0x1.0p-126i,		/* #2 */
+    0x1.0p77 + 0x1.0p-77i,		/* #3 */
+    0x1.0p0 + 0x1.0p0i,			/* #4 */
+    0x1.0p65 + 0x1.0p-78i,		/* #5 */
+    0x1.0p99 + 0x1.0p-33i,		/* #6 */
+    0x1.0p-133 + 0x1.0p-140i,		/* #7 */
+    0x1.0p-148 + 0x1.0p-148i,		/* #8 */
+    0x1.0p127 + 0x1.0p127i,		/* #9 */
+    0x1.0p-34 + 0x1.0p-79i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    -0x2.0p0 + 0x8.0p-10i,		/* #16 */
+    0x1.0p0 + 0x3.0p-20i,		/* #17 */
+    0x1.0p0 + 0x3.0p0i,			/* #18 */
+    0x1.0p0 + 0x3.0p0i,			/* #19 */
+    0x1.0p0 + 0x3.0p0i,			/* #20 */
+    0x1.0p0 + 0x3.0p0i,			/* #21 */
+    0x1.0p0 + 0x3.0p0i,			/* #22 */
+    0x1.0p0 + 0x3.0p0i,			/* #23 */
+    0x1.0p0 + 0x3.0p0i,			/* #24 */
+    0x1.0p0 + 0x3.0p0i,			/* #25 */
+    0x1.0p0 + 0x3.0p0i,			/* #26 */
+    0x1.0p0 + 0x3.0p0i,			/* #27 */
+    0x1.0p0 + 0x3.0p0i,			/* #28 */
+    0x3.0p0 + 0x4.0p0i,			/* #29 */
+    0x3.0p0 - 0x4.0p0i,			/* #30 */
+    -0x3.0p0 - 0x4.0p0i,		/* #31 */
+    0x3.0p-20 + 0x1.0p0i,		/* #32 */
+    0x1.000000p-80 + 0x1.0p0i,		/* #33 */
+    0x1.0p-80 + 0x1.0p0i,		/* #34 */
+    0x1.0p0 + 0x1.0p-60i,		/* #35 */
+    0x1.0p0 + 0x1.0p-60i,		/* #36 */
+    -0x1.0p0 + 0x1.0p-60i,		/* #37 */
+    0x1.0p0 - 0x1.0p-60i,		/* #38 */
+    0x1.0p0 + 0x1.0p-60i,		/* #39 */
+    0x1.0p40 + 0x1.0p-60i,		/* #40 */
+    0x1.97530p50 + 0x1.0p-60i,		/* #41 */
+    0x1.97530p80 + 0x1.0p-60i,		/* #42 */
+    0x1.0p-60 + 0x1.97530p57i,		/* #43 */
+    0x1.0p-50 + 0x1.97530p57i,		/* #44 */
+    0x1.0p-90 + 0x1.97530p0i,		/* #45 */
+    0x1.0p-80 + 0x1.97530p10i,		/* #46 */
+    0x1.0p-70 + 0x1.97530p20i,		/* #47 */
+    0x1.0p-60 + 0x1.97530p30i,		/* #48 */
+    0x1.0p-50 + 0x1.97530p40i,		/* #49 */
+    0x1.0p-40 + 0x1.97530p50i,		/* #50 */
+    0x1.0p-30 + 0x1.97530p60i,		/* #51 */
+    0x1.0p-20 + 0x1.97530p70i,		/* #52 */
+    0x1.0p-10 + 0x1.97530p80i,		/* #53 */
+    0x1.0p-0 + 0x1.97530p90i,		/* #54 */
+    0x1.97530p10 + 0x1.0000p10i,	/* #55 */
+    0x1.97530p50 + 0x1.0000p50i,	/* #56 */
+    0x1.97530p10 + 0x1.0000p50i,	/* #57 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #58 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #59 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #60 */
+    0x1.0p66 + 0x1.0p-73i,		/* #61 */
+    0x1.0p66 + 0x1.0p-73i,		/* #62 */
+    0x1.0p-50 + 0x1.0p-100i,		/* #63 */
+    0x1.0p0 + 0x1.0p-50i,		/* #64 */
+    0x1.0p-11 + 0x1.0p-50i,		/* #65 */
+    0x1.0p-14 + 0x1.0p-50i,		/* #66 */
+    0x1.0p-15 + 0x1.0p-50i,		/* #67 */
+    0x1.0p-16 + 0x1.0p-50i,		/* #68 */
+    0x1.0p-21 + 0x1.0p-50i,		/* #69 */
+    0x1.0p-31 + 0x1.0p-50i,		/* #70 */
+    0x1.0p-41 + 0x1.0p-50i,		/* #71 */
+    0x1.0p-51 + 0x1.0p-60i,		/* #72 */
+    0x1.0p-61 + 0x1.0p-70i,		/* #73 */
+    0x5.0p1 + 0x12.0p1i,		/* #74 */
+    0x5.0p1 + 0x12.0p1i,		/* #75 */
+    0x5.0p1 + 0x12.0p1i,		/* #76 */
+    0x5.0p1 + 0x12.0p1i,		/* #77 */
+    0x5.0p1 + 0x12.0p1i,		/* #78 */
+    0x5.0p1 + 0x12.0p1i,		/* #79 */
+    0x5.0p1 + 0x12.0p1i,		/* #80 */
+    0x3.1p0 + 0x1.1p0i,			/* #81 */
+    -0x3.0p0 + 0x1.1p0i,		/* #82 */
+    -0x3.0p0 + 0x1.1p0i,		/* #83 */
+    0x3.0p0 + 0x1.1p0i,			/* #84 */
+    0x3.0p0 + 0x1.1p0i,			/* #85 */
+    0x1.456789p2 - 0x1.789123p1i,	/* #86 */
+    0x1.124569p2 - 0x1.781239p3i,	/* #87 */
+    0x1.123457p3 - 0x1.789126p4i,	/* #88 */
+    0x1.123456p1 + 0x1.891237p4i,	/* #89 */
+    0x1.123456p2 + 0x1.357123p3i,	/* #90 */
+    0x1.123456p3 - 0x1.789123p1i,	/* #91 */
+    0x1.123456p1 - 0x1.789123p4i,	/* #92 */
+    0x1.123456p2 + 0x1.789123p1i,	/* #93 */
+    0x1.123456p3 + 0x1.789123p0i,	/* #94 */
+    -0x1.123456p1 - 0x1.789153p-2i,	/* #95 */
+    -0x1.123456p2 - 0x1.785123p7i,	/* #96 */
+    -0x1.123456p3 + 0x1.789123p9i,	/* #97 */
+    0x1.123456p1 - 0x1.789123p20i,	/* #98 */
+    0x1.123456p2 - 0x1.337788p21i,	/* #99 */
+    0x1.123457p3 - 0x1.789991p3i	/* #100 */
+  };
+
+__complex FTYPE z[NUMCNT] =
+  {
+    0x1.0p-127 - 0x1.0p-127i,		/* #1 */
+    0x1.0p126 + 0x0.0p0i,		/* #2 */
+    0x1.0p50 - 0x1.0p-104i,		/* #3 */
+    0x1.0p127 + 0x0.0p0i,		/* #4 */
+    0x1.0p59 - 0x1.0p-84i,		/* #5 */
+    0x1.0p-106 + 0x1.0p26i,		/* #6 */
+    0x1.0p86 + 0x0.0p0i,		/* #7 */
+    0x1.0p-1 + 0x0.0p0i,		/* #8 */
+    0x1.0p-8  - 0x1.0p-8i,		/* #9 */
+    0x1.0p12 - 0x1.0p-33i,		/* #10 */
+    0x1.0p0 + 0x0.0p0i,			/* #11 */
+    0x1.0p0 + 0x0.0p0i,			/* #12 */
+    0x1.0p0 + 0x0.0p0i,			/* #13 */
+    0x1.0p0 + 0x0.0p0i,			/* #14 */
+    0x1.0p0 + 0x0.0p0i,			/* #15 */
+    -0x1.fffe00p-2 - 0x1.ff9e00p-10i,	/* #16 */
+    0x1.000000p0 + 0x0.000000p0i,	/* #17 */
+    0x1.000002p0 + 0x1.99999ap-26i,	/* #18 */
+    0x1.000002p0 + 0x1.99999ap-25i,	/* #19 */
+    0x1.000004p0 + 0x1.99999ap-24i,	/* #20 */
+    0x1.00000ap0 + 0x1.99999ap-23i,	/* #21 */
+    0x1.000014p0 + 0x1.99999ap-22i,	/* #22 */
+    0x1.000026p0 + 0x1.99999ap-21i,	/* #23 */
+    0x1.00004cp0 + 0x1.99999ap-20i,	/* #24 */
+    0x1.fffff6p-1 - 0x1.99999ap-24i,	/* #25 */
+    0x1.ffffecp-1 - 0x1.99999ap-23i,	/* #26 */
+    0x1.ffff66p-1 - 0x1.99999ap-20i,	/* #27 */
+    0x1.fffeccp-1 - 0x1.99999ap-19i,	/* #28 */
+    0x1.666666p0 - 0x1.99999ap-3i,	/* #29 */
+    0x0.0p0 + 0x1.0p0i,			/* #30 */
+    -0x1.47ae14p-25 - 0x1.000000p0i,	/* #31 */
+    0x1.000000p0 - 0x1.000000p-42i,	/* #32 */
+    0x1.000000p0 - 0x1.000000p-103i,	/* #33 */
+    0x1.000000p0 + 0x1.ffffe0p-81i,	/* #34 */
+    0x1.000000p0 - 0x1.000000p-60i,	/* #35 */
+    -0x1.000000p0 + 0x1.000000p-60i,	/* #36 */
+    0x1.000000p0 + 0x1.000000p-60i,	/* #37 */
+    -0x1.0000000p0 - 0x1.000000p-60i,	/* #38 */
+    0x1.000000p0 - 0x1.000000p-60i,	/* #39 */
+    0x1.000000p0 - 0x1.000008p-99i,	/* #40 */
+    0x1.000000p0 - 0x1.41c9b4p-111i,	/* #41 */
+    0x1.000000p20 - 0x1.41c9b4p-121i,	/* #42 */
+    0x1.41c99ep-98 - 0x1.000000p20i,	/* #43 */
+    0x1.41c9b4p-78 - 0x1.000000p30i,	/* #44 */
+    -0x1.41c9b6p-61 - 0x1.000000p0i,	/* #45 */
+    0x1.41c99ep-51 - 0x1.000000p40i,	/* #46 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #47 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #48 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #49 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #50 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #51 */
+    0x1.41c9b4p-51 - 0x1.000000p40i,	/* #52 */
+    0x1.41c9b4p-56 - 0x1.000000p35i,	/* #53 */
+    0x1.41c9b4p-61 - 0x1.000000p30i,	/* #54 */
+    0x1.6f0648p114 - 0x1.cd580cp113i,	/* #55 */
+    0x1.6f0648p75 - 0x1.cd580cp74i,	/* #56 */
+    0x1.000000p40 - 0x1.975300p50i,	/* #57 */
+    0x1.38e3d6p92 + 0x1.beed4cp92i,	/* #58 */
+    0x1.21f3a0p97 + 0x1.cd57eep97i,	/* #59 */
+    0x1.000000p71 + 0x0.000000p0i,	/* #60 */
+    0x1.000000p54 - 0x1.000000p-85i,	/* #61 */
+    0x1.000000p24 - 0x1.000000p-115i,	/* #62 */
+    0x1.000000p104 + 0x1.000000p103i,	/* #63 */
+    0x1.000000p14 - 0x1.fffc00p-37i,	/* #64 */
+    0x1.000000p101 - 0x1.000000p62i,	/* #65 */
+    0x1.000000p99 - 0x1.000000p63i,	/* #66 */
+    0x1.000000p99 - 0x1.000000p64i,	/* #67 */
+    0x1.000000p96 - 0x1.000000p62i,	/* #68 */
+    0x1.000000p102 - 0x1.000000p73i,	/* #69 */
+    0x1.000000p102 - 0x1.000000p83i,	/* #70 */
+    0x1.ffff80p101 - 0x1.ffff80p92i,	/* #71 */
+    0x1.ffff80p101 - 0x1.ffff80p92i,	/* #72 */
+    0x1.ffff80p101 - 0x1.ffff80p92i,	/* #73 */
+    0x1.16f210p1 - 0x1.f5b3b6p2i,	/* #74 */
+    0x1.408cd6p1 - 0x1.6a5c6cp0i,	/* #75 */
+    0x1.4b8d92p1 - 0x1.ee653ap2i,	/* #76 */
+    0x1.0bc840p1 - 0x1.dacedap2i,	/* #77 */
+    0x1.e2a8b6p-1 + 0x1.a68292p-3i,	/* #78 */
+    0x1.c3d9dcp-2 + 0x1.779082p-7i,	/* #79 */
+    0x1.16bd40p-3 - 0x1.f5bb0cp-2i,	/* #80 */
+    0x1.2b9c44p10 - 0x1.9fc934p8i,	/* #81 */
+    0x1.3079a2p10 + 0x1.af5700p8i,	/* #82 */
+    -0x1.3079a2p10 - 0x1.af56f6p8i,	/* #83 */
+    -0x1.3079a2p10 + 0x1.af56f6p8i,	/* #84 */
+    0x1.3079a2p10 - 0x1.af5700p8i,	/* #85 */
+    0x1.a2741cp1 - 0x1.5e60a4p1i,	/* #86 */
+    0x1.004a64p1 - 0x1.077824p-10i,	/* #87 */
+    -0x1.8825f4p-1 + 0x1.492fbap-1i,	/* #88 */
+    0x1.f64170p-1 - 0x1.0d936ap-2i,	/* #89 */ 
+    0x1.2e6b76p1 + 0x1.4911e4p-3i,	/* #90 */
+    0x1.a1cec6p-5 + 0x1.61ced4p1i,	/* #91 */
+    0x1.064f7cp0 + 0x1.1551c2p-2i,	/* #92 */
+    -0x1.344548p0 - 0x1.2aa5dap2i,	/* #93 */
+    -0x1.06d986p-1 + 0x1.6ad8d8p1i,	/* #94 */
+    -0x1.6deb5ap2 - 0x1.4028b8p3i,	/* #95 */
+    0x1.fbd456p-4 + 0x1.8c3276p-5i,	/* #96 */
+    -0x1.0106f6p-5 - 0x1.69200cp-7i,	/* #97 */ 
+    -0x1.000008p-16 - 0x1.74d230p-18i,	/* #98 */
+    -0x1.39887ep-17 + 0x1.c89ce0p-19i,	/* #99 */
+    0x1.a746a4p0 - 0x1.e72da8p-2i	/* #100 */
+  };
+
+
+__complex FTYPE errmax[NUMCNT] =
+  {
+    0x0.000000p0    + 0x0.000000p0i,	/* #1 */
+    0x0.000002p126  + 0x0.000002p-126i,	/* #2 */
+    0x0.000002p50   + 0x0.000002p-104i,	/* #3 */
+    0x0.000002p127  + 0x0.000002p0i,	/* #4 */
+    0x0.000002p59   + 0x0.000002p-84i,	/* #5 */
+    0x0.000000p-106 + 0x0.000002p26i,	/* #6 */
+    0x0.000002p86   + 0x0.000002p0i,	/* #7 */
+    0x0.000002p-1   + 0x0.000002p0i,	/* #8 */
+    0x0.000002p-8   + 0x0.000002p-8i,	/* #9 */
+    0x0.000002p12   + 0x0.000002p-33i,	/* #10 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #11 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #12 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #13 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #14 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #15 */
+    0x0.000002p-2   + 0x0.000002p-10i,	/* #16 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #17 */
+    0x0.000002p0    + 0x0.000002p-26i,	/* #18 */
+    0x0.000002p0    + 0x0.000002p-25i,	/* #19 */
+    0x0.000002p0    + 0x0.000002p-24i,	/* #20 */
+    0x0.000002p0    + 0x0.000002p-23i,	/* #21 */
+    0x0.000002p0    + 0x0.000002p-22i,	/* #22 */
+    0x0.000002p0    + 0x0.000002p-21i,	/* #23 */
+    0x0.000002p0    + 0x0.000002p-20i,	/* #24 */
+    0x0.000002p-1   + 0x0.000002p-24i,	/* #25 */
+    0x0.000002p-1   + 0x0.000002p-23i,	/* #26 */
+    0x0.000002p-1   + 0x0.000002p-20i,	/* #27 */
+    0x0.000002p-1   + 0x0.000002p-19i,	/* #28 */
+    0x0.000002p0    + 0x0.000002p-3i,	/* #29 */
+    0x0.000002p0    + 0x0.000002p0i,	/* #30 */
+    0x0.000002p-25  + 0x0.000002p0i,	/* #31 */
+    0x0.000002p0    + 0x0.000002p-42i,	/* #32 */
+    0x0.000002p0    + 0x0.000002p-103i,	/* #33 */
+    0x0.000002p0    + 0x0.000002p-81i,	/* #34 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #35 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #36 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #37 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #38 */
+    0x0.000002p0    + 0x0.000002p-60i,	/* #39 */
+    0x0.000002p0    + 0x0.000002p-99i,	/* #40 */
+    0x0.000002p0    + 0x0.000002p-111i,	/* #41 */
+    0x0.000002p20   + 0x0.000002p-121i,	/* #42 */
+    0x0.0042000p-98 + 0x0.000002p20i,	/* #43 */
+    0x0.0042000p-78 + 0x0.000002p30i,	/* #44 */
+    0x0.004201p-61 + 0x0.000002p0i,	/* #45 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #46 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #47 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #48 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #49 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #50 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #51 */
+    0x0.004201p-51 + 0x0.000002p40i,	/* #52 */
+    0x0.004201p-56 + 0x0.000002p35i,	/* #53 */
+    0x0.004201p-61 + 0x0.000002p30i,	/* #54 */
+    0x0.000002p114 + 0x0.000002p113i,	/* #55 */
+    0x0.000002p75  + 0x0.000002p74i,	/* #56 */
+    0x0.000002p40  + 0x0.000002p50i,	/* #57 */
+    0x0.000002p92  + 0x0.000002p92i,	/* #58 */
+    0x0.000002p97  + 0x0.000002p97i,	/* #59 */
+    0x0.000002p71  + 0x0.000002p0i,	/* #60 */
+    0x0.000002p54  + 0x0.000000p-85i,	/* #61 */
+    0x0.000002p24  + 0x0.000002p-115i,	/* #62 */
+    0x0.000002p104 + 0x0.000002p103i,	/* #63 */
+    0x0.000002p14 + 0x0.000002p-37i,	/* #64 */
+    0x0.000002p101 + 0x0.000002p62i,	/* #65 */
+    0x0.000002p99 + 0x0.000002p63i,	/* #66 */
+    0x0.000002p99 + 0x0.000002p64i,	/* #67 */
+    0x0.000002p96 + 0x0.000002p62i,	/* #68 */
+    0x0.000002p102 + 0x0.000002p73i,	/* #69 */
+    0x0.000002p102 + 0x0.000002p83i,	/* #70 */
+    0x0.000002p101 + 0x0.000002p92i,	/* #71 */
+    0x0.000002p101 + 0x0.000002p92i,	/* #72 */
+    0x0.000002p101 + 0x0.000002p92i,	/* #73 */
+    0x0.000002p1    + 0x0.000002p2i,	/* #74 */
+    0x0.000002p1    + 0x0.000002p0i,	/* #75 */
+    0x0.000002p1    + 0x0.000002p2i,	/* #76 */
+    0x0.000002p1    + 0x0.000002p2i,	/* #77 */
+    0x0.000002p-1   + 0x0.000002p-3i,	/* #78 */
+    0x0.000002p-2   + 0x0.00000ap-7i,	/* #79 */
+    0x0.000002p-3   + 0x0.000002p-2i,	/* #80 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #81 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #82 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #83 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #84 */
+    0x0.000002p10   + 0x0.000002p8i,	/* #85 */
+    0x0.000002p1    + 0x0.000002p1i,	/* #86 */
+    0x0.000002p1    + 0x0.0000c0p-9i,	/* #87 */
+    0x0.000002p-1   + 0x0.000002p-1i,	/* #88 */
+    0x0.000002p-1   + 0x0.000002p-2i,	/* #89 */
+    0x0.000002p1    + 0x0.000004p-3i,	/* #90 */
+    0x0.000152p-5   + 0x0.000002p1i,	/* #91 */
+    0x0.000002p0    + 0x0.000002p-2i,	/* #92 */
+    0x0.000002p0    + 0x0.000002p2i,	/* #93 */
+    0x0.000002p-1   + 0x0.000002p1i,	/* #94 */
+    0x0.000002p2    + 0x0.000002p3i,	/* #95 */
+    0x0.000002p-4   + 0x0.000002p-5i,	/* #96 */
+    0x0.000002p-5   + 0x0.000002p-7i,	/* #97 */
+    0x0.000002p-16  + 0x0.000002p-18i,	/* #98 */
+    0x0.000002p-17  + 0x0.000002p-19i,	/* #99 */
+    0x0.000002p0    + 0x0.000004p-2i	/* #100 */
+  };
+
+
+int main(int argc, char** argv)
+{
+  int i;
+  FTYPE xr, xi, yr, yi, zr, zi, zzr, zzi;
+  FTYPE er, ei;
+  __complex FTYPE ans[NUMCNT];
+  int errcnt;
+
+  errcnt = 0;
+  for (i = 0; i < NUMCNT; i++)
+    {
+      ans[i] = x[i] / y[i];
+      if( z[i] != z[i] )   /* Check for nan/inf case */
+	{
+	  zr = __real__ z[i];
+	  zi = __imag__ z[i];
+	  zzr = __real__ ans[i];
+	  zzi = __imag__ ans[i];
+	  er = __real__ errmax[i];
+	  ei = __imag__ errmax[i];
+	  errcnt++;
+	  printf("x %3d    " FMT " " FMT "i\n",
+		 i + 1, __real__ x[i], __imag__ x[i]);
+	  printf ("y %3d   " FMT " " FMT "i\n",
+		  i + 1, __real__ y[i], __imag__ y[i]);
+	  printf("expected " FMT " " FMT "i\n",
+		 __real__ z[i], __imag__ z[i]);
+	  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+		 __real__ ans[i], __imag__ ans[i], i + 1);
+	  printf("diff     " FMT " " FMT "i\n",
+		 zr - zzr, zi - zzi);
+	  printf("errmax   " FMT " " FMT "i\n\n",
+		 er, ei);
+	}
+      else
+	{
+	  if( z[i] != ans[i] )
+	    {
+	      zr = __real__ z[i];
+	      zi = __imag__ z[i];
+	      zzr = __real__ ans[i];
+	      zzi = __imag__ ans[i];
+	      er = __real__ errmax[i];
+	      ei = __imag__ errmax[i];
+	      if( (FABS(zr-zzr) > er) || (FABS(zi-zzi) > ei))
+		{	 /* report if error exceeds error max */
+		  errcnt++;
+		  printf("x %3d    " FMT " " FMT "i\n",
+			 i + 1, __real__ x[i], __imag__ x[i]);
+		  printf ("y %3d    " FMT " " FMT "i\n",
+			  i + 1, __real__ y[i], __imag__ y[i]);
+		  printf("expected " FMT " " FMT "i\n",
+			 __real__ z[i], __imag__ z[i]);
+		  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+			 __real__ ans[i], __imag__ ans[i], i + 1);
+		  printf("diff     " FMT " " FMT "i\n",
+			 zr - zzr, zi - zzi);
+		  printf("errmax   " FMT " " FMT "i\n\n",
+			 er, ei);
+		}
+	    }
+	}
+    }
+  if( errcnt > 0)
+    {
+      printf("%2d Failures\n",errcnt);
+      abort();
+    }
+  printf("PASS\n");
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59714_64.c b/gcc/testsuite/gcc.c-torture/execute/pr59714_64.c
new file mode 100644
index 0000000..0a41174
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59714_64.c
@@ -0,0 +1,506 @@
+#include <stdio.h>
+#include <math.h>
+
+extern void abort (void);
+#define FABS(x) ((x) >= 0 ? (x) : -(x))
+#define FTYPE   double
+#define FMT     "%-24.13a"
+
+/*
+   Tables of numbers for complex division testing
+   All values in hex format
+   z[i] == correctly rounded value of x[i]/y[i];
+ */
+
+#define NUMCNT 100
+
+__complex FTYPE x[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p0i,			/* #1 */
+    0x1.0p0 + 0x1.0p0i,			/* #2 */
+    0x1.0p1023 + 0x1.0p-1023i,		/* #3 */
+    0x1.0p1023 + 0x1.0p1023i,		/* #4 */
+    0x1.0p1020 + 0x1.0p-844i,		/* #5 */
+    0x1.0p-71 + 0x1.0p1021i,		/* #6 */
+    0x1.0p-347 + 0x1.0p-54i,		/* #7 */
+    0x1.0p-1074 + 0x1.0p-1074i,		/* #8 */
+    0x1.0p1015 + 0x1.0p-989i,		/* #9 */
+    0x1.0p-622 + 0x1.0p-1071i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    0x1.0p0 - 0x3.000000001p-20i,	/* #16 */
+    0x1.0p0 + 0x3.00000000001p-20i,	/* #17 */
+    0x1.0p0 + 0x1.8000000000002p1i,	/* #18 */
+    0x1.0p0 + 0x1.8000000000004p1i,	/* #19 */
+    0x1.0p0 + 0x1.8000000000008p1i,	/* #20 */
+    0x1.0p0 + 0x1.8000000000010p1i,	/* #21 */
+    0x1.0p0 + 0x1.8000000000020p1i,	/* #22 */
+    0x1.0p0 + 0x1.8000000000040p1i,	/* #23 */
+    0x1.0p0 + 0x1.8000000000080p1i,	/* #24 */
+    0x1.0p0 + 0x1.7ffffffffff8p1i,	/* #25 */
+    0x1.0p0 + 0x1.7ffffffffff0p1i,	/* #26 */
+    0x1.0p0 + 0x1.7fffffffff80p1i,	/* #27 */
+    0x1.0p0 + 0x1.7fffffffff00p1i,	/* #28 */
+    0x5.0p0 + 0x5.0p0i,			/* #29 */
+    0x4.0p0 + 0x3.0p0i,			/* #30 */
+    -0x4.0p0 + 0x3.000000001p0i,	/* #31 */
+    0x3.00000000001p-20 + 0x1.0p0i,	/* #32 */
+    0x1.00000000001p-80 + 0x1.0p0i,	/* #33 */
+    0x1.00000000001p-600 + 0x1.0p0i,	/* #34 */
+    0x1.0p0 + 0x1.00000000001p-600i,	/* #35 */
+    -0x1.0p0 + 0x1.00000000001p-600i,	/* #36 */
+    -0x1.0p0 + 0x1.00000000001p-600i,	/* #37 */
+    -0x1.0p0 + 0x1.00000000001p-600i,	/* #38 */
+    0x1.0p0 - 0x1.00000000001p-600i,	/* #39 */
+    0x1.0p100 - 0x1.00000000001p-600i,	/* #40 */
+    0x1.97530p100 - 0x1.00000000001p-600i,	/* #41 */
+    0x1.97530p300 - 0x1.00000000001p-600i,	/* #42 */
+    0x1.97530p377 - 0x1.00000000001p-600i,	/* #43 */
+    0x1.97530p477 - 0x1.00000000001p-500i,	/* #44 */
+    0x1.97530p0 - 0x1.00000000001p-900i,	/* #45 */
+    0x1.97530p100 - 0x1.00000000001p-800i,	/* #46 */
+    0x1.97530p200 - 0x1.00000000001p-700i,	/* #47 */
+    0x1.97530p300 - 0x1.00000000001p-600i,	/* #48 */
+    0x1.97530p400 - 0x1.00000000001p-500i,	/* #49 */
+    0x1.97530p500 - 0x1.00000000001p-400i,	/* #50 */
+    0x1.97530p600 - 0x1.00000000001p-300i,	/* #51 */
+    0x1.97530p700 - 0x1.00000000001p-200i,	/* #52 */
+    0x1.97530p800 - 0x1.00000000001p-100i,	/* #53 */
+    0x1.97530p900 - 0x1.00000000001p-0i,	/* #54 */
+    0x1.97530p1000 + 0x1.00000000001p200i,	/* #55 */
+    0x1.97530p1010 + 0x1.00000000000p300i,	/* #56 */
+    0x1.97530p800 + 0x1.00000000000p400i,	/* #57 */
+    0x1.97530p700 + 0x1.00000000000p500i,	/* #58 */
+    0x1.97530p600 + 0x1.00000000000p600i,	/* #59 */
+    0x1.97530p520 + 0x1.00000000000p520i,	/* #60 */
+    0x1.0p1020 + 0x1.0p-844i,		/* #61 */
+    0x1.0p920 + 0x1.0p-844i,		/* #62 */
+    0x1.0p504 + 0x1.0p523i,		/* #63 */
+    0x1.0p1004 + 0x1.0p-512i,		/* #64 */
+    0x1.0p910 + 0x1.0p-512i,		/* #65 */
+    0x1.0p865 + 0x1.0p-512i,		/* #66 */
+    0x1.0p864 + 0x1.0p-512i,		/* #67 */
+    0x1.0p860 + 0x1.0p-512i,		/* #68 */
+    0x1.0p810 + 0x1.0p-512i,		/* #69 */
+    0x1.0p710 + 0x1.0p-512i,		/* #70 */
+    0x1.0p610 + 0x1.0p-512i,		/* #71 */
+    0x1.0p510 + 0x1.0p-512i,		/* #72 */
+    0x1.0p410 + 0x1.0p-512i,		/* #73 */
+    0x13.0p4 + 0x1.0p-4i,		/* #74 */
+    0x13.0p2 + 0x13.0p2i,		/* #75 */
+    0x13.0p4 + 0x1.0p4i,		/* #76 */
+    0x12.0p4 + 0x12.0p-4i,		/* #77 */
+    0x1.0p1 + 0x12.0p1i,		/* #78 */
+    0x1.0p2 + 0x1.0p4i,			/* #79 */
+    0x13.0p0 + 0x0.0p0i,		/* #80 */
+    0x1.01p12 - 0x1.037p-12i,		/* #81 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #82 */
+    0x1.01p12 - 0x1.037p-12i,		/* #83 */
+    -0x1.01p12 - 0x1.037p-12i,		/* #84 */
+    0x1.01p12 - 0x1.037p-12i,		/* #85 */
+    0x1.123456p3 - 0x1.789123p4i,	/* #86 */
+    0x1.123457p3 - 0x1.789123p4i,	/* #87 */
+    0x1.123458p3 + 0x1.789123p4i,	/* #88 */
+    0x1.123456p3 + 0x1.789122p4i,	/* #89 */
+    0x1.123456p3 + 0x1.789121p4i,	/* #90 */
+    0x1.123456p3 + 0x1.789120p4i,	/* #91 */
+    0x1.123455p3 - 0x1.789123p4i,	/* #92 */
+    0x1.123454p3 - 0x1.789122p4i,	/* #93 */
+    -0x1.123453p3 + 0x1.789121p4i,	/* #94 */
+    0x1.123452p3 + 0x1.789120p4i,	/* #95 */
+    0x1.123451p3 - 0x1.789127p4i,	/* #96 */
+    0x1.123459p3 - 0x1.789125p4i,	/* #97 */
+    -0x1.123450p3 + 0x1.789124p4i,	/* #98 */
+    0x1.1234561p3 + 0x1.7891231p4i,	/* #99 */
+    0x1.1234561p3 - 0x1.7891231p4i	/* #100 */
+  };
+
+__complex FTYPE y[NUMCNT] =
+  {
+    0x1.0p0 + 0x1.0p1023i,		/* #1 */
+    0x1.0p-1023 + 0x1.0p-1023i,		/* #2 */
+    0x1.0p677 + 0x1.0p-677i,		/* #3 */
+    0x1.0p0 + 0x1.0p0i,			/* #4 */
+    0x1.0p656 + 0x1.0p-780i,		/* #5 */
+    0x1.0p1001 + 0x1.0p-323i,		/* #6 */
+    0x1.0p-1037 + 0x1.0p-1058i,		/* #7 */
+    0x1.0p-1073 + 0x1.0p-1074i,		/* #8 */
+    0x1.0p1023 + 0x1.0p1023i,		/* #9 */
+    0x1.0p-343 + 0x1.0p-798i,		/* #10 */
+    0x1.0p0 + 0x3.0p0i,			/* #11 */
+    -0x1.0p0 + 0x3.0p0i,		/* #12 */
+    0x1.0p0 - 0x3.0p0i,			/* #13 */
+    0x3.0p0 + 0x1.0p0i,			/* #14 */
+    0x3.0p0 + 0x4.0p0i,			/* #15 */
+    -0x2.0p0 + 0x8.0p-10i,		/* #16 */
+    0x1.0p0 + 0x3.0p-20i,		/* #17 */
+    0x1.0p0 + 0x3.0p0i,			/* #18 */
+    0x1.0p0 + 0x3.0p0i,			/* #19 */
+    0x1.0p0 + 0x3.0p0i,			/* #20 */
+    0x1.0p0 + 0x3.0p0i,			/* #21 */
+    0x1.0p0 + 0x3.0p0i,			/* #22 */
+    0x1.0p0 + 0x3.0p0i,			/* #23 */
+    0x1.0p0 + 0x3.0p0i,			/* #24 */
+    0x1.0p0 + 0x3.0p0i,			/* #25 */
+    0x1.0p0 + 0x3.0p0i,			/* #26 */
+    0x1.0p0 + 0x3.0p0i,			/* #27 */
+    0x1.0p0 + 0x3.0p0i,			/* #28 */
+    0x3.0p0 + 0x4.0p0i,			/* #29 */
+    0x3.0p0 - 0x4.0p0i,			/* #30 */
+    -0x3.0p0 - 0x4.0p0i,		/* #31 */
+    0x3.0p-20 + 0x1.0p0i,		/* #32 */
+    0x1.0p-80 + 0x1.0p0i,		/* #33 */
+    0x1.0p-80 + 0x1.0p0i,		/* #34 */
+    0x1.0p0 + 0x1.0p-600i,		/* #35 */
+    0x1.0p0 + 0x1.0p-600i,		/* #36 */
+    -0x1.0p0 + 0x1.0p-600i,		/* #37 */
+    0x1.0p0 - 0x1.0p-600i,		/* #38 */
+    0x1.0p0 + 0x1.0p-600i,		/* #39 */
+    0x1.0p100 + 0x1.0p-600i,		/* #40 */
+    0x1.97530p100 + 0x1.0p-600i,	/* #41 */
+    0x1.97530p300 + 0x1.0p-600i,	/* #42 */
+    0x1.0p-600 + 0x1.97530p377i,	/* #43 */
+    0x1.0p-500 + 0x1.97530p477i,	/* #44 */
+    0x1.0p-900 + 0x1.97530p0i,		/* #45 */
+    0x1.0p-800 + 0x1.97530p100i,	/* #46 */
+    0x1.0p-700 + 0x1.97530p200i,	/* #47 */
+    0x1.0p-600 + 0x1.97530p300i,	/* #48 */
+    0x1.0p-500 + 0x1.97530p400i,	/* #49 */
+    0x1.0p-400 + 0x1.97530p500i,	/* #50 */
+    0x1.0p-300 + 0x1.97530p600i,	/* #51 */
+    0x1.0p-200 + 0x1.97530p700i,	/* #52 */
+    0x1.0p-100 + 0x1.97530p800i,	/* #53 */
+    0x1.0p-0 + 0x1.97530p900i,		/* #54 */
+    0x1.97530p100 + 0x1.0000p100i,	/* #55 */
+    0x1.97530p50 + 0x1.0000p50i,	/* #56 */
+    0x1.97530p100 + 0x1.0000p50i,	/* #57 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #58 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #59 */
+    0x1.97530p1 + 0x1.0000p1i,		/* #60 */
+    0x1.0p656 + 0x1.0p-730i,		/* #61 */
+    0x1.0p656 + 0x1.0p-730i,		/* #62 */
+    0x1.0p-500 + 0x1.0p-1000i,		/* #63 */
+    0x1.0p0 + 0x1.0p-500i,		/* #64 */
+    0x1.0p-110 + 0x1.0p-500i,		/* #65 */
+    0x1.0p-155 + 0x1.0p-500i,		/* #66 */
+    0x1.0p-156 + 0x1.0p-500i,		/* #67 */
+    0x1.0p-160 + 0x1.0p-500i,		/* #68 */
+    0x1.0p-210 + 0x1.0p-500i,		/* #69 */
+    0x1.0p-310 + 0x1.0p-500i,		/* #70 */
+    0x1.0p-410 + 0x1.0p-500i,		/* #71 */
+    0x1.0p-510 + 0x1.0p-600i,		/* #72 */
+    0x1.0p-610 + 0x1.0p-700i,		/* #73 */
+    0x5.0p1 + 0x12.0p1i,		/* #74 */
+    0x5.0p1 + 0x12.0p1i,		/* #75 */
+    0x5.0p1 + 0x12.0p1i,		/* #76 */
+    0x5.0p1 + 0x12.0p1i,		/* #77 */
+    0x5.0p1 + 0x12.0p1i,		/* #78 */
+    0x5.0p1 + 0x12.0p1i,		/* #79 */
+    0x5.0p1 + 0x12.0p1i,		/* #80 */
+    0x3.1p0 + 0x1.1p0i,			/* #81 */
+    -0x3.0p0 + 0x1.1p0i,		/* #82 */
+    -0x3.0p0 + 0x1.1p0i,		/* #83 */
+    0x3.0p0 + 0x1.1p0i,			/* #84 */
+    0x3.0p0 + 0x1.1p0i,			/* #85 */
+    0x1.456789p2 - 0x1.789123p1i,	/* #86 */
+    0x1.124569p2 - 0x1.781239p3i,	/* #87 */
+    0x1.123457p3 - 0x1.789126p4i,	/* #88 */
+    0x1.123456p1 + 0x1.891237p4i,	/* #89 */
+    0x1.123456p2 + 0x1.357123p3i,	/* #90 */
+    0x1.123456p3 - 0x1.789123p1i,	/* #91 */
+    0x1.123456p1 - 0x1.789123p4i,	/* #92 */
+    0x1.123456p2 + 0x1.789123p1i,	/* #93 */
+    0x1.123456p3 + 0x1.789123p0i,	/* #94 */
+    -0x1.123456p1 - 0x1.789153p-2i,	/* #95 */
+    -0x1.123456p2 - 0x1.785123p7i,	/* #96 */
+    -0x1.123456p3 + 0x1.789123p9i,	/* #97 */
+    0x1.123456p1 - 0x1.789123p20i,	/* #98 */
+    0x1.123456p2 - 0x1.337788p21i,	/* #99 */
+    0x1.123457p3 - 0x1.789991p3i	/* #100 */
+  };
+
+__complex FTYPE z[NUMCNT] =
+  {
+    0x1.0p-1023 - 0x1.0p-1023i,		/* #1 */
+    0x1.0p1023 + 0x0.0p0i,		/* #2 */
+    0x1.0p346 - 0x1.0p-1008i,		/* #3 */
+    0x1.0p1023 + 0x0.0p0i,		/* #4 */
+    0x1.0p364 - 0x1.0p-1072i,		/* #5 */
+    0x1.0p-1072 + 0x1.0p20i,		/* #6 */
+    3.898125604559113300e289 + 8.174961907852353577e295i,	/* #7 */
+    0.6 + 0.2i,				/* #8 */
+    0.001953125 - 0.001953125i,		/* #9 */
+    1.02951151789360578e-84 + 6.97145987515076231e-220i,	/* #10 */
+    0x1.0p0 + 0x0.0p0i,			/* #11 */
+    0x1.0p0 + 0x0.0p0i,			/* #12 */
+    0x1.0p0 + 0x0.0p0i,			/* #13 */
+    0x1.0p0 + 0x0.0p0i,			/* #14 */
+    0x1.0p0 + 0x0.0p0i,			/* #15 */
+    -0x1.fffe0061ff9e0p-2 - 0x1.ff9e0061ff9c0p-10i,	/* #16 */
+    0x1.00000000000000p0 + 0x1.ffffffffee000p-65i,	/* #17 */
+    0x1.0000000000002p0 + 0x1.999999999999ap-54i,	/* #18 */
+    0x1.0000000000003p0 + 0x1.999999999999ap-53i,	/* #19 */
+    0x1.0000000000005p0 + 0x1.999999999999ap-52i,	/* #20 */
+    0x1.000000000000ap0 + 0x1.999999999999ap-51i,	/* #21 */
+    0x1.0000000000013p0 + 0x1.999999999999ap-50i,	/* #22 */
+    0x1.0000000000027p0 + 0x1.999999999999ap-49i,	/* #23 */
+    0x1.000000000004dp0 + 0x1.999999999999ap-48i,	/* #24 */
+    0x1.fffffffffff66p-1 - 0x1.999999999999ap-48i,	/* #25 */
+    0x1.ffffffffffecdp-1 - 0x1.999999999999ap-47i,	/* #26 */
+    0x1.ffffffffff666p-1 - 0x1.999999999999ap-44i,	/* #27 */
+    0x1.fffffffffeccdp-1 - 0x1.999999999999ap-43i,	/* #28 */
+    0x1.6666666666667p0 - 0x1.999999999999ap-3i,	/* #29 */
+    0x0.0p0 + 0x1.0p0i,					/* #30 */
+    -0x1.47ae147ae147b00000p-39 - 0x1.0000000001eb8p0i,	/* #31 */
+    0x1.00000000000000p0 - 0x1.ffffffffee000p-65i,	/* #32 */
+    0x1.00000000000000p0 - 0x1.0000000000000p-124i,	/* #33 */
+    0x1.00000000000000p0 + 0x1.0000000000000p-80i,	/* #34 */
+    0x1.00000000000000p0 + 0x1.0000000000000p-644i,	/* #35 */
+    -0x1.00000000000000p0 + 0x1.0000000000080p-599i,	/* #36 */
+    0x1.00000000000000p0 - 0x1.0000000000000p-644i,	/* #37 */
+    -0x1.00000000000000p0 + 0x1.0000000000000p-644i,	/* #38 */
+    0x1.00000000000000p0 - 0x1.0000000000080p-599i,	/* #39 */
+    0x1.00000000000000p0 - 0x1.0000000000080p-699i,	/* #40 */
+    0x1.00000000000000p0 - 0x1.41c9b303bfbf2p-700i,	/* #41 */
+    0x1.00000000000000p0 - 0x1.41c9b303bfbf2p-900i,	/* #42 */
+    -0x1.41c9b303bfb510p-1022 - 0x1.0000000000000p0i,	/* #43 */
+    -0x1.41c9b303bfb510p-1022 - 0x1.0000000000000p0i,	/* #44 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #45 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #46 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #47 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #48 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #49 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #50 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #51 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #52 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #53 */
+    -0x1.41c9b303bfb510p-945 - 0x1.0000000000000p0i,	/* #54 */
+    0x1.6f0647208a31a0p899 - 0x1.cd580bc4697cap898i,	/* #55 */
+    0x1.6f0647208a31a0p959 - 0x1.cd580bc4697cap958i,	/* #56 */
+    0x1.00000000000000p700 - 0x1.41c9b303bfb51p649i,	/* #57 */
+    0x1.6f0647208a31a0p698 - 0x1.cd580bc4697cap697i,	/* #58 */
+    0x1.00000000000000p599 + 0x0.0000000000000p0i,	/* #59 */
+    0x1.00000000000000p519 + 0x0.0000000000000p0i,	/* #60 */
+    0x1.0p364 - 0x1.0p-1022i,				/* #61 */
+    0x1.0p264 + 0x0.0p0i,				/* #62 */
+    0x1.0p1004 + 0x1.0p1023i,				/* #63 */
+    0x1.0p1004 - 0x1.0p504i,				/* #64 */
+    0x1.0p1020 - 0x1.0p630i,				/* #65 */
+    0x1.0p1020 - 0x1.0p675i,				/* #66 */
+    0x1.0p1020 - 0x1.0p676i,				/* #67 */
+    0x1.0p1020 - 0x1.0p680i,				/* #68 */
+    0x1.0p1020 - 0x1.0p730i,				/* #69 */
+    0x1.0p1020 - 0x1.0p830i,				/* #70 */
+    0x1.0p1020 - 0x1.0p930i,				/* #71 */
+    0x1.0p1020 - 0x1.0p930i,				/* #72 */
+    0x1.0p1020 - 0x1.0p930i,				/* #73 */
+    0x1.16f21023358c2p1 - 0x1.f5b3b6a5c6c90p2i,		/* #74 */
+    0x1.408cd63069a0ap1 - 0x1.6a5c6c8fc5517p0i,		/* #75 */
+    0x1.4b8d91f8aa2d8p1 - 0x1.ee6539f2cbeb7p2i,		/* #76 */
+    0x1.0bc8408cd6307p1 - 0x1.daceda971b23fp2i,		/* #77 */
+    0x1.e2a8b5e9fe887p-1 + 0x1.a682913ce1ecfp-3i,	/* #78 */
+    0x1.c3d9db52e3648p-2 + 0x1.77908119ac60dp-7i,	/* #79 */
+    0x1.16bd3fd10defep-3 - 0x1.f5bb0c784c496p-2i,	/* #80 */
+    0x1.2b9c43596635bp10 - 0x1.9fc933bd0b3adp8i,	/* #81 */
+    0x1.3079a1638e442p10 + 0x1.af56ff5f5ee08p8i,	/* #82 */
+    -0x1.3079a23d4567cp10 - 0x1.af56f5c477a85p8i,	/* #83 */
+    -0x1.3079a23d4567cp10 + 0x1.af56f5c477a85p8i,	/* #84 */
+    0x1.3079a1638e442p10 - 0x1.af56ff5f5ee08p8i,	/* #85 */
+    0x1.a27419691d785p+1 - 0x1.5e60a434afdfep1i,	/* #86 */
+    0x1.004a6235052b9p1 - 0x1.077970d2017e9p-10i,	/* #87 */
+    -0x1.8825f329396f0p-1 + 0x1.492fb9aef1c35p-1i,	/* #88 */
+    0x1.f6417093502e6p-1 - 0x1.0d936b36d2386p-2i,	/* #89 */ 
+    0x1.2e6b76d3c1a74p1 + 0x1.4911f033da9e4p-3i,	/* #90 */
+    0x1.a1ced84e145e9p-5 + 0x1.61ced4d722d38p1i,	/* #91 */
+    0x1.064f7bc3e4834p0 + 0x1.1551c3ae74bd1p-2i,	/* #92 */
+    -0x1.344545d341aa8p0 - 0x1.2aa5da272dd3dp2i,	/* #93 */
+    -0x1.06d98474fe895p-1 + 0x1.6ad8d7df1b0c8p1i,	/* #94 */
+    -0x1.6deb5a7bec317p2 - 0x1.4028b8d0a2fc1p3i,	/* #95 */
+    0x1.fbd4560086546p-4 + 0x1.8c3278a9ca9b4p-5i,	/* #96 */
+    -0x1.0106f72f51798p-5 - 0x1.69200e9aa701dp-7i,	/* #97 */ 
+    -0x1.00000929d9956p-16 - 0x1.74d2319d42342p-18i,	/* #98 */
+    -0x1.39887db89b686p-17 + 0x1.c89cdfee34a14p-19i,	/* #99 */
+    0x1.a746a452d3430p0 - 0x1.e72d9f35e28e6p-2i		/* #100 */
+  };
+
+
+__complex FTYPE errmax[NUMCNT] =
+  {
+    0x0.0000000000000p0    + 0x0.0000000000000p0i,	/* #1 */
+    0x0.0000000000001p1023 + 0x0.0000000000001p0i,	/* #2 */
+    0x0.0000000000001p346  + 0x0.0000000000001p-1008i,	/* #3 */
+    0x0.0000000000001p1023 + 0x0.0000000000001p0i,	/* #4 */
+    0x0.0000000000001p364  + 0x0.0000000000000p0i,	/* #5 */
+    0x0.0000000000000p0    + 0x0.0000000000001p20i,	/* #6 */
+    0x0.0000000000001p961  + 0x0.0000000000001p982i,	/* #7 */
+    0x0.0000000000001p-1   + 0x0.0000000000010p-3i,	/* #8 */
+    0x0.0000000000001p-9   + 0x0.0000000000001p-9i,	/* #9 */
+    0x0.0000000000001p279  + 0x0.0000000000001p-171i,	/* #10 */
+    0x0.0000000000001p0    + 0x0.0000000000001p0i,	/* #11 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #12 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #13 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #14 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #15 */
+    0x1.0000000000001p-2   + 0x0.000000000001p-10i,	/* #16 */
+    0x0.0000000000001p0    + 0x0.000000000001p-65i,	/* #17 */
+    0x0.0000000000001p0    + 0x0.000000000001p-54i,	/* #18 */
+    0x0.0000000000001p0    + 0x0.000000000001p-53i,	/* #19 */
+    0x0.0000000000001p0    + 0x0.000000000001p-52i,	/* #20 */
+    0x0.0000000000001p0    + 0x0.000000000001p-51i,	/* #21 */
+    0x0.0000000000001p0    + 0x0.000000000001p-50i,	/* #22 */
+    0x0.0000000000001p0    + 0x0.000000000001p-49i,	/* #23 */
+    0x0.0000000000001p0    + 0x0.000000000001p-48i,	/* #24 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-48i,	/* #25 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-47i,	/* #26 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-44i,	/* #27 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-43i,	/* #28 */
+    0x0.0000000000001p0    + 0x0.000000000001p-3i,	/* #29 */
+    0x0.0000000000001p0    + 0x0.000000000001p0i,	/* #30 */
+    0x0.0000000000001p-39  + 0x0.000000000001p0i,	/* #31 */
+    0x0.0000000000001p0    + 0x0.000000000001p-65i,	/* #32 */
+    0x0.0000000000001p0    + 0x0.000000000001p-124i,	/* #33 */
+    0x0.0000000000001p0    + 0x0.000000000001p-80i,	/* #34 */
+    0x0.0000000000001p0    + 0x0.000000000001p-644i,	/* #35 */
+    0x0.0000000000001p0    + 0x0.000000000001p-599i,	/* #36 */
+    0x0.0000000000001p0    + 0x0.000000000001p-644i,	/* #37 */
+    0x0.0000000000001p0    + 0x0.000000000001p-644i,	/* #38 */
+    0x0.0000000000001p0    + 0x0.000000000001p-599i,	/* #39 */
+    0x0.0000000000001p0    + 0x0.000000000001p-699i,	/* #40 */
+    0x0.0000000000001p0    + 0x0.000000000001p-700i,	/* #41 */
+    0x0.0000000000001p0    + 0x0.000000000001p-900i,	/* #42 */
+    0x0.0042000000000p-1022 + 0x0.000000000001p0i,	/* #43 */
+    0x0.0042000000000p-1022 + 0x0.000000000001p0i,	/* #44 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #45 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #46 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #47 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #48 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #49 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #50 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #51 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #52 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #53 */
+    0x0.0042000000001p-945 + 0x0.000000000001p0i,	/* #54 */
+    0x0.0000000000001p899  + 0x0.000000000001p898i,	/* #55 */
+    0x0.0000000000001p959  + 0x0.000000000001p958i,	/* #56 */
+    0x0.0000000000001p700  + 0x0.000000000001p649i,	/* #57 */
+    0x0.0000000000001p698  + 0x0.000000000001p697i,	/* #58 */
+    0x0.0000000000001p599  + 0x0.000000000001p0i,	/* #59 */
+    0x0.0000000000001p519  + 0x0.000000000001p0i,	/* #60 */
+    0x0.0000000000001p364  + 0x0.000000000000p0i,	/* #61 */
+    0x0.0000000000001p264  + 0x0.000000000001p0i,	/* #62 */
+    0x0.0000000000001p1004 + 0x0.000000000001p1023i,	/* #63 */
+    0x0.0000000000001p1004 + 0x0.000000000001p504i,	/* #64 */
+    0x0.0000000000001p1020 + 0x0.000000000001p630i,	/* #65 */
+    0x0.0000000000001p1020 + 0x0.000000000001p675i,	/* #66 */
+    0x0.0000000000001p1020 + 0x0.000000000001p676i,	/* #67 */
+    0x0.0000000000001p1020 + 0x0.000000000001p680i,	/* #68 */
+    0x0.0000000000001p1020 + 0x0.000000000001p730i,	/* #69 */
+    0x0.0000000000001p1020 + 0x0.000000000001p830i,	/* #70 */
+    0x0.0000000000001p1020 + 0x0.000000000001p930i,	/* #71 */
+    0x0.0000000000001p1020 + 0x0.000000000001p930i,	/* #72 */
+    0x0.0000000000001p1020 + 0x0.000000000001p930i,	/* #73 */
+    0x0.0000000000001p7    + 0x0.000000000001p0i,	/* #74 */
+    0x0.0000000000001p1    + 0x0.000000000001p0i,	/* #75 */
+    0x0.0000000000001p1    + 0x0.000000000001p2i,	/* #76 */
+    0x0.0000000000001p1    + 0x0.000000000001p2i,	/* #77 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-3i,	/* #78 */
+    0x0.0000000000001p-2   + 0x0.000000000001p-7i,	/* #79 */
+    0x0.0000000000001p-3   + 0x0.000000000001p-2i,	/* #80 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #81 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #82 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #83 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #84 */
+    0x0.0000000000001p10   + 0x0.000000000001p8i,	/* #85 */
+    0x0.0000000000001p1    + 0x0.000000000001p1i,	/* #86 */
+    0x0.0000000000001p1    + 0x0.000000000001p-10i,	/* #87 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-1i,	/* #88 */
+    0x0.0000000000001p-1   + 0x0.000000000001p-2i,	/* #89 */
+    0x0.0000000000001p1    + 0x0.000000000001p-3i,	/* #90 */
+    0x0.0000000000005p-5   + 0x0.000000000001p1i,	/* #91 */
+    0x0.0000000000001p0    + 0x0.000000000001p-2i,	/* #92 */
+    0x0.0000000000001p0    + 0x0.000000000001p2i,	/* #93 */
+    0x0.0000000000001p-1   + 0x0.000000000001p1i,	/* #94 */
+    0x0.0000000000001p2    + 0x0.000000000001p3i,	/* #95 */
+    0x0.0000000000001p-4   + 0x0.000000000001p-5i,	/* #96 */
+    0x0.0000000000001p-5   + 0x0.000000000001p-7i,	/* #97 */
+    0x0.0000000000001p-16  + 0x0.000000000001p-18i,	/* #98 */
+    0x0.0000000000001p-17  + 0x0.000000000001p-19i,	/* #99 */
+    0x0.0000000000001p0    + 0x0.000000000001p-2i	/* #100 */
+  };
+
+
+int main(int argc, char** argv)
+{
+  int i;
+  FTYPE xr, xi, yr, yi, zr, zi, zzr, zzi;
+  FTYPE er, ei;
+  __complex FTYPE ans[NUMCNT];
+  int errcnt;
+
+  errcnt = 0;
+  for (i = 0; i < NUMCNT; i++)
+    {
+      ans[i] = x[i] / y[i];
+      if( z[i] != z[i] )   /* Check for nan/inf case */
+	{
+	  zr = __real__ z[i];
+	  zi = __imag__ z[i];
+	  zzr = __real__ ans[i];
+	  zzi = __imag__ ans[i];
+	  er = __real__ errmax[i];
+	  ei = __imag__ errmax[i];
+	  errcnt++;
+	  printf("x %3d    " FMT " " FMT "i\n",
+		 i + 1, __real__ x[i], __imag__ x[i]);
+	  printf ("y %3d   " FMT " " FMT "i\n",
+		  i + 1, __real__ y[i], __imag__ y[i]);
+	  printf("expected " FMT " " FMT "i\n",
+		 __real__ z[i], __imag__ z[i]);
+	  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+		 __real__ ans[i], __imag__ ans[i], i + 1);
+	  printf("diff     " FMT " " FMT "i\n",
+		 zr - zzr, zi - zzi);
+	  printf("errmax   " FMT " " FMT "i\n\n",
+		 er, ei);
+	}
+      else
+	{
+	  if( z[i] != ans[i] )
+	    {
+	      zr = __real__ z[i];
+	      zi = __imag__ z[i];
+	      zzr = __real__ ans[i];
+	      zzi = __imag__ ans[i];
+	      er = __real__ errmax[i];
+	      ei = __imag__ errmax[i];
+	      if( (FABS(zr-zzr) > er) || (FABS(zi-zzi) > ei))
+		{	 /* report if error exceeds error max */
+		  errcnt++;
+		  printf("x %3d    " FMT " " FMT "i\n",
+			 i + 1, __real__ x[i], __imag__ x[i]);
+		  printf ("y %3d    " FMT " " FMT "i\n",
+			  i + 1, __real__ y[i], __imag__ y[i]);
+		  printf("expected " FMT " " FMT "i\n",
+			 __real__ z[i], __imag__ z[i]);
+		  printf("actual   " FMT " " FMT "i /* #%d */ FAIL\n",
+			 __real__ ans[i], __imag__ ans[i], i + 1);
+		  printf("diff     " FMT " " FMT "i\n",
+			 zr - zzr, zi - zzi);
+		  printf("errmax   " FMT " " FMT "i\n\n",
+			 er, ei);
+		}
+	    }
+	}
+    }
+  if( errcnt > 0)
+    {
+      printf("%2d Failures\n",errcnt);
+      abort();
+    }
+  printf("PASS\n");
+  return 0;
+}
+
diff --git a/libgcc/config/no-sfp-machine.h b/libgcc/config/no-sfp-machine.h
index 8f7341d..c164e81 100644
--- a/libgcc/config/no-sfp-machine.h
+++ b/libgcc/config/no-sfp-machine.h
@@ -1 +1,4 @@
 /* Dummy sfp-machine.h header for targets that don't need one.  */
+#ifndef _NO_SFP_MACHINE_H
+#define _NO_SFP_MACHINE_H
+#endif
diff --git a/libgcc/config/sparc/sfp-machine.h b/libgcc/config/sparc/sfp-machine.h
new file mode 100644
index 0000000..8654b47
--- /dev/null
+++ b/libgcc/config/sparc/sfp-machine.h
@@ -0,0 +1,14 @@
+#ifndef _SFP_MACHINE_H
+#define _SFP_MACHINE_H
+
+#define _FP_W_TYPE_SIZE 64
+#define _FP_W_TYPE      unsigned long long
+#define _FP_WS_TYPE     signed long long
+#define _FP_I_TYPE      long long
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN    4321
+#define __BYTE_ORDER    __BIG_ENDIAN
+
+#endif /* _SFP_MACHINE_H */
+
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c
index 83f865a..9c28110 100644
--- a/libgcc/libgcc2.c
+++ b/libgcc/libgcc2.c
@@ -29,6 +29,44 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "tm.h"
 #include "libgcc_tm.h"
 
+#if defined(L_divhc3) || defined(L_divsc3) || defined(L_divdc3) \
+    || defined(L_divxc3) || defined(L_divtc3)
+//#include "soft-fp/soft-fp.h"
+#include "sfp-machine.h"
+
+#ifndef _NO_SFP_MACHINE_H  /* soft-fp (IEEE format) is supported */
+#if defined(L_divsc3) && defined(__LIBGCC_HAS_SF_MODE__)
+#include "soft-fp/single.h"
+typedef union _FP_UNION_S   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_S
+#endif
+
+#if defined(L_divdc3) && defined(__LIBGCC_HAS_DF_MODE__)
+#include "soft-fp/double.h"
+typedef union _FP_UNION_D   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_D
+#endif
+
+#if defined(L_divhc3) && defined(__LIBGCC_HAS_HF_MODE__)
+#include "soft-fp/half.h"
+typedef union _FP_UNION_H   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_H
+#endif
+
+#if defined(L_divxc3) && defined(__LIBGCC_HAS_XF_MODE__)
+#include "soft-fp/extended.h"
+typedef union _FP_UNION_E   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_E
+#endif
+
+#if defined(L_divtc3) && defined(__LIBGCC_HAS_TF_MODE__)
+#include "soft-fp/quad.h"
+typedef union _FP_UNION_Q   FP_UTYPE;
+#define FP_EXPBIAS          _FP_EXPBIAS_Q
+#endif
+#endif /* _NO_SFP_MACHINE_H */
+#endif /* L_divhc3 || L_divsc3 || L_divdc3 || L_divxc3 || L_divtc3 */
+
 #ifdef HAVE_GAS_HIDDEN
 #define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
 #else
@@ -2039,16 +2077,147 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
 #if defined(L_divhc3) || defined(L_divsc3) || defined(L_divdc3) \
     || defined(L_divxc3) || defined(L_divtc3)
 
+#if defined(FP_EXPBIAS)
+#undef int
+
+/* Extract an exponent of d */
+static inline MTYPE fp_exp(MTYPE d)
+{
+  FP_UTYPE u;
+  u.flt = d;
+  return u.bits.exp - FP_EXPBIAS;
+}
+
+/* Return pow(2.0, n) */
+static inline MTYPE fp_pow2(int n)
+{
+  FP_UTYPE u, u1;
+  u.flt = 1.;
+  if (n > -FP_EXPBIAS)
+    {
+      u.bits.exp = n + FP_EXPBIAS;
+      return u.flt;
+    }
+  u.bits.exp = 1;
+  u1.flt = 1.;
+  u1.bits.exp = n - 1 + 2 * FP_EXPBIAS;
+  return u.flt * u1.flt;
+}
+
+/* Return an exponent N, such that neither (2**(ce-N))**2 nor (2**(de-N))**2
+   cause an overflow. Also try to avoid underflow. */
+static inline int scale_factor_for_c_d(int ce, int de)
+{
+  int maxe = ce, mine = de;
+  if (ce < de)
+    {
+      maxe = de;
+      mine = ce;
+    }
+  if (maxe > FP_EXPBIAS / 2)
+    {
+      if (mine - maxe > -FP_EXPBIAS)
+        return maxe;
+      if (maxe - FP_EXPBIAS / 2 >= mine - maxe + FP_EXPBIAS)
+        return maxe - FP_EXPBIAS / 2;
+      return mine - maxe + FP_EXPBIAS;
+    }
+  if (-mine > FP_EXPBIAS / 2)
+    return mine + FP_EXPBIAS <= maxe ? mine + FP_EXPBIAS : maxe;
+  return 0;
+}
+
+/* Return an exponent N, such that neither 2**(e1-N) nor 2**(e2-N) cause
+   an overflow. Also try to avoid underflow. */
+static inline int scale_factor_for_ac_bd_bc_ad(int e1, int e2) 
+{
+  int maxe = e1, mine = e2;
+  if (e1 < e2)
+    {
+      maxe = e2;
+      mine = e1;
+    }
+  if (maxe >= FP_EXPBIAS)
+    return maxe - FP_EXPBIAS + 1;
+  if (mine <= -FP_EXPBIAS)
+    {
+      if (maxe < 0)
+        return maxe;
+      return FP_EXPBIAS - 1 - maxe;
+    }
+  return 0;
+}
+#endif /* FP_EXPBIAS */
+
 CTYPE
 CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
 {
   MTYPE denom, ratio, x, y;
   CTYPE res;
 
-  /* ??? We can get better behavior from logarithmic scaling instead of
-     the division.  But that would mean starting to link libgcc against
-     libm.  We could implement something akin to ldexp/frexp as gcc builtins
-     fairly easily...  */
+#if defined(FP_EXPBIAS)
+  /* By scaling the calculation with powers of 2.0 we can avoid any roundoff
+     errors.
+     1. Convert (a+bi)/(c+di) to ((a+bi)/((c/x)+(d/x)i))*(1.0/x), where
+       x is any power of 2, such that neither (c/x)**2 nor (d/x)**2 cause
+       an overflow. Try to avoid underflow in c/x and d/x.
+     2) Callculate a real part as
+       ((a/y)*(c/x)+(b/y)*(d/x)) / ((c/x)**2+(y/x)**2) * (y/x), where
+       y is any power of 2, such that neither (a/y)*(c/x) nor (b/y)*(d/x) cause
+       an overflow. Try to avoid underflow in a/y and b/y.
+     3) Callculate an imaginary part as
+       ((b/y)*(c/x)-(a/y)*(d/x)) / ((c/x)**2 + (y/x)**2) * (y/x), where
+       y is any power of 2, such that neither (b/y)*(c/x) nor (a/y)*(d/x) cause
+       an overflow. Try to avoid underflow in a/y and b/y.  */
+
+  int ae, be, ce, de, abe, cde;
+  ae = fp_exp (a);
+  be = fp_exp (b);
+  ce = fp_exp (c);
+  de = fp_exp (d);
+  cde = scale_factor_for_c_d (ce, de);
+  if (cde != 0)
+    {
+      ratio = fp_pow2 (-cde);
+      c *= ratio;
+      d *= ratio;
+      ce -= cde;
+      de -= cde;
+    }
+  denom = c * c + d * d;
+
+  // Calculate a real part
+  abe = scale_factor_for_ac_bd_bc_ad (ae + ce, be + de);
+  if (abe != 0)
+    {
+      MTYPE a1, b1;
+      ratio = fp_pow2 (-abe);
+      a1 = a * ratio;
+      b1 = b * ratio;
+      x = a1 * c + b1 * d;
+    }
+  else
+    x = a * c + b * d;
+  x /= denom;
+  if (abe - cde != 0)
+    x *= fp_pow2(abe - cde);
+
+  // Calculate an imaginary part
+  abe = scale_factor_for_ac_bd_bc_ad (be + ce, ae + de);
+  if (abe != 0)
+    {
+      MTYPE a1, b1;
+      ratio = fp_pow2 (-abe);
+      a1 = a * ratio;
+      b1 = b * ratio;
+      y = b1 * c - a1 * d;
+    }
+  else
+    y = b * c - a * d;
+  y /= denom;
+  if (abe - cde != 0)
+    y *= fp_pow2(abe - cde);
+#else
   if (FABS (c) < FABS (d))
     {
       ratio = c / d;
@@ -2063,6 +2232,7 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
       x = ((b * ratio) + a) / denom;
       y = (b - (a * ratio)) / denom;
     }
+#endif /* FP_EXPBIAS */
 
   /* Recover infinities and zeros that computed as NaN+iNaN; the only cases
      are nonzero/zero, infinite/finite, and finite/infinite.  */
diff --git a/libgcc/soft-fp/quad.h b/libgcc/soft-fp/quad.h
index a09b95f..d96380c 100644
--- a/libgcc/soft-fp/quad.h
+++ b/libgcc/soft-fp/quad.h
@@ -203,7 +203,7 @@ union _FP_UNION_Q
 union _FP_UNION_Q
 {
   TFtype flt /* __attribute__ ((mode (TF))) */ ;
-  struct _FP_STRUCT_LAYOUT
+  struct _FP_STRUCT_LAYOUT_0
   {
     _FP_W_TYPE a, b;
   } longs;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-25 19:19   ` vladimir.mezentsev
@ 2017-10-25 20:04     ` Joseph Myers
  0 siblings, 0 replies; 20+ messages in thread
From: Joseph Myers @ 2017-10-25 20:04 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Wed, 25 Oct 2017, vladimir.mezentsev@oracle.com wrote:

> On 10/25/2017 10:28 AM, Joseph Myers wrote:
> > On Wed, 25 Oct 2017, vladimir.mezentsev@oracle.com wrote:
> >
> >> +# Disable FMA (floating-point multiply-add) instructions for complex division.
> >> +# These instructions can produce different result if two operations executed separately.
> >> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
> >> +LIB2_DIV3_FUNCS = _divdc3 _divhc3 _divsc3
> > Without regard to whether the change is appropriate in the first place, 
> > I'm doubtful of the logic for selecting floating-point modes.  I'd expect 
> > something that applies to all floating-point modes.  Even if nothing has 
> > fused XFmode operations, some architectures (e.g. s390, powerpc) have 
> > fused operations on TFmode / KFmode.
> 
>    Hello Joseph and GCC-team,
> Different people are giving me different directions.
> I am glad to change my fix but please provide clear directions on how
> you want to see it.

I am unconvinced of the need for a change that reduces accuracy in some 
cases to make things less surprising in other cases.

I am clear that if there is to be such a change, it should be made 
consistently for all affected floating-point modes, including TFmode / 
KFmode where available, since those have fused operations on some 
platforms.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-25 17:29 ` Joseph Myers
@ 2017-10-25 19:19   ` vladimir.mezentsev
  2017-10-25 20:04     ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2017-10-25 19:19 UTC (permalink / raw)
  To: Joseph Myers; +Cc: gcc-patches

On 10/25/2017 10:28 AM, Joseph Myers wrote:
> On Wed, 25 Oct 2017, vladimir.mezentsev@oracle.com wrote:
>
>> +# Disable FMA (floating-point multiply-add) instructions for complex division.
>> +# These instructions can produce different result if two operations executed separately.
>> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
>> +LIB2_DIV3_FUNCS = _divdc3 _divhc3 _divsc3
> Without regard to whether the change is appropriate in the first place, 
> I'm doubtful of the logic for selecting floating-point modes.  I'd expect 
> something that applies to all floating-point modes.  Even if nothing has 
> fused XFmode operations, some architectures (e.g. s390, powerpc) have 
> fused operations on TFmode / KFmode.

   Hello Joseph and GCC-team,
Different people are giving me different directions.
I am glad to change my fix but please provide clear directions on how
you want to see it.

  michael.hudson@linaro.org created  PR 59714 and suggested to set 
-ffp-contract=off:

> int main(int argc, char** argv)
> {
>  __complex double c = 1.0 + 3.0i;
>  printf("%g\n", __imag__ (c/c));
> }
> ubuntu@arm64:~$ gcc cplx.c -o cplx
> ubuntu@arm64:~$ ./cplx
> -1.66533e-17
>
> This is because libgcc2.c is compiled in a way that lets the compiler used fused multiply add instructions.
> It shouldn't be! > ...

> In general, fma makes it hard to reason about expressions
> like "a*b-c*d" -- which of the multiplications is being done at the
higher precision?
> But I guess arguing to fp-contract to default to off is a war I don't
want to get into fighting.

Thank you,
-Vladimir

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH] PR libgcc/59714 complex division is surprising on aarch64
@ 2017-10-25 17:29 vladimir.mezentsev
  2017-10-25 17:29 ` Joseph Myers
  0 siblings, 1 reply; 20+ messages in thread
From: vladimir.mezentsev @ 2017-10-25 17:29 UTC (permalink / raw)
  To: gcc-patches; +Cc: vladimir.mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

FMA (floating-point multiply-add) instructions are supported on aarch64.
These instructions can produce different result if two operations executed separately.
-ffp-contract=off doesn't allow the FMA instructions.

Tested on aarch64-unknown-linux-gnu. No regression. Two failed tests now passed.

ChangeLog:
2017-10-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR libgcc/59714
* libgcc/Makefile.in: Add -ffp-contract=off
---
 libgcc/Makefile.in | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index a1a392d..f313556 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -455,6 +455,14 @@ ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
   lib2funcs += $(subst XX,di,$(dwfloatfuncs))
 endif
 
+# Disable FMA (floating-point multiply-add) instructions for complex division.
+# These instructions can produce different result if two operations executed separately.
+LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
+LIB2_DIV3_FUNCS = _divdc3 _divhc3 _divsc3
+lib2-div3-o = $(patsubst %,%$(objext),$(LIB2_DIV3_FUNCS))
+lib2-div3-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIV3_FUNCS))
+$(lib2-div3-o) $(lib2-div3-s-o): LIBGCC2_CFLAGS += $(LIBGCC2_FFP_CONTRAST_CFLAGS)
+
 # These might cause a divide overflow trap and so are compiled with
 # unwinder info.
 LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _divmoddi4 \
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-25 17:29 vladimir.mezentsev
@ 2017-10-25 17:29 ` Joseph Myers
  2017-10-25 19:19   ` vladimir.mezentsev
  0 siblings, 1 reply; 20+ messages in thread
From: Joseph Myers @ 2017-10-25 17:29 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: gcc-patches

On Wed, 25 Oct 2017, vladimir.mezentsev@oracle.com wrote:

> +# Disable FMA (floating-point multiply-add) instructions for complex division.
> +# These instructions can produce different result if two operations executed separately.
> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
> +LIB2_DIV3_FUNCS = _divdc3 _divhc3 _divsc3

Without regard to whether the change is appropriate in the first place, 
I'm doubtful of the logic for selecting floating-point modes.  I'd expect 
something that applies to all floating-point modes.  Even if nothing has 
fused XFmode operations, some architectures (e.g. s390, powerpc) have 
fused operations on TFmode / KFmode.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-19 17:24     ` Wilco Dijkstra
@ 2017-10-25  3:26       ` vladimir.mezentsev
  0 siblings, 0 replies; 20+ messages in thread
From: vladimir.mezentsev @ 2017-10-25  3:26 UTC (permalink / raw)
  To: Wilco Dijkstra, Richard Earnshaw; +Cc: GCC Patches, nd

On 10/19/2017 06:07 AM, Wilco Dijkstra wrote:
> Vladimir wrote:
>
> +# Disable floating-point expression contraction
> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
> +
>
> It looks like this disables fp-contract in all of libgcc...
> What is the the number of FMAs in libgcc before/after?
In original (without my fix) libgcc_s.so:
% objdump -d libgcc_s.so| egrep '(fmadd|fmsub|fnmadd|fnmsub)'|wc -l
  38

In my new libgcc_s.so ( see my fix below)
% objdump -d libgcc_s.so| egrep '(fmadd|fmsub|fnmadd|fnmsub)'|wc -l
8
> If it disables anything other than the ones in complex division, it
> would have an unintended performance impact. It's best to do
> this just for complex division.

On 10/19/2017 10:17 AM, Wilco Dijkstra wrote:
> Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
>> On 10/19/2017 06:37 AM, Richard Earnshaw (lists) wrote:
>>> On 19/10/17 14:07, Wilco Dijkstra wrote:
>>>> Vladimir wrote:
>>>>
>>>> +# Disable floating-point expression contraction
>>>> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
>>>> +
>>>>
>>>> It looks like this disables fp-contract in all of libgcc...
>>>> What is the the number of FMAs in libgcc before/after?
>>    How can I find this number ?
>> dis <all functions in libgcc> | grep <all FMAs> | wc
> Eg. objdump -d ~/install/gcc/lib64/libgcc_s.so | grep -c fmadd
> Also grep fmsub, fnmadd, fnmsub.
>
>>> It's probably better to do this with an attribute
>>>
>>>         __attribute__((optimize("fp-contract=off")))
>>>
>>> on the affected functions.
>>    I like your suggestion.
> I don't think this will work in general, IIRC only a few targets correctly
> implement the optimize pragma. Changing the makefile to build only
> __divdc3/__divtc3/__divsc3/__divhc3 without FMA looks like a better
> approach.

Only 3 (_divdc3 / _divhc3 / _divsc3) have FMAs.
The other FMAs are in:
_fixunsdfdi.o _fixunsdfdi_s.o _fixunssfdi.o _fixunssfdi_s.o _muldc3.o
_muldc3_s.o _mulhc3.o _mulhc3_s.o _mulsc3.o _mulsc3_s.o

I suggest the following fix:

% git diff
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index a1a392d..f313556 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -455,6 +455,14 @@ ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
   lib2funcs += $(subst XX,di,$(dwfloatfuncs))
 endif
 
+# Disable FMA (floating-point multiply-add) instructions for complex
division.
+# These instructions can produce different result if two operations
executed separately.
+LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
+LIB2_DIV3_FUNCS = _divdc3 _divhc3 _divsc3
+lib2-div3-o = $(patsubst %,%$(objext),$(LIB2_DIV3_FUNCS))
+lib2-div3-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIV3_FUNCS))
+$(lib2-div3-o) $(lib2-div3-s-o): LIBGCC2_CFLAGS +=
$(LIBGCC2_FFP_CONTRAST_CFLAGS)
+



 If my fix will be approved I send ChangeLog and a patch file tomorrow.

-Vladimir

> However we also need to decide whether this is the best possible fix.
> It will affect accuracy of other inputs as well...
>
> Wilco

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-19 17:13   ` Vladimir Mezentsev
@ 2017-10-19 17:24     ` Wilco Dijkstra
  2017-10-25  3:26       ` vladimir.mezentsev
  0 siblings, 1 reply; 20+ messages in thread
From: Wilco Dijkstra @ 2017-10-19 17:24 UTC (permalink / raw)
  To: Richard Earnshaw, vladimir.mezentsev; +Cc: GCC Patches, nd

Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
> On 10/19/2017 06:37 AM, Richard Earnshaw (lists) wrote:
>> On 19/10/17 14:07, Wilco Dijkstra wrote:
>>> Vladimir wrote:
>>>
>>> +# Disable floating-point expression contraction
>>> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
>>> +
>>>
>>> It looks like this disables fp-contract in all of libgcc...
>>> What is the the number of FMAs in libgcc before/after?
>
>   How can I find this number ?
> dis <all functions in libgcc> | grep <all FMAs> | wc

Eg. objdump -d ~/install/gcc/lib64/libgcc_s.so | grep -c fmadd
Also grep fmsub, fnmadd, fnmsub.

> > It's probably better to do this with an attribute
> >
> >        __attribute__((optimize("fp-contract=off")))
> >
> > on the affected functions.
>
>    I like your suggestion.

I don't think this will work in general, IIRC only a few targets correctly
implement the optimize pragma. Changing the makefile to build only
__divdc3/__divtc3/__divsc3/__divhc3 without FMA looks like a better
approach.

However we also need to decide whether this is the best possible fix.
It will affect accuracy of other inputs as well...

Wilco

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-19 13:52 ` Richard Earnshaw (lists)
@ 2017-10-19 17:13   ` Vladimir Mezentsev
  2017-10-19 17:24     ` Wilco Dijkstra
  0 siblings, 1 reply; 20+ messages in thread
From: Vladimir Mezentsev @ 2017-10-19 17:13 UTC (permalink / raw)
  To: Richard Earnshaw (lists), Wilco Dijkstra; +Cc: GCC Patches, nd

On 10/19/2017 06:37 AM, Richard Earnshaw (lists) wrote:
> On 19/10/17 14:07, Wilco Dijkstra wrote:
>> Vladimir wrote:
>>
>> +# Disable floating-point expression contraction
>> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
>> +
>>
>> It looks like this disables fp-contract in all of libgcc...
>> What is the the number of FMAs in libgcc before/after?

   How can I find this number ?
dis <all functions in libgcc> | grep <all FMAs> | wc

Or are there the other simple ways ?

>>
>> If it disables anything other than the ones in complex division, it
>> would have an unintended performance impact. It's best to do
>> this just for complex division.
>>
>> Wilco
>>
> It's probably better to do this with an attribute
>
> 	__attribute__((optimize("fp-contract=off")))
>
> on the affected functions.

   I like your suggestion.

-Vladimir

>
> R.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
  2017-10-19 13:20 Wilco Dijkstra
@ 2017-10-19 13:52 ` Richard Earnshaw (lists)
  2017-10-19 17:13   ` Vladimir Mezentsev
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Earnshaw (lists) @ 2017-10-19 13:52 UTC (permalink / raw)
  To: Wilco Dijkstra, vladimir.mezentsev; +Cc: GCC Patches, nd

On 19/10/17 14:07, Wilco Dijkstra wrote:
> Vladimir wrote:
> 
> +# Disable floating-point expression contraction
> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
> +
> 
> It looks like this disables fp-contract in all of libgcc...
> What is the the number of FMAs in libgcc before/after?
> 
> If it disables anything other than the ones in complex division, it
> would have an unintended performance impact. It's best to do
> this just for complex division.
> 
> Wilco
> 

It's probably better to do this with an attribute

	__attribute__((optimize("fp-contract=off")))

on the affected functions.

R.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
@ 2017-10-19 13:20 Wilco Dijkstra
  2017-10-19 13:52 ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 20+ messages in thread
From: Wilco Dijkstra @ 2017-10-19 13:20 UTC (permalink / raw)
  To: vladimir.mezentsev; +Cc: GCC Patches, nd

Vladimir wrote:

+# Disable floating-point expression contraction
+LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
+

It looks like this disables fp-contract in all of libgcc...
What is the the number of FMAs in libgcc before/after?

If it disables anything other than the ones in complex division, it
would have an unintended performance impact. It's best to do
this just for complex division.

Wilco

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH] PR libgcc/59714 complex division is surprising on aarch64
@ 2017-10-18 21:32 vladimir.mezentsev
  0 siblings, 0 replies; 20+ messages in thread
From: vladimir.mezentsev @ 2017-10-18 21:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: vladimir.mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

FMA (floating-point multiply-add) instructions are supported on aarch64.
These instructions can produce different result if two operations executed separately.
-ffp-contract=off doesn't allow the FMA instructions.

Tested on two platforms:
  aarch64-unknown-linux-gnu: No regression. Two failed tests now passed.
  sparc64-unknown-linux-gnu: No regression.

ChangeLog:
2017-10-18  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR libgcc/59714
* libgcc/Makefile.in: Add -ffp-contract=off
---
 libgcc/Makefile.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index a1a392d..b771875 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -237,12 +237,16 @@ else
 DECNUMINC =
 endif
 
+# Disable floating-point expression contraction
+LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off
+
 # Options to use when compiling libgcc2.a.
 #
 LIBGCC2_DEBUG_CFLAGS = -g
 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
 		 $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
 		 -fbuilding-libgcc -fno-stack-protector \
+		 $(LIBGCC2_FFP_CONTRAST_CFLAGS) \
 		 $(INHIBIT_LIBC_CFLAGS)
 
 # Additional options to use when compiling libgcc2.a.
-- 
1.7.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-02-07  0:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-25 20:40 [PATCH] PR libgcc/59714 complex division is surprising on aarch64 vladimir.mezentsev
2018-01-26  3:39 ` Joseph Myers
2018-01-29 20:54   ` vladimir.mezentsev
2018-01-29 21:01     ` Joseph Myers
2018-02-06  8:55       ` vladimir.mezentsev
2018-02-06 17:13         ` Joseph Myers
  -- strict thread matches above, loose matches on Subject: below --
2018-02-06  7:20 vladimir.mezentsev
2018-02-06 16:53 ` Joseph Myers
2018-02-07  0:25   ` vladimir.mezentsev
2018-02-07  0:31     ` Joseph Myers
2017-10-25 17:29 vladimir.mezentsev
2017-10-25 17:29 ` Joseph Myers
2017-10-25 19:19   ` vladimir.mezentsev
2017-10-25 20:04     ` Joseph Myers
2017-10-19 13:20 Wilco Dijkstra
2017-10-19 13:52 ` Richard Earnshaw (lists)
2017-10-19 17:13   ` Vladimir Mezentsev
2017-10-19 17:24     ` Wilco Dijkstra
2017-10-25  3:26       ` vladimir.mezentsev
2017-10-18 21:32 vladimir.mezentsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).