[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-08-14 Thread uros at gcc dot gnu dot org


--- Comment #10 from uros at gcc dot gnu dot org  2009-08-14 07:41 ---
Subject: Bug 8603

Author: uros
Date: Fri Aug 14 07:41:17 2009
New Revision: 150735

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=150735
Log:
Backport from mainline:
2009-08-11  Uros Bizjak  ubiz...@gmail.com

PR target/8603
* config/alpha/alpha.md (addsi3): Remove expander.
(addsi3): Rename from *addsi3_internal insn pattern.
(subsi3): Remove expander.
(subsi3): Rename from *subsi3_internal insn pattern.


Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/config/alpha/alpha.md


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-08-14 Thread ubizjak at gmail dot com


--- Comment #11 from ubizjak at gmail dot com  2009-08-14 08:11 ---
Fixed.


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to fail|4.3.0   |4.3.4 4.4.1
  Known to work|4.5.0   |4.3.5 4.4.2 4.5.0
 Resolution||FIXED
   Target Milestone|--- |4.3.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-08-13 Thread uros at gcc dot gnu dot org


--- Comment #9 from uros at gcc dot gnu dot org  2009-08-13 18:57 ---
Subject: Bug 8603

Author: uros
Date: Thu Aug 13 18:57:15 2009
New Revision: 150723

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=150723
Log:
PR target/8603
* config/alpha/alpha.md (addsi3): Remove expander.
(addsi3): Rename from *addsi3_internal insn pattern.
(subsi3): Remove expander.
(subsi3): Rename from *subsi3_internal insn pattern.


Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/alpha/alpha.md


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-08-11 Thread ubizjak at gmail dot com


--- Comment #7 from ubizjak at gmail dot com  2009-08-11 06:46 ---
(In reply to comment #6)

 Please add to gcc-4.3.x and gcc-4.4.x.

OK, I will post the patch, thanks for the analysis.


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 AssignedTo|rask at gcc dot gnu dot org |ubizjak at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-08-11 Thread uros at gcc dot gnu dot org


--- Comment #8 from uros at gcc dot gnu dot org  2009-08-11 17:06 ---
Subject: Bug 8603

Author: uros
Date: Tue Aug 11 17:05:38 2009
New Revision: 150654

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=150654
Log:
PR target/8603
* config/alpha/alpha.md (addsi3): Remove expander.
(addsi3): Rename from *addsi3_internal insn pattern.
(subsi3): Remove expander.
(subsi3): Rename from *subsi3_internal insn pattern.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/alpha/alpha.md


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-08-10 Thread mattst88 at gmail dot com


--- Comment #6 from mattst88 at gmail dot com  2009-08-11 02:38 ---
To show how worthwhile this trivial patch is -- the following table shows the
number of times s{4,8}{add,sub}l are used in building the Linux kernel
(2.6.31-rc5) with unpatched and patched gcc (4.3.4).

unpatched   patched
s4addl  53  395
s8addl  79  132
s4subl  0   111
s8subl  0   35

This patch also causes gcc to produce exactly the same output as Compaq's C
compiler (this is a good thing!) for the two test cases given in the report.

For example --
Test case:
UP1500 gcc-tests # cat s_addl.c 
int f(int x, int y) { return 4 * x + y; }
int g(int x) { return 3 * x; }

Results with unpatched gcc-4.3.x

UP1500 gcc-tests # gcc-unpatched -O3 -mcpu=ev67 -c s_addl.c 
UP1500 gcc-tests # objdump -d s_addl.o 

s_addl.o: file format elf64-alpha

Disassembly of section .text:

 f:
   0:   40 04 11 42 s4addq  a0,a1,v0
   4:   00 00 e0 43 sextl   v0,v0 -- unnecessary
   8:   01 80 fa 6b ret
   c:   00 00 fe 2f unop

0010 g:
  10:   60 05 10 42 s4subq  a0,a0,v0
  14:   00 00 e0 43 sextl   v0,v0 -- unnecessary
  18:   01 80 fa 6b ret
  1c:   00 00 fe 2f unop

Results with patched gcc-4.3.x

UP1500 gcc-tests # gcc-patched -O3 -mcpu=ev67 -c s_addl.c 
UP1500 gcc-tests # objdump -d s_addl.o 

s_addl.o: file format elf64-alpha

Disassembly of section .text:

 f:
   0:   40 00 11 42 s4addl  a0,a1,v0
   4:   01 80 fa 6b ret
   8:   1f 04 ff 47 nop
   c:   00 00 fe 2f unop

0010 g:
  10:   60 01 10 42 s4subl  a0,a0,v0
  14:   01 80 fa 6b ret
  18:   1f 04 ff 47 nop
  1c:   00 00 fe 2f unop

Results with Compaq C compiler (what we're trying to replicate)

UP1500 gcc-tests # ccc -fast -host -c s_addl.c 
UP1500 gcc-tests # objdump -d s_addl.o 

s_addl.o: file format elf64-alpha

Disassembly of section .text:

 f:
   0:   40 00 11 42 s4addl  a0,a1,v0
   4:   01 80 fa 6b ret
   8:   00 00 fe 2f unop
   c:   00 00 fe 2f unop

0010 g:
  10:   60 01 10 42 s4subl  a0,a0,v0
  14:   01 80 fa 6b ret


Please add to gcc-4.3.x and gcc-4.4.x.


-- 

mattst88 at gmail dot com changed:

   What|Removed |Added

 CC||mattst88 at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2009-01-07 Thread ubizjak at gmail dot com


--- Comment #5 from ubizjak at gmail dot com  2009-01-07 17:56 ---
Following patch that changes addsi3 and subsi3 expander constraint fixes this
problem:

--cut here--
Index: alpha.md
===
--- alpha.md(revision 143157)
+++ alpha.md(working copy)
@@ -261,7 +261,7 @@
   [(set (match_operand:SI 0 register_operand )
(plus:SI (match_operand:SI 1 reg_or_0_operand )
 (match_operand:SI 2 add_operand )))]
-  ! optimize
+  
   )

 (define_insn *addsi_internal
@@ -622,7 +622,7 @@
   [(set (match_operand:SI 0 register_operand )
(minus:SI (match_operand:SI 1 reg_or_0_operand )
  (match_operand:SI 2 reg_or_8bit_operand )))]
-  ! optimize
+  
   )

 (define_insn *subsi_internal
--cut here--

With the patch (gcc -O2):

f:
s4addl $16,$17,$0
ret $31,($26),1

g:
s4subl $16,$16,$0
ret $31,($26),1

This regression was introduced by:

Sat Feb 23 08:42:47 2002  Richard Kenner  ken...@vlsi1.ultra.nyu.edu

* expr.c (store_expr): When converting expression to promoted
equivalent type, allow using SUBREG_REG of TARGET as the target
of the expansion of EXP.
* loop.c (basic_induction_var, case SUBREG): Always look inside.
* config/alpha/alpha.c (rtx_equiv_function_matters): Delete decl.
(alpha_emit_set_const): Handle SImode when can't make new pseudos.
(alpha_emit_set_const_1, alpha_sa_mask): Use no_new_pseudos.
* config/alpha/alpha.md (addsi3, subsi3): Don't use if optimizing.

And the comment above addsi3 says:

;; Don't say we have addsi3 if optimizing.  This generates better code.  We
;; have the anonymous addsi3 pattern below in case combine wants to make it.

So, is this still true? Can somebody benchmark this patch? We can perhaps look
at csibe numbers.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603



[Bug target/8603] [Alpha] s?addl pattern doesn't work

2007-11-14 Thread rask at gcc dot gnu dot org


--- Comment #4 from rask at gcc dot gnu dot org  2007-11-14 19:10 ---
For f(), combine wants a pattern to match

(set (reg:DI 76)
(sign_extend:DI (subreg:SI (plus:DI (subreg:DI (mult:SI (reg:SI 16 $16 [ x
])
(const_int 4 [0x4])) 0)
(reg:DI 17 $17 [ y ])) 0)))

but the closest one is

(define_insn *saddl_se
  [(set (match_operand:DI 0 register_operand =r,r)
(sign_extend:DI
 (plus:SI (mult:SI (match_operand:SI 1 reg_not_elim_operand r,r)
   (match_operand:SI 2 const48_operand I,I))
  (match_operand:SI 3 sext_add_operand rI,O]

and similarily for g() where the *ssubl_se pattern doesn't match.

I wonder where the (subreg:DI (mult:SI ...)) part comes from. That can't be
right.


-- 

rask at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rask at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
  Known to fail||4.3.0
   Last reconfirmed|2005-09-07 17:37:27 |2007-11-14 19:10:09
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8603