public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: target/10177: VRsave mask wrong
@ 2003-03-27 19:59 dje
  0 siblings, 0 replies; 5+ messages in thread
From: dje @ 2003-03-27 19:59 UTC (permalink / raw)
  To: aldyh, aldyh, gcc-bugs, gcc-prs, kkhoo, nobody, pinskia, spatel

Synopsis: VRsave mask wrong

Responsible-Changed-From-To: unassigned->aldyh
Responsible-Changed-By: dje
Responsible-Changed-When: Thu Mar 27 19:59:42 2003
Responsible-Changed-Why:
    Altivec
State-Changed-From-To: open->analyzed
State-Changed-By: dje
State-Changed-When: Thu Mar 27 19:59:42 2003
State-Changed-Why:
    patch waiting for approval

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10177


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

* Re: target/10177: VRsave mask wrong
@ 2003-03-31 20:06 dje
  0 siblings, 0 replies; 5+ messages in thread
From: dje @ 2003-03-31 20:06 UTC (permalink / raw)
  To: aldyh, aldyh, gcc-bugs, gcc-prs, kkhoo, pinskia, spatel

Synopsis: VRsave mask wrong

State-Changed-From-To: analyzed->closed
State-Changed-By: dje
State-Changed-When: Mon Mar 31 19:55:07 2003
State-Changed-Why:
    patch applied

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10177


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

* Re: target/10177: VRsave mask wrong
@ 2003-03-31 18:13 Aldy Hernandez
  0 siblings, 0 replies; 5+ messages in thread
From: Aldy Hernandez @ 2003-03-31 18:13 UTC (permalink / raw)
  To: aldyh; +Cc: gcc-prs

The following reply was made to PR target/10177; it has been noted by GNATS.

From: Aldy Hernandez <aldyh@redhat.com>
To: Segher Boessenkool <segher@koffie.nl>
Cc: pinskia@physics.uc.edu, gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
   spatel@apple.com, kkhoo@apple.com
Subject: Re: target/10177: VRsave mask wrong
Date: Mon, 31 Mar 2003 13:47:56 -0400

 On Friday, March 21, 2003, at 11:17  PM, Segher Boessenkool wrote:
 
 > Fixed thusly.  Tested on powerpc-unknown-linux-gnu.
 >
 > It *might* make regrename less effective for AltiVec
 > registers, but I don't think so, especially given that
 > most AltiVec code is written very assembler-like anyway.
 >
 > If okay, please apply.
 >
 
 Approved and committed.  Thank you.
 
 Could you please close the PR?
 


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

* Re: target/10177: VRsave mask wrong
@ 2003-03-22  3:26 Segher Boessenkool
  0 siblings, 0 replies; 5+ messages in thread
From: Segher Boessenkool @ 2003-03-22  3:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/10177; it has been noted by GNATS.

From: Segher Boessenkool <segher@koffie.nl>
To: pinskia@physics.uc.edu, gcc-patches@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org, spatel@apple.com, aldyh@redhat.com,
	kkhoo@apple.com
Subject: Re: target/10177: VRsave mask wrong
Date: Sat, 22 Mar 2003 04:17:46 +0100

 Fixed thusly.  Tested on powerpc-unknown-linux-gnu.
 
 It *might* make regrename less effective for AltiVec
 registers, but I don't think so, especially given that
 most AltiVec code is written very assembler-like anyway.
 
 If okay, please apply.
 
 
 Segher
 
 
 
 2002-03-22  Segher Boessenkool  <segher@koffie.nl>
 
 	PR target/10177
 	* config/rs6000/rs6000.h (HARD_REGNO_RENAME_OK): New.
 	* config/rs6000/rs6000.c (compute_vrsave_mask): Don't mark
 	all call-clobbered registers as used.
 
 
 *** config/rs6000/rs6000.c~~	Sat Mar 22 02:25:14 2003
 --- config/rs6000/rs6000.c	Sat Mar 22 03:07:37 2003
 *************** compute_vrsave_mask ()
 *** 8916,8934 ****
      if (mask == 0)
        return mask;
 
 -   /* Next, add all registers that are call-clobbered.  We do this
 -      because post-reload register optimizers such as regrename_optimize
 -      may choose to use them.  They never change the register class
 -      chosen by reload, so cannot create new uses of altivec registers
 -      if there were none before, so the early exit above is safe.  */
 -   /* ??? Alternately, we could define HARD_REGNO_RENAME_OK to disallow
 -      altivec registers not saved in the mask, which might well make the
 -      adjustments below more effective in eliding the save/restore of
 -      VRSAVE in small functions.  */
 -   for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i)
 -     if (call_used_regs[i])
 -       mask |= ALTIVEC_REG_BIT (i);
 -
      /* Next, remove the argument registers from the set.  These must
         be in the VRSAVE mask set by the caller, so we don't need to add
         them in again.  More importantly, the mask we compute here is
 --- 8916,8921 ----
 *** config/rs6000/rs6000.h~~	Sat Mar 22 02:19:26 2003
 --- config/rs6000/rs6000.h	Sat Mar 22 02:37:18 2003
 *************** extern int rs6000_default_long_calls;
 *** 948,953 ****
 --- 948,959 ----
       ? ALTIVEC_VECTOR_MODE (MODE1)		\
       : 1)
 
 + /* Post-reload, we can't use any new AltiVec registers, as we already
 +    emitted the vrsave mask.  */
 +
 + #define HARD_REGNO_RENAME_OK(SRC, DST) \
 +   (! ALTIVEC_REGNO_P (DST) || regs_ever_live[DST])
 +
    /* A C expression returning the cost of moving data from a register of class
       CLASS1 to one of CLASS2.  */
 
 
 


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

* target/10177: VRsave mask wrong
@ 2003-03-21  2:16 pinskia
  0 siblings, 0 replies; 5+ messages in thread
From: pinskia @ 2003-03-21  2:16 UTC (permalink / raw)
  To: gcc-gnats; +Cc: spatel, aldyh, kkhoo


>Number:         10177
>Category:       target
>Synopsis:       VRsave mask wrong
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 21 02:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Pinski
>Release:        gcc version 3.4 20030320 (experimental)
>Organization:
>Environment:
powerpc-apple-darwin6.4
>Description:
The VRsave mask generated for the attached code should 0x80000000 (register v0 is the only vector register used).
int f(int a, int b) {
        if (a<b) {
                vector signed int v1;
                vec_ste(v1, 0, &a);
                return a;
        }
        else {
                return a;
        }
}

instead I get this:
_f:
        mfspr   r5,VRsave
        oris    r2,r5,0xdfff
        stw     r5,0xfff8(r1)
        ori     r0,r2,0xf000
        mtspr   VRsave,r0
        cmpw    r3,r4
        or      r0,r3,r3
        stw     r3,0x18(r1)
        bge     0x34
        li      r4,0x0
        addi    r3,r1,0x18
        stvewx  v0,r4,r3
        lwz     r0,0x18(r1)
        or      r3,r0,r0
        lwz     r6,0xfff8(r1)
        mtspr   VRsave,r6
        blr
>How-To-Repeat:
gcc -O3 -maltivec test.c -include altivec.h -c -Wa,-force_cpusubtype_ALL -v
>Fix:
Do not know.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"

aW50IGYoaW50IGEsIGludCBiKSB7CiAgICAgICAgaWYgKGE8YikgewogICAgICAgICAgICAgICAg
dmVjdG9yIHNpZ25lZCBpbnQgdjE7CiAgICAgICAgICAgICAgICB2ZWNfc3RlKHYxLCAwLCAmYSk7
CiAgICAgICAgICAgICAgICByZXR1cm4gYTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAg
ICAgICAgICAgICByZXR1cm4gYTsKICAgICAgICB9Cn0K


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

end of thread, other threads:[~2003-03-31 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-27 19:59 target/10177: VRsave mask wrong dje
  -- strict thread matches above, loose matches on Subject: below --
2003-03-31 20:06 dje
2003-03-31 18:13 Aldy Hernandez
2003-03-22  3:26 Segher Boessenkool
2003-03-21  2:16 pinskia

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).