public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: other/8551: altivec vec_cmplt generates wrong instruction
@ 2002-12-19 11:49 aldyh
  0 siblings, 0 replies; 2+ messages in thread
From: aldyh @ 2002-12-19 11:49 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, hartwood, nobody

Synopsis: altivec vec_cmplt generates wrong instruction

State-Changed-From-To: open->closed
State-Changed-By: aldyh
State-Changed-When: Thu Dec 19 11:49:25 2002
State-Changed-Why:
    fixed by:
    http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00988.html

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


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

* other/8551: altivec vec_cmplt generates wrong instruction
@ 2002-11-19 18:05 hartwood
  0 siblings, 0 replies; 2+ messages in thread
From: hartwood @ 2002-11-19 18:05 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8551
>Category:       other
>Synopsis:       altivec vec_cmplt generates wrong instruction
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 12 11:26:17 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Rick Cellucci
>Release:        gcc version 3.3 20021104 (experimental)
>Organization:
>Environment:
Configured with: ../gcc3.3/configure --prefix=/usr/local/darwin --enable-altivec --enable-languages=c --with-cpu=7400 --target=powerpc-apple-darwin6.1
>Description:
Both vec_cmplt and vec_cmpgt generate the same vcmpgtfp instruction. vec_cmplt should generate vcmpgtfp and switch the second and third arguments, which is not happening. Occurs at any optimization level. I assume short and int versions may be broken as well, I only have tested vector floats.
>How-To-Repeat:
void VecCmpltIsBroken (void)
{
	vector float zero    = (vector float) {0.0, 0.0, 0.0, 0.0};
	vector float smaller = (vector float) {1.0, 2.0, 3.0, 4.0};
	vector float bigger  = (vector float) {5.0, 6.0, 7.0, 8.0};
	vector bool int cmp;
			
	cmp = vec_cmplt (bigger, smaller);
	bigger = vec_sel (bigger, zero, cmp);
	PrintFloatVector (bigger); printf ("\n");

	cmp = vec_cmpgt (bigger, smaller);
	bigger = vec_sel (bigger, zero, cmp);
	PrintFloatVector (bigger); printf ("\n");
}


    lvx v31,0,r9
    vcmpgtfp v0,v31,v29
    vxor v30,v30,v30
    vsel v31,v31,v30,v0
    vor v2,v31,v31 
    bl L_PrintFloatVector$stub
    li r3,10       
    bl L_putchar$stub
    vcmpgtfp v0,v31,v29
>Fix:
Workaround: Only use vec_cmpgt and switch arguments order in C.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-12-19 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-19 11:49 other/8551: altivec vec_cmplt generates wrong instruction aldyh
  -- strict thread matches above, loose matches on Subject: below --
2002-11-19 18:05 hartwood

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