Skip to content

Commit

Permalink
Fix implementation of iamax_sse.S as reported in OpenMathLib#2116.
Browse files Browse the repository at this point in the history
The was a typo in iamax_sse.S where one of the comparison
was cmpeqps instead of cmpeqss. That misdetected index
for sequences where the minimum value was 0.
  • Loading branch information
marxin committed Feb 13, 2020
1 parent 8a9e9a8 commit 01e00e7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions kernel/x86_64/KERNEL
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ IXAMAXKERNEL = izamax.S
endif

ifndef ISAMINKERNEL
ISAMINKERNEL = iamax.S
ISAMINKERNEL = iamax_sse.S
endif

ifndef IDAMINKERNEL
Expand Down Expand Up @@ -207,7 +207,7 @@ IQMAXKERNEL = iamax.S
endif

ifndef ISMINKERNEL
ISMINKERNEL = iamax.S
ISMINKERNEL = iamax_sse.S
endif

ifndef IDMINKERNEL
Expand Down
6 changes: 1 addition & 5 deletions kernel/x86_64/iamax_sse.S
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
/* or implied, of The University of Texas at Austin. */
/*********************************************************************/

/* This kernel was found to give wrong results when used for ISMIN/ISAMIN
with increment != 1, although it appears to be correct for corresponding
MAX operations. See issue 2116 */

#define ASSEMBLER
#include "common.h"

Expand Down Expand Up @@ -863,7 +859,7 @@
#ifdef USE_ABS
andps %xmm15, %xmm5
#endif
cmpeqps %xmm0, %xmm5
cmpeqss %xmm0, %xmm5

movss 0 * SIZE(X), %xmm6
addq INCX, X
Expand Down
1 change: 1 addition & 0 deletions utest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else ()
set(OpenBLAS_utest_src
utest_main.c
test_amax.c
test_asmin.c
test_rotmg.c
test_rot.c
test_axpy.c
Expand Down
2 changes: 1 addition & 1 deletion utest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ UTESTBIN=openblas_utest

include $(TOPDIR)/Makefile.system

OBJS=utest_main.o test_amax.o test_rotmg.o test_axpy.o test_dotu.o test_dsdot.o test_swap.o test_rot.o
OBJS=utest_main.o test_amax.o test_ismin.c test_rotmg.o test_axpy.o test_dotu.o test_dsdot.o test_swap.o test_rot.o
#test_rot.o test_swap.o test_axpy.o test_dotu.o test_dsdot.o test_fork.o

ifneq ($(NO_LAPACK), 1)
Expand Down

0 comments on commit 01e00e7

Please sign in to comment.