This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Committed] S/390: Fix popcount expanders
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Apr 2011 14:44:16 +0200
- Subject: [Committed] S/390: Fix popcount expanders
Hi,
the attached patch fixes a problem with the population count expanders
on s390. For operand 2 a scratch register is allocated in the
preparation code of the expander. Nevertheless there has been a
match_operand for operand 2. It should be just a match_dup instead.
Fixed with the attached patch.
Bootstrapped and regression tested on s390x.
Committed to 4.6 and mainline.
Bye,
-Andreas-
2011-04-15 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.md (popcountdi2, popcountsi2, popcounthi2):
Replace match_operand with match_dup for the third operand in
these expanders.
Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md.orig
--- gcc/config/s390/s390.md
***************
*** 9330,9336 ****
(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))
(clobber (reg:CC CC_REGNUM))])
; sllg op2, op0, 16
! (set (match_operand:DI 2 "register_operand" "")
(ashift:DI (match_dup 0) (const_int 16)))
; agr op0, op2
(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))
--- 9330,9336 ----
(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))
(clobber (reg:CC CC_REGNUM))])
; sllg op2, op0, 16
! (set (match_dup 2)
(ashift:DI (match_dup 0) (const_int 16)))
; agr op0, op2
(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))
***************
*** 9352,9358 ****
UNSPEC_POPCNT))
(clobber (reg:CC CC_REGNUM))])
; sllk op2, op0, 16
! (set (match_operand:SI 2 "register_operand" "")
(ashift:SI (match_dup 0) (const_int 16)))
; ar op0, op2
(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))
--- 9352,9358 ----
UNSPEC_POPCNT))
(clobber (reg:CC CC_REGNUM))])
; sllk op2, op0, 16
! (set (match_dup 2)
(ashift:SI (match_dup 0) (const_int 16)))
; ar op0, op2
(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))
***************
*** 9374,9380 ****
UNSPEC_POPCNT))
(clobber (reg:CC CC_REGNUM))])
; sllk op2, op0, 8
! (set (match_operand:SI 2 "register_operand" "")
(ashift:SI (match_dup 0) (const_int 8)))
; ar op0, op2
(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))
--- 9374,9380 ----
UNSPEC_POPCNT))
(clobber (reg:CC CC_REGNUM))])
; sllk op2, op0, 8
! (set (match_dup 2)
(ashift:SI (match_dup 0) (const_int 8)))
; ar op0, op2
(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))