*** empty log message ***
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 20 May 1992 00:10:41 +0000 (17:10 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 20 May 1992 00:10:41 +0000 (17:10 -0700)
From-SVN: r1022

gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h
gcc/config/sparc/sparc.md
gcc/fixincludes

index a875dba5e3c2a828dcc81d3597802af22d4b6be7..76527931f5ec62718572157a2e244c3e11cf0f26 100644 (file)
@@ -329,7 +329,8 @@ normal_comp_operator (op, mode)
   if (GET_RTX_CLASS (code) != '<')
     return 0;
 
-  if (GET_MODE (XEXP (op, 0)) == CCFPmode)
+  if (GET_MODE (XEXP (op, 0)) == CCFPmode
+      || GET_MODE (XEXP (op, 0)) == CCFPEmode)
     return 1;
 
   return (code != NE && code != EQ && code != GEU && code != LTU);
@@ -1915,8 +1916,9 @@ output_scc_insn (operands, insn)
    it can easily be got.  */
 
 /* Modes for condition codes.  */
-#define C_MODES                \
-  ((1 << (int) CCmode) | (1 << (int) CC_NOOVmode) | (1 << (int) CCFPmode))
+#define C_MODES                                                \
+  ((1 << (int) CCmode) | (1 << (int) CC_NOOVmode)      \
+   | (1 << (int) CCFPmode) | (1 << (int) CCFPEmode))
 
 /* Modes for single-word (and smaller) quantities.  */
 #define S_MODES                                                \
@@ -2282,32 +2284,33 @@ output_cbranch (op, label, reversed, annul, noop)
      Because there is currently no concept of pre-delay slots, we can fix
      this only by always emitting a nop before a floating point branch.  */
 
-  if (mode == CCFPmode)
+  if (mode == CCFPmode || mode == CCFPEmode)
     strcpy (string, "nop\n\t");
 
   /* If not floating-point or if EQ or NE, we can just reverse the code.  */
-  if (reversed && (mode != CCFPmode || code == EQ || code == NE))
+  if (reversed
+      && ((mode != CCFPmode && mode != CCFPEmode) || code == EQ || code == NE))
     code = reverse_condition (code), reversed = 0;
 
   /* Start by writing the branch condition.  */
   switch (code)
     {
     case NE:
-      if (mode == CCFPmode)
+      if (mode == CCFPmode || mode == CCFPEmode)
        strcat (string, "fbne");
       else
        strcpy (string, "bne");
       break;
 
     case EQ:
-      if (mode == CCFPmode)
+      if (mode == CCFPmode || mode == CCFPEmode)
        strcat (string, "fbe");
       else
        strcpy (string, "be");
       break;
 
     case GE:
-      if (mode == CCFPmode)
+      if (mode == CCFPmode || mode == CCFPEmode)
        {
          if (reversed)
            strcat (string, "fbul");
@@ -2321,7 +2324,7 @@ output_cbranch (op, label, reversed, annul, noop)
       break;
 
     case GT:
-      if (mode == CCFPmode)
+      if (mode == CCFPmode || mode == CCFPEmode)
        {
          if (reversed)
            strcat (string, "fbule");
@@ -2333,7 +2336,7 @@ output_cbranch (op, label, reversed, annul, noop)
       break;
 
     case LE:
-      if (mode == CCFPmode)
+      if (mode == CCFPmode || mode == CCFPEmode)
        {
          if (reversed)
            strcat (string, "fbug");
@@ -2345,7 +2348,7 @@ output_cbranch (op, label, reversed, annul, noop)
       break;
 
     case LT:
-      if (mode == CCFPmode)
+      if (mode == CCFPmode || mode == CCFPEmode)
        {
          if (reversed)
            strcat (string, "fbuge");
index 00f58583d6b0368131c105e48ae0852ab0afe812..50d0835366525cb0390c5bbf2997ddf27654e6d7 100644 (file)
@@ -1236,23 +1236,26 @@ extern struct rtx_def *legitimize_pic_address ();
    subtract insn is used to set the condition code.  Different branches are
    used in this case for some operations.
 
-   We also have a mode to indicate that the relevant condition code is
-   in the floating-point condition code.  This really should be a separate
-   register, but we don't want to go to 65 registers.  */
-#define EXTRA_CC_MODES CC_NOOVmode, CCFPmode
+   We also have two modes to indicate that the relevant condition code is
+   in the floating-point condition code register.  One for comparisons which
+   will generate an exception if the result is unordered (CCFPEmode) and
+   one for comparisons which will never trap (CCFPmode).  This really should
+   be a separate register, but we don't want to go to 65 registers.  */
+#define EXTRA_CC_MODES CC_NOOVmode, CCFPmode, CCFPEmode
 
 /* Define the names for the modes specified above.  */
-#define EXTRA_CC_NAMES "CC_NOOV", "CCFP"
+#define EXTRA_CC_NAMES "CC_NOOV", "CCFP", "CCFPE"
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
-   return the mode to be used for the comparison.  For floating-point, CCFPmode
-   should be used.  CC_NOOVmode should be used when the first operand is a
+   return the mode to be used for the comparison.  For floating-point,
+   CCFP[E]mode is used.  CC_NOOVmode should be used when the first operand is a
    PLUS, MINUS, or NEG.  CCmode should be used when no special processing is
    needed.  */
 #define SELECT_CC_MODE(OP,X) \
-  (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode                  \
-   : (GET_CODE (X) == PLUS || GET_CODE (X) == MINUS || GET_CODE (X) == NEG) \
-   ? CC_NOOVmode : CCmode)
+  (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT                         \
+   ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode)           \
+   : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS || GET_CODE (X) == NEG) \
+      ? CC_NOOVmode : CCmode))
 
 /* A function address in a call instruction
    is a byte address (for indexing purposes)
index 4f8dc221383b1dbe2d147da08ca968fffdc20e18..45b3946397931c2d91508c2b970645bb1db38ccc 100644 (file)
   "cmp %r0,%1"
   [(set_attr "type" "compare")])
 
+(define_insn ""
+  [(set (reg:CCFPE 0)
+       (compare:CCFPE (match_operand:DF 0 "register_operand" "f")
+                      (match_operand:DF 1 "register_operand" "f")))]
+  ""
+  "fcmped %0,%1"
+  [(set_attr "type" "fpcmp")])
+
+(define_insn ""
+  [(set (reg:CCFPE 0)
+       (compare:CCFPE (match_operand:SF 0 "register_operand" "f")
+                      (match_operand:SF 1 "register_operand" "f")))]
+  ""
+  "fcmpes %0,%1"
+  [(set_attr "type" "fpcmp")])
+
+(define_insn ""
+  [(set (reg:CCFPE 0)
+       (compare:CCFPE (match_operand:TF 0 "register_operand" "f")
+                      (match_operand:TF 1 "register_operand" "f")))]
+  ""
+  "fcmpeq %0,%1"
+  [(set_attr "type" "fpcmp")])
+
 (define_insn ""
   [(set (reg:CCFP 0)
        (compare:CCFP (match_operand:DF 0 "register_operand" "f")
                      (match_operand:DF 1 "register_operand" "f")))]
   ""
-  "fcmped %0,%1"
+  "fcmpd %0,%1"
   [(set_attr "type" "fpcmp")])
 
 (define_insn ""
        (compare:CCFP (match_operand:SF 0 "register_operand" "f")
                      (match_operand:SF 1 "register_operand" "f")))]
   ""
-  "fcmpes %0,%1"
+  "fcmps %0,%1"
   [(set_attr "type" "fpcmp")])
 
 (define_insn ""
        (compare:CCFP (match_operand:TF 0 "register_operand" "f")
                      (match_operand:TF 1 "register_operand" "f")))]
   ""
-  "fcmpeq %0,%1"
+  "fcmpq %0,%1"
   [(set_attr "type" "fpcmp")])
 
 ;; The SEQ and SNE patterns are special because they can be done
index 7381b3fa96c062b1df728db50a2b66f3c330f6d2..2c6f22d3f60f25bdab7f7b330bf5121edd847daf 100755 (executable)
@@ -599,6 +599,42 @@ if [ -r ${LIB}/$file ]; then
   fi
 fi
 
+# Fix non-ANSI memcpy declaration that conflicts with gcc's builtin
+# declaration on Sun OS 4.x.  We must only fix this on Sun OS 4.x, because
+# many other systems have similar text but correct versions of the file.
+# To ensure only Sun's is fixed, we grep for a likely unique string.
+file=memory.h
+if egrep '/\*  @\(#\)memory.h 1.4 88/08/19 SMI; from S5R2 1.2  \*/' $file > /dev/null; then
+  if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+    cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+    chmod +w ${LIB}/$file 2>/dev/null
+  fi
+  if [ -r ${LIB}/$file ]; then
+    echo Replacing $file
+    cat > ${LIB}/$file << EOF
+/* This file was generated by fixincludes */
+#ifndef __memory_h__
+#define __memory_h__
+
+#ifdef __STDC__
+extern void *memccpy();
+extern void *memchr();
+extern void *memcpy();
+extern void *memset();
+#else
+extern char *memccpy();
+extern char *memchr();
+extern char *memcpy();
+extern char *memset();
+#endif /* __STDC__ */
+
+extern int memcmp();
+
+#endif __memory_h__
+EOF
+  fi
+fi
+
 echo 'Removing unneeded directories:'
 cd $LIB
 files=`find . -type d -print | sort -r`