public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] lower-subreg: Fix sparc bootstrap problem
@ 2007-08-10 16:08 Andreas Krebbel
  2007-08-10 17:09 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Krebbel @ 2007-08-10 16:08 UTC (permalink / raw)
  To: gcc-patches

Hello,

the attached patch fixes the problem with my decompose multiword shift
patch which was reported for sparc targets. Although s390 is a
WORDS_BIG_ENDIAN target as well this slipped through my tests since
s390 does not have an SI->DI zeroextend. So the split has already been
done by optab.

Bootstrapped on s390, s390x, i686 and x86_64. No regressions.

Andreas Tobler has tested the patch on sparc and verified that it
fixes bootstrap.

OK for mainline?

Bye,

-Andreas-

2007-08-10  Andreas Krebbel  <krebbel1@de.ibm.com>

	* lower-subreg.c (resolve_shift_zext): Don't adjust
	src_reg_num for wordmode operands.


Index: gcc/lower-subreg.c
===================================================================
*** gcc/lower-subreg.c.orig	2007-08-09 17:20:25.000000000 +0200
--- gcc/lower-subreg.c	2007-08-09 18:59:59.000000000 +0200
*************** resolve_shift_zext (rtx insn)
*** 1043,1053 ****
       endian machines this is register 0.  */
    src_reg_num = GET_CODE (op) == LSHIFTRT ? 1 : 0;
  
!   if (WORDS_BIG_ENDIAN)
      src_reg_num = 1 - src_reg_num;
  
    if (GET_CODE (op) == ZERO_EXTEND)
!     dest_reg_num = src_reg_num;
    else
      dest_reg_num = 1 - src_reg_num;
  
--- 1043,1054 ----
       endian machines this is register 0.  */
    src_reg_num = GET_CODE (op) == LSHIFTRT ? 1 : 0;
  
!   if (WORDS_BIG_ENDIAN
!       && GET_MODE_SIZE (GET_MODE (op_operand)) > UNITS_PER_WORD)
      src_reg_num = 1 - src_reg_num;
  
    if (GET_CODE (op) == ZERO_EXTEND)
!     dest_reg_num = WORDS_BIG_ENDIAN ? 1 : 0;
    else
      dest_reg_num = 1 - src_reg_num;
  

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] lower-subreg: Fix sparc bootstrap problem
  2007-08-10 16:08 [PATCH] lower-subreg: Fix sparc bootstrap problem Andreas Krebbel
@ 2007-08-10 17:09 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2007-08-10 17:09 UTC (permalink / raw)
  To: Andreas Krebbel; +Cc: gcc-patches

Andreas Krebbel <Andreas.Krebbel@de.ibm.com> writes:

> 2007-08-10  Andreas Krebbel  <krebbel1@de.ibm.com>
> 
> 	* lower-subreg.c (resolve_shift_zext): Don't adjust
> 	src_reg_num for wordmode operands.

This is OK.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-10 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-10 16:08 [PATCH] lower-subreg: Fix sparc bootstrap problem Andreas Krebbel
2007-08-10 17:09 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).