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);
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 \
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");
break;
case GT:
- if (mode == CCFPmode)
+ if (mode == CCFPmode || mode == CCFPEmode)
{
if (reversed)
strcat (string, "fbule");
break;
case LE:
- if (mode == CCFPmode)
+ if (mode == CCFPmode || mode == CCFPEmode)
{
if (reversed)
strcat (string, "fbug");
break;
case LT:
- if (mode == CCFPmode)
+ if (mode == CCFPmode || mode == CCFPEmode)
{
if (reversed)
strcat (string, "fbuge");
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)
"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
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`