From e99172f220aa963aaa0fd1e0f07819249cb98a93 Mon Sep 17 00:00:00 2001 From: kenner Date: Sun, 24 Feb 2002 12:46:52 +0000 Subject: [PATCH] * optabs.c (widen_operand): Only call convert_modes for promoted SUBREG if signedness matches. * config/alpha/alpha.md (*addsi_se2, *subsi_se2): New patterns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50004 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/alpha/alpha.md | 20 ++++++++++++++++++++ gcc/optabs.c | 3 ++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92381ee..3280349 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Sun Feb 24 07:41:31 2002 Richard Kenner + + * optabs.c (widen_operand): Only call convert_modes for + promoted SUBREG if signedness matches. + * config/alpha/alpha.md (*addsi_se2, *subsi_se2): New patterns. + 2002-02-23 Neil Booth * cpplib.c (glue_header_name): Use local buffer to build up diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 06c272b..fbbac9e 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -564,6 +564,17 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi" addl %r1,%2,%0 subl %r1,%n2,%0") +(define_insn "*addsi_se2" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (sign_extend:DI + (subreg:SI (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") + (match_operand:DI 2 "sext_add_operand" "rI,O")) + 0)))] + "" + "@ + addl %r1,%2,%0 + subl %r1,%n2,%0") + (define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI @@ -844,6 +855,15 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi" "" "subl %r1,%2,%0") +(define_insn "*subsi_se2" + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI + (subreg:SI (minus:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") + (match_operand:DI 2 "reg_or_8bit_operand" "rI")) + 0)))] + "" + "subl %r1,%2,%0") + (define_insn "subvsi3" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") diff --git a/gcc/optabs.c b/gcc/optabs.c index 2a2ebb3..69fb999 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -191,7 +191,8 @@ widen_operand (op, mode, oldmode, unsignedp, no_extend) do so. */ if (! no_extend || GET_MODE (op) == VOIDmode - || (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op))) + || (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op) + && SUBREG_PROMOTED_UNSIGNED_P (op) == unsignedp)) return convert_modes (mode, oldmode, op, unsignedp); /* If MODE is no wider than a single word, we return a paradoxical -- 2.7.4