From: Richard Henderson Date: Wed, 1 Oct 1997 05:04:30 +0000 (-0700) Subject: alpha.md (beq): For registers and ints 0-255... X-Git-Tag: releases/egcs-1.0.0~419 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9d0757e5c8dd2f3a9c8645290450d5bce90c9b6;p=thirdparty%2Fgcc.git alpha.md (beq): For registers and ints 0-255... * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne, since that pair will dual-issue on the 21164 and plus+beq won't. (bne): Likewise for cmpeq+beq. From-SVN: r15814 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c781c8596235..0d6a89107224 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 30 23:06:43 1997 Richard Henderson + + * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne, since + that pair will dual-issue on the 21164 and plus+beq won't. + (bne): Likewise for cmpeq+beq. + Tue Sep 30 16:07:58 1997 Jim Wilson * except.c (find_exception_handler_labels): Correct argument to free. diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index d718481642c2..a5f31a37dfe0 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -2478,16 +2478,23 @@ " { enum machine_mode mode; - enum rtx_code compare_code, branch_code; + enum rtx_code compare_code = EQ, branch_code = NE; if (alpha_compare_fp_p) - mode = DFmode, compare_code = EQ, branch_code = NE; + mode = DFmode; else { - mode = DImode, compare_code = MINUS, branch_code = EQ; - if (GET_CODE (alpha_compare_op1) == CONST_INT) + mode = DImode; + /* We want to use cmpeq/bne when we can, since there is a zero-delay + bypass between logicals and br/cmov on the 21164. But we don't + want to force valid immediate constants into registers needlessly. */ + if (GET_CODE (alpha_compare_op1) == CONST_INT + && ((INTVAL (alpha_compare_op1) >= -0x8000 + && INTVAL (alpha_compare_op1) < 0) + || (INTVAL (alpha_compare_op1) > 0xff + && INTVAL (alpha_compare_op1) < 0x8000))) { - compare_code = PLUS; + compare_code = PLUS, branch_code = EQ; alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1)); } } @@ -2509,16 +2516,23 @@ " { enum machine_mode mode; - enum rtx_code compare_code, branch_code; + enum rtx_code compare_code = EQ, branch_code = EQ; if (alpha_compare_fp_p) - mode = DFmode, compare_code = EQ, branch_code = EQ; + mode = DFmode; else { - mode = DImode, compare_code = MINUS, branch_code = NE; - if (GET_CODE (alpha_compare_op1) == CONST_INT) + mode = DImode; + /* We want to use cmpeq/bne when we can, since there is a zero-delay + bypass between logicals and br/cmov on the 21164. But we don't + want to force valid immediate constants into registers needlessly. */ + if (GET_CODE (alpha_compare_op1) == CONST_INT + && ((INTVAL (alpha_compare_op1) >= -0x8000 + && INTVAL (alpha_compare_op1) < 0) + || (INTVAL (alpha_compare_op1) > 0xff + && INTVAL (alpha_compare_op1) < 0x8000))) { - compare_code = PLUS; + compare_code = PLUS, branch_code = NE; alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1)); } }