From: Jim Wilson Date: Wed, 20 May 1992 00:10:41 +0000 (-0700) Subject: *** empty log message *** X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4d449554949422320218bc1d565848cdc5478c80;p=gcc.git *** empty log message *** From-SVN: r1022 --- diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index a875dba5e3c..76527931f5e 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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"); diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 00f58583d6b..50d08353665 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -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) diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 4f8dc221383..45b39463979 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -366,12 +366,36 @@ "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 "" @@ -379,7 +403,7 @@ (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 "" @@ -387,7 +411,7 @@ (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 diff --git a/gcc/fixincludes b/gcc/fixincludes index 7381b3fa96c..2c6f22d3f60 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -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`