OpenBLAS/kernel/zarch
Marius Hillenbrand 22aa81f3e5 s390x: fix cscal and zscal implementations
The implementation of complex scalar * vector multiplication for Z14
makes some LAPACK tests fail because the numerical differences to the
reference implementation exceed the threshold (as can be seen by running
make lapack-test and replacing kernel/zarch/cscal.c with a generic
implementation for comparison).

The complex multiplication uses terms of the form a * b + c * d for both
real and imaginary parts. The assembly code (and compiler-emitted code
as well) uses fused multiply add operations for the second product and
sum. The results can be "surprising", for example when both terms in the
imaginary part nearly cancel each other out. In that case, the second
product contributes more digits to the sum than the first product that
has been rounded before.

One option is to use separate multiplications (which then round the same
way) and a distinct add. Change the code to pursue that path, by (1)
requesting the compiler not to contract the operations into FMAs and (2)
replacing the assembly kernel with corresponding vectorized C code
(where change 1 also applies).

Signed-off-by: Marius Hillenbrand <mhillen@linux.ibm.com>
2020-09-21 13:10:05 +02:00
..
KERNEL Init IBM z system (s390x) porting. 2016-04-15 18:02:24 -04:00
KERNEL.Z13 add in runtime cpu detection for zarch (#2349) 2019-12-31 18:03:27 +01:00
KERNEL.Z14 s390x: Use new sgemm kernel also for DGEMM and DTRMM on Z14 2020-05-20 10:23:35 +02:00
KERNEL.ZARCH_GENERIC add in runtime cpu detection for zarch (#2349) 2019-12-31 18:03:27 +01:00
Makefile Init IBM z system (s390x) porting. 2016-04-15 18:02:24 -04:00
camax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
camin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
casum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
caxpy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ccopy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
cdot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
cgemv_n_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
cgemv_t_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ckernelMacrosV.S strmm and ctrmm 2017-03-13 01:23:16 +04:00
crot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
cscal.c s390x: fix cscal and zscal implementations 2020-09-21 13:10:05 +02:00
csum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
cswap.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ctrmm4x4V.S s390x: use "lghi" for immediate values to fix build with clang 2020-09-02 13:49:30 +02:00
damax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
damax_z13.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
damin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
damin_z13.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dasum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
daxpy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dcopy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ddot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dgemv_n_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dgemv_t_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dmax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dmax_z13.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dmin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dmin_z13.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
drot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dscal.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dsdot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dsum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
dswap.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
gemm8x4V.S s390x: use "lghi" for immediate values to fix build with clang 2020-09-02 13:49:30 +02:00
gemm_vec.c s390x: move common vector definitions and utils into header 2020-09-21 11:32:08 +02:00
icamax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
icamin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
idamax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
idamin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
idmax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
idmin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
isamax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
isamin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ismax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ismin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
izamax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
izamin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
kernelMacros.S ztrmm kernel. 2017-02-26 06:14:12 +04:00
samax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
samin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
sasum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
saxpy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
scopy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
sdot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
sgemv_n_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
sgemv_t_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
skernelMacros.S strmm and ctrmm 2017-03-13 01:23:16 +04:00
smax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
smin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
srot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
sscal.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ssum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
sswap.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
strmm8x4V.S s390x: use "lghi" for immediate values to fix build with clang 2020-09-02 13:49:30 +02:00
trmm8x4V.S changed to conventional register save area 2017-03-01 03:13:21 +04:00
vector-common.h s390x: move common vector definitions and utils into header 2020-09-21 11:32:08 +02:00
zamax.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zamax_z13.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zamin.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zamin_z13.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zasum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zaxpy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zcopy.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zdot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zgemv_n_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zgemv_t_4.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zkernelMacrosV.S ztrmm kernel. 2017-02-26 06:14:12 +04:00
zrot.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zscal.c s390x: fix cscal and zscal implementations 2020-09-21 13:10:05 +02:00
zsum.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
zswap.c s390x: avoid variable-length arrays in struct for asm operands 2020-09-02 13:49:31 +02:00
ztrmm4x4V.S s390x: use "lghi" for immediate values to fix build with clang 2020-09-02 13:49:30 +02:00