From 4f21cdf68864b022ccf2d9d118458efa5f954e50 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 14 Aug 2023 22:25:50 +0200 Subject: [PATCH] Add NaN tests --- kernel/mips/iamax.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/kernel/mips/iamax.c b/kernel/mips/iamax.c index fcc0b821e..4d62354e5 100644 --- a/kernel/mips/iamax.c +++ b/kernel/mips/iamax.c @@ -1,5 +1,5 @@ /*************************************************************************** -Copyright (c) 2016, The OpenBLAS Project +Copyright (c) 2013, The OpenBLAS Project All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -25,6 +25,15 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +/************************************************************************************** +* 2013/09/14 Saar +* BLASTEST float : NoTest +* BLASTEST double : NoTest +* CTEST : OK +* TEST : OK +* +**************************************************************************************/ + #include "common.h" #include @@ -47,13 +56,15 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) BLASLONG max=0; if (n <= 0 || inc_x <= 0) return(max); - + if (n==1) return(1); + if (x[0]!=x[0]) return(1); maxf=ABS(x[0]); ix += inc_x; i++; while(i < n) { + if (x[ix]!=x[ix]) return(i+1); if( ABS(x[ix]) > maxf ) { max = i;