optabs.c (widen_operand): Only call convert_modes for promoted SUBREG if signedness...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Sun, 24 Feb 2002 12:46:52 +0000 (12:46 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 24 Feb 2002 12:46:52 +0000 (07:46 -0500)
* optabs.c (widen_operand): Only call convert_modes for
promoted SUBREG if signedness matches.
* config/alpha/alpha.md (*addsi_se2, *subsi_se2): New patterns.

From-SVN: r50004

gcc/ChangeLog
gcc/config/alpha/alpha.md
gcc/optabs.c

index 92381ee95433c88d96c9b350671400c3ebc20ae9..3280349b6ec90ba118cb81f1fa4700a7bd4ff4a3 100644 (file)
@@ -1,3 +1,9 @@
+Sun Feb 24 07:41:31 2002  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * 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  <neil@daikokuya.demon.co.uk>
 
        * cpplib.c (glue_header_name): Use local buffer to build up
index 06c272b6890e607af4e8972a93a2416cb4d2279b..fbbac9eac7af915e1b52d40a1baa5d000d96101c 100644 (file)
@@ -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")
index 2a2ebb3a8dfb579dc3fcfccb37d00e3f7866393f..69fb999a7de1e1bec637429363f4262ec9e86173 100644 (file)
@@ -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