Refs #929. Deal with zero and NaNs for scale.

This commit is contained in:
Zhang Xianyi 2016-08-18 10:24:42 -07:00
parent 9ea0144482
commit ae70b916f4
2 changed files with 18 additions and 1 deletions

View File

@ -137,7 +137,7 @@ DROTKERNEL = drot.c
#
SSCALKERNEL = sscal.c
DSCALKERNEL = dscal.c
#CSCALKERNEL = ../arm/zscal.c
CSCALKERNEL = zscal.c
ZSCALKERNEL = zscal.c
#
SSWAPKERNEL = sswap.c

View File

@ -39,8 +39,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma GCC optimize "O1"
#if defined(POWER8)
#if defined(DOUBLE)
#include "zscal_microk_power8.c"
#endif
#endif
#ifndef HAVE_KERNEL_8
@ -123,6 +125,21 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
if ( inc_x <= 0 )
return(0);
if (da_r == ZERO && da_i == ZERO) {
//clear the vector and return
if (inc_x == 1) {
memset(x, 0, n*COMPSIZE*SIZE);
}else{
inc_x2 = 2 * inc_x;
for(i=0; i<n; i++){
x[ip]=ZERO;
x[ip+1]=ZERO;
ip += inc_x2;
}
}
return 0;
}
if ( inc_x == 1 )
{