From: Richard Henderson Date: Thu, 1 Jun 2000 16:29:09 +0000 (-0700) Subject: i960.c (i960_br_predict_opcode): Remove. X-Git-Tag: prereleases/libstdc++-2.92~6020 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=eb9c1bb6e27de891fcc11f69b83a1949d35ce27d;p=gcc.git i960.c (i960_br_predict_opcode): Remove. * i960.c (i960_br_predict_opcode): Remove. (i960_print_operand) [+]: Emit branch prediction hints. (i960_function_arg): Return early for VOIDmode. (i960_round_align): Return early for incomplete types. * i960.h (PRINT_OPERAND_PUNCT_VALID_P): New. * i960.md (all conditional branches): Add "%+". From-SVN: r34342 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3959db26df3d..098343e60e2c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2000-06-01 Richard Henderson + + * i960.c (i960_br_predict_opcode): Remove. + (i960_print_operand) [+]: Emit branch prediction hints. + (i960_function_arg): Return early for VOIDmode. + (i960_round_align): Return early for incomplete types. + * i960.h (PRINT_OPERAND_PUNCT_VALID_P): New. + * i960.md (all conditional branches): Add "%+". + Thu Jun 1 12:24:21 2000 Richard Kenner * alias.c (get_alias_set): Don't call language-specific routine more @@ -22,7 +31,7 @@ Thu Jun 1 09:37:35 2000 Clinton Popetz * Makefile.in (c-decl.o): Depend on $(EXPR_H), not expr.h. - * c-decl.c (init_decl_processing): Set lang_get_alias_set first thing. + * c-decl.c (init_decl_processing): Set lang_get_alias_set first thing. 2000-05-31 Richard Henderson diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c index 2cde31ab0871..e8e046db2e4c 100644 --- a/gcc/config/i960/i960.c +++ b/gcc/config/i960/i960.c @@ -1755,40 +1755,6 @@ i960_output_ret_insn (insn) return "ret"; } -#if 0 -/* Return a character string representing the branch prediction - opcode to be tacked on an instruction. This must at least - return a null string. */ - -const char * -i960_br_predict_opcode (lab_ref, insn) - rtx lab_ref, insn; -{ - if (TARGET_BRANCH_PREDICT) - { - unsigned long label_uid; - - if (GET_CODE (lab_ref) == CODE_LABEL) - label_uid = INSN_UID (lab_ref); - else if (GET_CODE (lab_ref) == LABEL_REF) - label_uid = INSN_UID (XEXP (lab_ref, 0)); - else - return ".f"; - - /* If not optimizing, then the insn_addresses array will not be - valid. In this case, always return ".t" since most branches - are taken. If optimizing, return .t for backward branches - and .f for forward branches. */ - if (! optimize - || insn_addresses[label_uid] < insn_addresses[INSN_UID (insn)]) - return ".t"; - return ".f"; - } - - return ""; -} -#endif - /* Print the operand represented by rtx X formatted by code CODE. */ void @@ -1797,7 +1763,7 @@ i960_print_operand (file, x, code) rtx x; int code; { - enum rtx_code rtxcode = GET_CODE (x); + enum rtx_code rtxcode = x ? GET_CODE (x) : NIL; if (rtxcode == REG) { @@ -1918,6 +1884,19 @@ i960_print_operand (file, x, code) else abort (); break; + case '+': + /* For conditional branches, substitute ".t" or ".f". */ + if (TARGET_BRANCH_PREDICT) + { + x = find_reg_note (current_output_insn, REG_BR_PROB, 0); + if (x) + { + int pred_val = INTVAL (XEXP (x, 0)); + fputs ((pred_val < REG_BR_PROB_BASE / 2 ? ".f" : ".t"), file); + } + } + break; + case 0: output_addr_const (file, x); break; @@ -2509,6 +2488,9 @@ i960_function_arg (cum, mode, type, named) rtx ret; int size, align; + if (mode == VOIDmode) + return 0; + i960_arg_size_and_align (mode, type, &size, &align); if (size > 4 || cum->ca_nstackparms != 0 @@ -2601,7 +2583,7 @@ i960_round_align (align, tsize) { int new_align; - if (TREE_CODE (tsize) != INTEGER_CST) + if (! tsize || TREE_CODE (tsize) != INTEGER_CST) return align; new_align = i960_object_bytes_bitalign (TREE_INT_CST_LOW (tsize) diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h index 10cc66560adc..cc12d45ad13c 100644 --- a/gcc/config/i960/i960.h +++ b/gcc/config/i960/i960.h @@ -1564,6 +1564,13 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1; #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ i960_print_operand_addr (FILE, ADDR) + +/* Determine which codes are valid without a following integer. These must + not be alphabetic (the characters are chosen so that + PRINT_OPERAND_PUNCT_VALID_P translates into a simple range change when + using ASCII). */ + +#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '+') /* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. */ diff --git a/gcc/config/i960/i960.md b/gcc/config/i960/i960.md index 38c14bae72a9..e42a894dffaf 100644 --- a/gcc/config/i960/i960.md +++ b/gcc/config/i960/i960.md @@ -171,7 +171,7 @@ (label_ref (match_operand 3 "" "")) (pc)))] "" - "bbs %2,%1,%l3" + "bbs%+ %2,%1,%l3" [(set_attr "type" "branch")]) (define_insn "" @@ -184,7 +184,7 @@ (label_ref (match_operand 3 "" "")) (pc)))] "" - "bbc %2,%1,%l3" + "bbc%+ %2,%1,%l3" [(set_attr "type" "branch")]) (define_insn "" @@ -197,7 +197,7 @@ (label_ref (match_operand 3 "" "")) (pc)))] "" - "bbs %2,%1,%l3" + "bbs%+ %2,%1,%l3" [(set_attr "type" "branch")]) (define_insn "" @@ -210,7 +210,7 @@ (label_ref (match_operand 3 "" "")) (pc)))] "" - "bbc %2,%1,%l3" + "bbc%+ %2,%1,%l3" [(set_attr "type" "branch")]) ;; ??? These will never match. The LOG_LINKs necessary to make these match @@ -483,7 +483,7 @@ (label_ref (match_operand 1 "" "")) (pc)))] "" - "b%C0 %l1" + "b%C0%+ %l1" [(set_attr "type" "branch")]) (define_insn "" @@ -493,7 +493,7 @@ (pc) (label_ref (match_operand 1 "" ""))))] "" - "b%I0 %l1" + "b%I0%+ %l1" [(set_attr "type" "branch")]) (define_insn "" @@ -503,7 +503,7 @@ (label_ref (match_operand 1 "" "")) (pc)))] "" - "b%C0 %l1" + "b%C0%+ %l1" [(set_attr "type" "branch")]) (define_insn "" @@ -513,7 +513,7 @@ (pc) (label_ref (match_operand 1 "" ""))))] "" - "b%I0 %l1" + "b%I0%+ %l1" [(set_attr "type" "branch")]) (define_insn "" @@ -525,7 +525,7 @@ (label_ref (match_operand 3 "" "")) (pc)))] "" - "cmp%S0%B0%R0 %2,%1,%l3" + "cmp%S0%B0%R0%+ %2,%1,%l3" [(set_attr "type" "branch")]) (define_insn "" @@ -537,7 +537,7 @@ (pc) (label_ref (match_operand 3 "" ""))))] "" - "cmp%S0%B0%X0 %2,%1,%l3" + "cmp%S0%B0%X0%+ %2,%1,%l3" [(set_attr "type" "branch")]) ;; Now the trap instructions. The i960 appears to only have conditional