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; }
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.
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
State-Changed-From-To: open->closed State-Changed-Why: i fixed it