Bug 8763 - generic vectors and altivec multiply
Summary: generic vectors and altivec multiply
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-11-29 19:06 UTC by Andrew Pinski
Modified: 2003-08-08 04:40 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2002-11-29 19:06:00 UTC
using generic vectors and multiply with altivec generates wrong code: temp1*temp+0.0f which it should be temp1*temp + -0.0f according to the Motorola's Altivec Technology Programming Environments manual.

Release:
gcc version 3.3 20021121 (experimental)

Environment:
powerpc-apple-darwin6.2

How-To-Repeat:
compile the following code with -maltivec -include altivec.h and see that it uses vmaddfp but with the fourth argument to vmaddfp is really (vector float){0.0f, 0.0f, 0.0f, 0.0f} where it should be (vector float){-0.0f, -0.0f, -0.0f, -0.0f}:
vector float temp;
vector float temp1;

void init()
{
        temp = temp1 * temp;
}
Comment 1 Andrew Pinski 2002-11-29 19:06:00 UTC
Fix:
change the (unspec:V4SF [(const_int 0)] 142) to (unspec:V4SF [(const_vector:V4SF [
        (const_int -2147483648) (const_int -2147483648)
        (const_int -2147483648) (const_int -2147483648)])] 142) in altivec.md:497 but this will cause a warning, another bug has been filed asking for a way in .md files to use hex numbers.
Comment 2 Andrew Pinski 2002-11-29 19:08:39 UTC
From: Andrew Pinski <pinskia@physics.uc.edu>
To: pinskia@physics.uc.edu
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: target/8763: generic vectors and altivec multiply
Date: Fri, 29 Nov 2002 19:08:39 -0800

 I forgot to say this is for IEEE-conforming result of -0.0 when the 
 result is -0.0.
 
 Thanks,
 Andrew Pinski
 
Comment 3 Aldy Hernandez 2002-12-23 14:11:25 UTC
State-Changed-From-To: open->closed
State-Changed-Why: i fixed it