]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/19696 (gcc.c-torture/execute/ieee/copysign1.c: Unsatisfied symbols: copys...
authorRichard Henderson <rth@redhat.com>
Tue, 1 Feb 2005 20:57:22 +0000 (12:57 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 1 Feb 2005 20:57:22 +0000 (12:57 -0800)
        PR 19696
        * optabs.c (expand_copysign_absneg): Export.
        * optabs.h (expand_copysign_absneg): Declare.
        * config/rs6000/rs6000.md (copysigntf3): New.

        * gcc.c-torture/execute/ieee/copysign1.c: Special case sizeof
        long double for ibm double-double format.
        * gcc.c-torture/execute/ieee/copysign2.c: Likewise.

From-SVN: r94559

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/optabs.c
gcc/optabs.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/ieee/copysign1.c
gcc/testsuite/gcc.c-torture/execute/ieee/copysign2.c

index 3ec28c7a24fd11b7f4bba2388675f710d73b66f1..054b745832ad3f6c347f7c8b7e8924fc02f52397 100644 (file)
@@ -1,3 +1,10 @@
+2005-02-01  Richard Henderson  <rth@redhat.com>
+
+       PR 19696
+       * optabs.c (expand_copysign_absneg): Export.
+       * optabs.h (expand_copysign_absneg): Declare.
+       * config/rs6000/rs6000.md (copysigntf3): New.
+
 2005-02-01  Diego Novillo  <dnovillo@redhat.com>
 
        PR tree-optimization/19633
index 7ccdab8b5a8e35f9e0ebf9a32e097642f5383437..c2dd678d7670638ddcb1b7cf4d2781d9434b17ea 100644 (file)
   operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
   operands[6] = simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word);
 }")
+
+(define_expand "copysigntf3"
+  [(match_operand:TF 0 "general_operand" "")
+   (match_operand:TF 1 "general_operand" "")
+   (match_operand:TF 2 "general_operand" "")]
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+{
+  rtx target, op0, op1, temp;
+  bool op0_is_abs = false;
+
+  target = operands[0];
+  op0 = operands[1];
+  op1 = operands[2];
+
+  if (GET_CODE (op0) == CONST_DOUBLE)
+    {
+      if (real_isneg (CONST_DOUBLE_REAL_VALUE (op0)))
+       op0 = simplify_unary_operation (ABS, TFmode, op0, TFmode);
+      op0_is_abs = true;
+    }
+
+  temp = expand_copysign_absneg (TFmode, op0, op1, target, 127, op0_is_abs);
+  if (temp != target)
+    emit_move_insn (target, temp);
+  DONE;
+})
 \f
 ;; Next come the multi-word integer load and store and the load and store
 ;; multiple insns.
index dd3232b499cb6631e4558cc7f39a9747ca1785c3..889f9156dd165027a6d7954a0cffd5a02799dcaf 100644 (file)
@@ -2662,7 +2662,7 @@ expand_abs (enum machine_mode mode, rtx op0, rtx target,
    is that we have a split register file, and leaving op0 in fp registers,
    and not playing with subregs so much, will help the register allocator.  */
 
-static rtx
+rtx
 expand_copysign_absneg (enum machine_mode mode, rtx op0, rtx op1, rtx target,
                        int bitpos, bool op0_is_abs)
 {
index a378a963c729f761cef8b436e136b4e6d5172a80..613831a82496f48ee49a756856026bcf47b2d409 100644 (file)
@@ -455,6 +455,7 @@ extern rtx expand_abs (enum machine_mode, rtx, rtx, int, int);
 
 /* Expand the copysign operation.  */
 extern rtx expand_copysign (rtx, rtx, rtx);
+extern rtx expand_copysign_absneg (enum machine_mode, rtx, rtx, rtx, int, bool);
 
 /* Generate an instruction with a given INSN_CODE with an output and
    an input.  */
index a6ff8329a1fe83c2966bd99188a6a0579e2461f5..ace5f5f5ce1bee7d936c670256ebc7375c350ee9 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-01  Richard Henderson  <rth@redhat.com>
+
+       * gcc.c-torture/execute/ieee/copysign1.c: Special case sizeof
+       long double for ibm double-double format.
+       * gcc.c-torture/execute/ieee/copysign2.c: Likewise.
+
 2005-02-01  Diego Novillo  <dnovillo@redhat.com>
 
        PR tree-optimization/19633
index 6f6a215ad489d0ad03b69edea709e1ea1fda0d49..fa4097a748dceba2bad23e2af85d60d5bca4ace2 100644 (file)
 # endif
 #endif
 
+/* Work around the fact that the sign of the second double in the IBM
+   double-double format is not strictly specified when it contains a zero.
+   For instance, -0.0L can be represented with either (-0.0, +0.0) or
+   (-0.0, -0.0).  The former is what we'll get from the compiler when it
+   builds constants; the later is what we'll get from the negation operator
+   at runtime.  */
+/* ??? This hack only works for big-endian, which is fortunately true for
+   all of AIX, Darwin, and Irix.  */
+#if LDBL_MANT_DIG == 106
+# undef fpsizeofl
+# define fpsizeofl     sizeof(double)
+#endif
+
 
 #define TEST(TYPE, EXT)                                                \
 TYPE c##EXT (TYPE x, TYPE y)                                   \
index a39d11574f2e48f3ee21f1b347847938444a318d..fac7ab3a530c6527ddc8c532d2e8086e36051554 100644 (file)
 # endif
 #endif
 
+/* Work around the fact that the sign of the second double in the IBM
+   double-double format is not strictly specified when it contains a zero.
+   For instance, -0.0L can be represented with either (-0.0, +0.0) or
+   (-0.0, -0.0).  The former is what we'll get from the compiler when it
+   builds constants; the later is what we'll get from the negation operator
+   at runtime.  */
+/* ??? This hack only works for big-endian, which is fortunately true for
+   all of AIX, Darwin, and Irix.  */
+#if LDBL_MANT_DIG == 106
+# undef fpsizeofl
+# define fpsizeofl     sizeof(double)
+#endif
 
 
 #define TEST(TYPE, EXT)                                                \