You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

zgemm_kernel_power3.S 26 kB

rebase? (#1) * With the Intel compiler on Linux, prefer ifort for the final link step icc has known problems with mixed-language builds that ifort can handle just fine. Fixes #1956 * Rename operands to put lda on the input/output constraint list * Fix wrong constraints in inline assembly for #2009 * Fix inline assembly constraints rework indices to allow marking argument lda4 as input and output. For #2009 * Fix inline assembly constraints rework indices to allow marking argument lda as input and output. * Fix inline assembly constraints * Fix inline assembly constraints * Fix inline assembly constraints in Bulldozer TRSM kernels rework indices to allow marking i,as and bs as both input and output (marked operand n1 as well for simplicity). For #2009 * Correct range_n limiting same bug as seen in #1388, somehow missed in corresponding PR #1389 * Allow multithreading TRMV again revert workaround introduced for issue #1332 as the actual cause appears to be my incorrect fix from #1262 (see #1388) * Fix error introduced during cleanup * Reduce list of kernels in the dynamic arch build to make compilation complete reliably within the 1h limit again * init * move fix to right place * Fix missing -c option in AVX512 test * Fix AVX512 test always returning false due to missing compiler option * Make x86_32 imply NO_AVX2, NO_AVX512 in addition to NO_AVX fixes #2033 * Keep xcode8.3 for osx BINARY=32 build as xcode10 deprecated i386 * Make sure that AVX512 is disabled in 32bit builds for #2033 * Improve handling of NO_STATIC and NO_SHARED to avoid surprises from defining either as zero. Fixes #2035 by addressing some concerns from #1422 * init * address warning introed with #1814 et al * Restore locking optimizations for OpenMP case restore another accidentally dropped part of #1468 that was missed in #2004 to address performance regression reported in #1461 * HiSilicon tsv110 CPUs optimization branch add HiSilicon tsv110 CPUs optimization branch * add TARGET support for HiSilicon tsv110 CPUs * add TARGET support for HiSilicon tsv110 CPUs * add TARGET support for HiSilicon tsv110 CPUs * Fix module definition conflicts between LAPACK and ReLAPACK for #2043 * Do not compile in AVX512 check if AVX support is disabled xgetbv is function depends on NO_AVX being undefined - we could change that too, but that combo is unlikely to work anyway * ctest.c : add __POWERPC__ for PowerMac * Fix crash in sgemm SSE/nano kernel on x86_64 Fix bug #2047. Signed-off-by: Celelibi <celelibi@gmail.com> * param.h : enable defines for PPC970 on DarwinOS fixes: gemm.c: In function 'sgemm_': ../common_param.h:981:18: error: 'SGEMM_DEFAULT_P' undeclared (first use in this function) #define SGEMM_P SGEMM_DEFAULT_P ^ * common_power.h: force DCBT_ARG 0 on PPC970 Darwin without this, we see ../kernel/power/gemv_n.S:427:Parameter syntax error and many more similar entries that relates to this assembly command dcbt 8, r24, r18 this change makes the DCBT_ARG = 0 and openblas builds through to completion on PowerMac 970 Tests pass * Make TARGET=GENERIC compatible with DYNAMIC_ARCH=1 for issue #2048 * make DYNAMIC_ARCH=1 package work on TSV110. * make DYNAMIC_ARCH=1 package work on TSV110 * Add Intel Denverton for #2048 * Add Intel Denverton * Change 64-bit detection as explained in #2056 * Trivial typo fix as suggested in #2022 * Disable the AVX512 DGEMM kernel (again) Due to as yet unresolved errors seen in #1955 and #2029 * Use POSIX getenv on Cygwin The Windows-native GetEnvironmentVariable cannot be relied on, as Cygwin does not always copy environment variables set through Cygwin to the Windows environment block, particularly after fork(). * Fix for #2063: The DllMain used in Cygwin did not run the thread memory pool cleanup upon THREAD_DETACH which is needed when compiled with USE_TLS=1. * Also call CloseHandle on each thread, as well as on the event so as to not leak thread handles. * AIX asm syntax changes needed for shared object creation * power9 makefile. dgemm based on power8 kernel with following changes : 32x unrolled 16x4 kernel and 8x4 kernel using (lxv stxv butterfly rank1 update). improvement from 17 to 22-23gflops. dtrmm cases were added into dgemm itself * Expose CBLAS interfaces for I?MIN and I?MAX * Build CBLAS interfaces for I?MIN and I?MAX * Add declarations for ?sum and cblas_?sum * Add interface for ?sum (derived from ?asum) * Add ?sum * Add implementations of ssum/dsum and csum/zsum as trivial copies of asum/zsasum with the fabs calls replaced by fmov to preserve code structure * Add ARM implementations of ?sum (trivial copies of the respective ?asum with the fabs calls removed) * Add ARM64 implementations of ?sum as trivial copies of the respective ?asum kernels with the fabs calls removed * Add ia64 implementation of ?sum as trivial copy of asum with the fabs calls removed * Add MIPS implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add MIPS64 implementation of ?sum as trivial copy of ?asum with the fabs replaced by mov to preserve code structure * Add POWER implementation of ?sum as trivial copy of ?asum with the fabs replaced by fmr to preserve code structure * Add SPARC implementation of ?sum as trivial copy of ?asum with the fabs replaced by fmov to preserve code structure * Add x86 implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add x86_64 implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add ZARCH implementation of ?sum as trivial copies of the respective ?asum kernels with the ABS and vflpsb calls removed * Detect 32bit environment on 64bit ARM hardware for #2056, using same approach as #2058 * Add cmake defaults for ?sum kernels * Add ?sum * Add ?sum definitions for generic kernel * Add declarations for ?sum * Add -lm and disable EXPRECISION support on *BSD fixes #2075 * Add in runtime CPU detection for POWER. * snprintf define consolidated to common.h * Support INTERFACE64=1 * Add support for INTERFACE64 and fix XERBLA calls 1. Replaced all instances of "int" with "blasint" 2. Added string length as "hidden" third parameter in calls to fortran XERBLA * Correct length of name string in xerbla call * Avoid out-of-bounds accesses in LAPACK EIG tests see https://github.com/Reference-LAPACK/lapack/issues/333 * Correct INFO=4 condition * Disable reallocation of work array in xSYTRF as it appears to cause memory management problems (seen in the LAPACK tests) * Disable repeated recursion on Ab_BR in ReLAPACK xGBTRF due to crashes in LAPACK tests * sgemm/strmm * Update Changelog with changes from 0.3.6 * Increment version to 0.3.7.dev * Increment version to 0.3.7.dev * Misc. typo fixes Found via `codespell -q 3 -w -L ith,als,dum,nd,amin,nto,wis,ba -S ./relapack,./kernel,./lapack-netlib` * Correct argument of CPU_ISSET for glibc <2.5 fixes #2104 * conflict resolve * Revert reference/ fixes * Revert Changelog.txt typos * Disable the SkyLakeX DGEMMITCOPY kernel as well as a stopgap measure for https://github.com/numpy/numpy/issues/13401 as mentioned in #1955 * Disable DGEMMINCOPY as well for now #1955 * init * Fix errors in cpu enumeration with glibc 2.6 for #2114 * Change two http links to https Closes #2109 * remove redundant code #2113 * Set up CI with Azure Pipelines [skip ci] * TST: add native POWER8 to CI * add native POWER8 testing to Travis CI matrix with ppc64le os entry * Update link to IBM MASS library, update cpu support status * first try migrating one of the arm builds from travis * fix tabbing in azure commands * Update azure-pipelines.yml take out offending lines (although stolen from https://github.com/conda-forge/opencv-feedstock azure-pipelines fiie) * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * DOC: Add Azure CI status badge * Add ARMV6 build to azure CI setup (#2122) using aytekinar's Alpine image and docker script from the Travis setup [skip ci] * TST: Azure manylinux1 & clean-up * remove some of the steps & comments from the original Azure yml template * modify the trigger section to use develop since OpenBLAS primarily uses this branch; use the same batching behavior as downstream projects NumPy/ SciPy * remove Travis emulated ARMv6 gcc build because this now happens in Azure * use documented Ubuntu vmImage name for Azure and add in a manylinux1 test run to the matrix [skip appveyor] * Add NO_AFFINITY to available options on Linux, and set it to ON to match the gmake default. Fixes second part of #2114 * Replace ISMIN and ISAMIN kernels on all x86_64 platforms (#2125) * Mark iamax_sse.S as unsuitable for MIN due to issue #2116 * Use iamax.S rather than iamax_sse.S for ISMIN/ISAMIN on all x86_64 as workaround for #2116 * Move ARMv8 gcc build from Travis to Azure * Move ARMv8 gcc build from Travis to Azure * Update .travis.yml * Test drone CI * install make * remove sudo * Install gcc * Install perl * Install gfortran and add a clang job * gfortran->gcc-gfortran * Switch to ubuntu and parallel jobs * apt update * Fix typo * update yes * no need of gcc in clang build * Add a cmake build as well * Add cmake builds and print options * build without lapack on cmake * parallel build * See if ubuntu 19.04 fixes the ICE * Remove qemu armv8 builds * arm32 build * Fix typo * TST: add SkylakeX AVX512 CI test * adapt the C-level reproducer code for some recent SkylakeX AVX512 kernel issues, provided by Isuru Fernando and modified by Martin Kroeker, for usage in the utest suite * add an Intel SDE SkylakeX emulation utest run to the Azure CI matrix; a custom Docker build was required because Ubuntu image provided by Azure does not support AVX512VL instructions * Add option USE_LOCKING for single-threaded build with locking support for calling from concurrent threads * Add option USE_LOCKING for single-threaded build with locking support * Add option USE_LOCKING for SMP-like locking in USE_THREAD=0 builds * Add option USE_LOCKING but keep default settings intact * Remove unrelated change * Do not try ancient PGI hacks with recent versions of that compiler should fix #2139 * Build and run utests in any case, they do their own checks for fortran availability * Add softfp support in min/max kernels fix for #1912 * Revert "Add softfp support in min/max kernels" * Separate implementations of AMAX and IAMAX on arm As noted in #1912 and comment on #1942, the combined implementation happens to "do the right thing" on hardfp, but cannot return both value and index on softfp where they would have to share the return register * Ensure correct output for DAMAX with softfp * Use generic kernels for complex (I)AMAX to support softfp * improved zgemm power9 based on power8 * upload thread safety test folder * hook up c++ thread safety test (main Makefile) * add c++ thread test option to Makefile.rule * Document NO_AVX512 for #2151 * sgemm pipeline improved, zgemm rewritten without inner packs, ABI lxvx v20 fixed with vs52 * Fix detection of AVX512 capable compilers in getarch 21eda8b5 introduced a check in getarch.c to test if the compiler is capable of AVX512. This check currently fails, since the used __AVX2__ macro is only defined if getarch itself was compiled with AVX2/AVX512 support. Make sure this is the case by building getarch with -march=native on x86_64. It is only supposed to run on the build host anyway. * c_check: Unlink correct file * power9 zgemm ztrmm optimized * conflict resolve * Add gfortran workaround for ABI violations in LAPACKE for #2154 (see gcc bug 90329) * Add gfortran workaround for ABI violations for #2154 (see gcc bug 90329) * Add gfortran workaround for potential ABI violation for #2154 * Update fc.cmake * Remove any inadvertent use of -march=native from DYNAMIC_ARCH builds from #2143, -march=native precludes use of more specific options like -march=skylake-avx512 in individual kernels, and defeats the purpose of dynamic arch anyway. * Avoid unintentional activation of TLS code via USE_TLS=0 fixes #2149 * Do not force gcc options on non-gcc compilers fixes compile failure with pgi 18.10 as reported on OpenBLAS-users * Update Makefile.x86_64 * Zero ecx with a mov instruction PGI assembler does not like the initialization in the constraints. * Fix mov syntax * new sgemm 8x16 * Update dtrmm_kernel_16x4_power8.S * PGI compiler does not like -march=native * Fix build on FreeBSD/powerpc64. Signed-off-by: Piotr Kubaj <pkubaj@anongoth.pl> * Fix build for PPC970 on FreeBSD pt. 1 FreeBSD needs DCBT_ARG=0 as well. * Fix build for PPC970 on FreeBSD pt.2 FreeBSD needs those macros too. * cgemm/ctrmm power9 * Utest needs CBLAS but not necessarily FORTRAN * Add mingw builds to Appveyor config * Add getarch flags to disable AVX on x86 (and other small fixes to match Makefile behaviour) * Make disabling DYNAMIC_ARCH on unsupported systems work needs to be unset in the cache for the change to have any effect * Mingw32 needs leading underscore on object names (also copy BUNDERSCORE settings for FORTRAN from the corresponding Makefile)
6 years ago
rebase? (#1) * With the Intel compiler on Linux, prefer ifort for the final link step icc has known problems with mixed-language builds that ifort can handle just fine. Fixes #1956 * Rename operands to put lda on the input/output constraint list * Fix wrong constraints in inline assembly for #2009 * Fix inline assembly constraints rework indices to allow marking argument lda4 as input and output. For #2009 * Fix inline assembly constraints rework indices to allow marking argument lda as input and output. * Fix inline assembly constraints * Fix inline assembly constraints * Fix inline assembly constraints in Bulldozer TRSM kernels rework indices to allow marking i,as and bs as both input and output (marked operand n1 as well for simplicity). For #2009 * Correct range_n limiting same bug as seen in #1388, somehow missed in corresponding PR #1389 * Allow multithreading TRMV again revert workaround introduced for issue #1332 as the actual cause appears to be my incorrect fix from #1262 (see #1388) * Fix error introduced during cleanup * Reduce list of kernels in the dynamic arch build to make compilation complete reliably within the 1h limit again * init * move fix to right place * Fix missing -c option in AVX512 test * Fix AVX512 test always returning false due to missing compiler option * Make x86_32 imply NO_AVX2, NO_AVX512 in addition to NO_AVX fixes #2033 * Keep xcode8.3 for osx BINARY=32 build as xcode10 deprecated i386 * Make sure that AVX512 is disabled in 32bit builds for #2033 * Improve handling of NO_STATIC and NO_SHARED to avoid surprises from defining either as zero. Fixes #2035 by addressing some concerns from #1422 * init * address warning introed with #1814 et al * Restore locking optimizations for OpenMP case restore another accidentally dropped part of #1468 that was missed in #2004 to address performance regression reported in #1461 * HiSilicon tsv110 CPUs optimization branch add HiSilicon tsv110 CPUs optimization branch * add TARGET support for HiSilicon tsv110 CPUs * add TARGET support for HiSilicon tsv110 CPUs * add TARGET support for HiSilicon tsv110 CPUs * Fix module definition conflicts between LAPACK and ReLAPACK for #2043 * Do not compile in AVX512 check if AVX support is disabled xgetbv is function depends on NO_AVX being undefined - we could change that too, but that combo is unlikely to work anyway * ctest.c : add __POWERPC__ for PowerMac * Fix crash in sgemm SSE/nano kernel on x86_64 Fix bug #2047. Signed-off-by: Celelibi <celelibi@gmail.com> * param.h : enable defines for PPC970 on DarwinOS fixes: gemm.c: In function 'sgemm_': ../common_param.h:981:18: error: 'SGEMM_DEFAULT_P' undeclared (first use in this function) #define SGEMM_P SGEMM_DEFAULT_P ^ * common_power.h: force DCBT_ARG 0 on PPC970 Darwin without this, we see ../kernel/power/gemv_n.S:427:Parameter syntax error and many more similar entries that relates to this assembly command dcbt 8, r24, r18 this change makes the DCBT_ARG = 0 and openblas builds through to completion on PowerMac 970 Tests pass * Make TARGET=GENERIC compatible with DYNAMIC_ARCH=1 for issue #2048 * make DYNAMIC_ARCH=1 package work on TSV110. * make DYNAMIC_ARCH=1 package work on TSV110 * Add Intel Denverton for #2048 * Add Intel Denverton * Change 64-bit detection as explained in #2056 * Trivial typo fix as suggested in #2022 * Disable the AVX512 DGEMM kernel (again) Due to as yet unresolved errors seen in #1955 and #2029 * Use POSIX getenv on Cygwin The Windows-native GetEnvironmentVariable cannot be relied on, as Cygwin does not always copy environment variables set through Cygwin to the Windows environment block, particularly after fork(). * Fix for #2063: The DllMain used in Cygwin did not run the thread memory pool cleanup upon THREAD_DETACH which is needed when compiled with USE_TLS=1. * Also call CloseHandle on each thread, as well as on the event so as to not leak thread handles. * AIX asm syntax changes needed for shared object creation * power9 makefile. dgemm based on power8 kernel with following changes : 32x unrolled 16x4 kernel and 8x4 kernel using (lxv stxv butterfly rank1 update). improvement from 17 to 22-23gflops. dtrmm cases were added into dgemm itself * Expose CBLAS interfaces for I?MIN and I?MAX * Build CBLAS interfaces for I?MIN and I?MAX * Add declarations for ?sum and cblas_?sum * Add interface for ?sum (derived from ?asum) * Add ?sum * Add implementations of ssum/dsum and csum/zsum as trivial copies of asum/zsasum with the fabs calls replaced by fmov to preserve code structure * Add ARM implementations of ?sum (trivial copies of the respective ?asum with the fabs calls removed) * Add ARM64 implementations of ?sum as trivial copies of the respective ?asum kernels with the fabs calls removed * Add ia64 implementation of ?sum as trivial copy of asum with the fabs calls removed * Add MIPS implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add MIPS64 implementation of ?sum as trivial copy of ?asum with the fabs replaced by mov to preserve code structure * Add POWER implementation of ?sum as trivial copy of ?asum with the fabs replaced by fmr to preserve code structure * Add SPARC implementation of ?sum as trivial copy of ?asum with the fabs replaced by fmov to preserve code structure * Add x86 implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add x86_64 implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add ZARCH implementation of ?sum as trivial copies of the respective ?asum kernels with the ABS and vflpsb calls removed * Detect 32bit environment on 64bit ARM hardware for #2056, using same approach as #2058 * Add cmake defaults for ?sum kernels * Add ?sum * Add ?sum definitions for generic kernel * Add declarations for ?sum * Add -lm and disable EXPRECISION support on *BSD fixes #2075 * Add in runtime CPU detection for POWER. * snprintf define consolidated to common.h * Support INTERFACE64=1 * Add support for INTERFACE64 and fix XERBLA calls 1. Replaced all instances of "int" with "blasint" 2. Added string length as "hidden" third parameter in calls to fortran XERBLA * Correct length of name string in xerbla call * Avoid out-of-bounds accesses in LAPACK EIG tests see https://github.com/Reference-LAPACK/lapack/issues/333 * Correct INFO=4 condition * Disable reallocation of work array in xSYTRF as it appears to cause memory management problems (seen in the LAPACK tests) * Disable repeated recursion on Ab_BR in ReLAPACK xGBTRF due to crashes in LAPACK tests * sgemm/strmm * Update Changelog with changes from 0.3.6 * Increment version to 0.3.7.dev * Increment version to 0.3.7.dev * Misc. typo fixes Found via `codespell -q 3 -w -L ith,als,dum,nd,amin,nto,wis,ba -S ./relapack,./kernel,./lapack-netlib` * Correct argument of CPU_ISSET for glibc <2.5 fixes #2104 * conflict resolve * Revert reference/ fixes * Revert Changelog.txt typos * Disable the SkyLakeX DGEMMITCOPY kernel as well as a stopgap measure for https://github.com/numpy/numpy/issues/13401 as mentioned in #1955 * Disable DGEMMINCOPY as well for now #1955 * init * Fix errors in cpu enumeration with glibc 2.6 for #2114 * Change two http links to https Closes #2109 * remove redundant code #2113 * Set up CI with Azure Pipelines [skip ci] * TST: add native POWER8 to CI * add native POWER8 testing to Travis CI matrix with ppc64le os entry * Update link to IBM MASS library, update cpu support status * first try migrating one of the arm builds from travis * fix tabbing in azure commands * Update azure-pipelines.yml take out offending lines (although stolen from https://github.com/conda-forge/opencv-feedstock azure-pipelines fiie) * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * DOC: Add Azure CI status badge * Add ARMV6 build to azure CI setup (#2122) using aytekinar's Alpine image and docker script from the Travis setup [skip ci] * TST: Azure manylinux1 & clean-up * remove some of the steps & comments from the original Azure yml template * modify the trigger section to use develop since OpenBLAS primarily uses this branch; use the same batching behavior as downstream projects NumPy/ SciPy * remove Travis emulated ARMv6 gcc build because this now happens in Azure * use documented Ubuntu vmImage name for Azure and add in a manylinux1 test run to the matrix [skip appveyor] * Add NO_AFFINITY to available options on Linux, and set it to ON to match the gmake default. Fixes second part of #2114 * Replace ISMIN and ISAMIN kernels on all x86_64 platforms (#2125) * Mark iamax_sse.S as unsuitable for MIN due to issue #2116 * Use iamax.S rather than iamax_sse.S for ISMIN/ISAMIN on all x86_64 as workaround for #2116 * Move ARMv8 gcc build from Travis to Azure * Move ARMv8 gcc build from Travis to Azure * Update .travis.yml * Test drone CI * install make * remove sudo * Install gcc * Install perl * Install gfortran and add a clang job * gfortran->gcc-gfortran * Switch to ubuntu and parallel jobs * apt update * Fix typo * update yes * no need of gcc in clang build * Add a cmake build as well * Add cmake builds and print options * build without lapack on cmake * parallel build * See if ubuntu 19.04 fixes the ICE * Remove qemu armv8 builds * arm32 build * Fix typo * TST: add SkylakeX AVX512 CI test * adapt the C-level reproducer code for some recent SkylakeX AVX512 kernel issues, provided by Isuru Fernando and modified by Martin Kroeker, for usage in the utest suite * add an Intel SDE SkylakeX emulation utest run to the Azure CI matrix; a custom Docker build was required because Ubuntu image provided by Azure does not support AVX512VL instructions * Add option USE_LOCKING for single-threaded build with locking support for calling from concurrent threads * Add option USE_LOCKING for single-threaded build with locking support * Add option USE_LOCKING for SMP-like locking in USE_THREAD=0 builds * Add option USE_LOCKING but keep default settings intact * Remove unrelated change * Do not try ancient PGI hacks with recent versions of that compiler should fix #2139 * Build and run utests in any case, they do their own checks for fortran availability * Add softfp support in min/max kernels fix for #1912 * Revert "Add softfp support in min/max kernels" * Separate implementations of AMAX and IAMAX on arm As noted in #1912 and comment on #1942, the combined implementation happens to "do the right thing" on hardfp, but cannot return both value and index on softfp where they would have to share the return register * Ensure correct output for DAMAX with softfp * Use generic kernels for complex (I)AMAX to support softfp * improved zgemm power9 based on power8 * upload thread safety test folder * hook up c++ thread safety test (main Makefile) * add c++ thread test option to Makefile.rule * Document NO_AVX512 for #2151 * sgemm pipeline improved, zgemm rewritten without inner packs, ABI lxvx v20 fixed with vs52 * Fix detection of AVX512 capable compilers in getarch 21eda8b5 introduced a check in getarch.c to test if the compiler is capable of AVX512. This check currently fails, since the used __AVX2__ macro is only defined if getarch itself was compiled with AVX2/AVX512 support. Make sure this is the case by building getarch with -march=native on x86_64. It is only supposed to run on the build host anyway. * c_check: Unlink correct file * power9 zgemm ztrmm optimized * conflict resolve * Add gfortran workaround for ABI violations in LAPACKE for #2154 (see gcc bug 90329) * Add gfortran workaround for ABI violations for #2154 (see gcc bug 90329) * Add gfortran workaround for potential ABI violation for #2154 * Update fc.cmake * Remove any inadvertent use of -march=native from DYNAMIC_ARCH builds from #2143, -march=native precludes use of more specific options like -march=skylake-avx512 in individual kernels, and defeats the purpose of dynamic arch anyway. * Avoid unintentional activation of TLS code via USE_TLS=0 fixes #2149 * Do not force gcc options on non-gcc compilers fixes compile failure with pgi 18.10 as reported on OpenBLAS-users * Update Makefile.x86_64 * Zero ecx with a mov instruction PGI assembler does not like the initialization in the constraints. * Fix mov syntax * new sgemm 8x16 * Update dtrmm_kernel_16x4_power8.S * PGI compiler does not like -march=native * Fix build on FreeBSD/powerpc64. Signed-off-by: Piotr Kubaj <pkubaj@anongoth.pl> * Fix build for PPC970 on FreeBSD pt. 1 FreeBSD needs DCBT_ARG=0 as well. * Fix build for PPC970 on FreeBSD pt.2 FreeBSD needs those macros too. * cgemm/ctrmm power9 * Utest needs CBLAS but not necessarily FORTRAN * Add mingw builds to Appveyor config * Add getarch flags to disable AVX on x86 (and other small fixes to match Makefile behaviour) * Make disabling DYNAMIC_ARCH on unsupported systems work needs to be unset in the cache for the change to have any effect * Mingw32 needs leading underscore on object names (also copy BUNDERSCORE settings for FORTRAN from the corresponding Makefile)
6 years ago
rebase? (#1) * With the Intel compiler on Linux, prefer ifort for the final link step icc has known problems with mixed-language builds that ifort can handle just fine. Fixes #1956 * Rename operands to put lda on the input/output constraint list * Fix wrong constraints in inline assembly for #2009 * Fix inline assembly constraints rework indices to allow marking argument lda4 as input and output. For #2009 * Fix inline assembly constraints rework indices to allow marking argument lda as input and output. * Fix inline assembly constraints * Fix inline assembly constraints * Fix inline assembly constraints in Bulldozer TRSM kernels rework indices to allow marking i,as and bs as both input and output (marked operand n1 as well for simplicity). For #2009 * Correct range_n limiting same bug as seen in #1388, somehow missed in corresponding PR #1389 * Allow multithreading TRMV again revert workaround introduced for issue #1332 as the actual cause appears to be my incorrect fix from #1262 (see #1388) * Fix error introduced during cleanup * Reduce list of kernels in the dynamic arch build to make compilation complete reliably within the 1h limit again * init * move fix to right place * Fix missing -c option in AVX512 test * Fix AVX512 test always returning false due to missing compiler option * Make x86_32 imply NO_AVX2, NO_AVX512 in addition to NO_AVX fixes #2033 * Keep xcode8.3 for osx BINARY=32 build as xcode10 deprecated i386 * Make sure that AVX512 is disabled in 32bit builds for #2033 * Improve handling of NO_STATIC and NO_SHARED to avoid surprises from defining either as zero. Fixes #2035 by addressing some concerns from #1422 * init * address warning introed with #1814 et al * Restore locking optimizations for OpenMP case restore another accidentally dropped part of #1468 that was missed in #2004 to address performance regression reported in #1461 * HiSilicon tsv110 CPUs optimization branch add HiSilicon tsv110 CPUs optimization branch * add TARGET support for HiSilicon tsv110 CPUs * add TARGET support for HiSilicon tsv110 CPUs * add TARGET support for HiSilicon tsv110 CPUs * Fix module definition conflicts between LAPACK and ReLAPACK for #2043 * Do not compile in AVX512 check if AVX support is disabled xgetbv is function depends on NO_AVX being undefined - we could change that too, but that combo is unlikely to work anyway * ctest.c : add __POWERPC__ for PowerMac * Fix crash in sgemm SSE/nano kernel on x86_64 Fix bug #2047. Signed-off-by: Celelibi <celelibi@gmail.com> * param.h : enable defines for PPC970 on DarwinOS fixes: gemm.c: In function 'sgemm_': ../common_param.h:981:18: error: 'SGEMM_DEFAULT_P' undeclared (first use in this function) #define SGEMM_P SGEMM_DEFAULT_P ^ * common_power.h: force DCBT_ARG 0 on PPC970 Darwin without this, we see ../kernel/power/gemv_n.S:427:Parameter syntax error and many more similar entries that relates to this assembly command dcbt 8, r24, r18 this change makes the DCBT_ARG = 0 and openblas builds through to completion on PowerMac 970 Tests pass * Make TARGET=GENERIC compatible with DYNAMIC_ARCH=1 for issue #2048 * make DYNAMIC_ARCH=1 package work on TSV110. * make DYNAMIC_ARCH=1 package work on TSV110 * Add Intel Denverton for #2048 * Add Intel Denverton * Change 64-bit detection as explained in #2056 * Trivial typo fix as suggested in #2022 * Disable the AVX512 DGEMM kernel (again) Due to as yet unresolved errors seen in #1955 and #2029 * Use POSIX getenv on Cygwin The Windows-native GetEnvironmentVariable cannot be relied on, as Cygwin does not always copy environment variables set through Cygwin to the Windows environment block, particularly after fork(). * Fix for #2063: The DllMain used in Cygwin did not run the thread memory pool cleanup upon THREAD_DETACH which is needed when compiled with USE_TLS=1. * Also call CloseHandle on each thread, as well as on the event so as to not leak thread handles. * AIX asm syntax changes needed for shared object creation * power9 makefile. dgemm based on power8 kernel with following changes : 32x unrolled 16x4 kernel and 8x4 kernel using (lxv stxv butterfly rank1 update). improvement from 17 to 22-23gflops. dtrmm cases were added into dgemm itself * Expose CBLAS interfaces for I?MIN and I?MAX * Build CBLAS interfaces for I?MIN and I?MAX * Add declarations for ?sum and cblas_?sum * Add interface for ?sum (derived from ?asum) * Add ?sum * Add implementations of ssum/dsum and csum/zsum as trivial copies of asum/zsasum with the fabs calls replaced by fmov to preserve code structure * Add ARM implementations of ?sum (trivial copies of the respective ?asum with the fabs calls removed) * Add ARM64 implementations of ?sum as trivial copies of the respective ?asum kernels with the fabs calls removed * Add ia64 implementation of ?sum as trivial copy of asum with the fabs calls removed * Add MIPS implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add MIPS64 implementation of ?sum as trivial copy of ?asum with the fabs replaced by mov to preserve code structure * Add POWER implementation of ?sum as trivial copy of ?asum with the fabs replaced by fmr to preserve code structure * Add SPARC implementation of ?sum as trivial copy of ?asum with the fabs replaced by fmov to preserve code structure * Add x86 implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add x86_64 implementation of ?sum as trivial copy of ?asum with the fabs calls removed * Add ZARCH implementation of ?sum as trivial copies of the respective ?asum kernels with the ABS and vflpsb calls removed * Detect 32bit environment on 64bit ARM hardware for #2056, using same approach as #2058 * Add cmake defaults for ?sum kernels * Add ?sum * Add ?sum definitions for generic kernel * Add declarations for ?sum * Add -lm and disable EXPRECISION support on *BSD fixes #2075 * Add in runtime CPU detection for POWER. * snprintf define consolidated to common.h * Support INTERFACE64=1 * Add support for INTERFACE64 and fix XERBLA calls 1. Replaced all instances of "int" with "blasint" 2. Added string length as "hidden" third parameter in calls to fortran XERBLA * Correct length of name string in xerbla call * Avoid out-of-bounds accesses in LAPACK EIG tests see https://github.com/Reference-LAPACK/lapack/issues/333 * Correct INFO=4 condition * Disable reallocation of work array in xSYTRF as it appears to cause memory management problems (seen in the LAPACK tests) * Disable repeated recursion on Ab_BR in ReLAPACK xGBTRF due to crashes in LAPACK tests * sgemm/strmm * Update Changelog with changes from 0.3.6 * Increment version to 0.3.7.dev * Increment version to 0.3.7.dev * Misc. typo fixes Found via `codespell -q 3 -w -L ith,als,dum,nd,amin,nto,wis,ba -S ./relapack,./kernel,./lapack-netlib` * Correct argument of CPU_ISSET for glibc <2.5 fixes #2104 * conflict resolve * Revert reference/ fixes * Revert Changelog.txt typos * Disable the SkyLakeX DGEMMITCOPY kernel as well as a stopgap measure for https://github.com/numpy/numpy/issues/13401 as mentioned in #1955 * Disable DGEMMINCOPY as well for now #1955 * init * Fix errors in cpu enumeration with glibc 2.6 for #2114 * Change two http links to https Closes #2109 * remove redundant code #2113 * Set up CI with Azure Pipelines [skip ci] * TST: add native POWER8 to CI * add native POWER8 testing to Travis CI matrix with ppc64le os entry * Update link to IBM MASS library, update cpu support status * first try migrating one of the arm builds from travis * fix tabbing in azure commands * Update azure-pipelines.yml take out offending lines (although stolen from https://github.com/conda-forge/opencv-feedstock azure-pipelines fiie) * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * Update azure-pipelines.yml * DOC: Add Azure CI status badge * Add ARMV6 build to azure CI setup (#2122) using aytekinar's Alpine image and docker script from the Travis setup [skip ci] * TST: Azure manylinux1 & clean-up * remove some of the steps & comments from the original Azure yml template * modify the trigger section to use develop since OpenBLAS primarily uses this branch; use the same batching behavior as downstream projects NumPy/ SciPy * remove Travis emulated ARMv6 gcc build because this now happens in Azure * use documented Ubuntu vmImage name for Azure and add in a manylinux1 test run to the matrix [skip appveyor] * Add NO_AFFINITY to available options on Linux, and set it to ON to match the gmake default. Fixes second part of #2114 * Replace ISMIN and ISAMIN kernels on all x86_64 platforms (#2125) * Mark iamax_sse.S as unsuitable for MIN due to issue #2116 * Use iamax.S rather than iamax_sse.S for ISMIN/ISAMIN on all x86_64 as workaround for #2116 * Move ARMv8 gcc build from Travis to Azure * Move ARMv8 gcc build from Travis to Azure * Update .travis.yml * Test drone CI * install make * remove sudo * Install gcc * Install perl * Install gfortran and add a clang job * gfortran->gcc-gfortran * Switch to ubuntu and parallel jobs * apt update * Fix typo * update yes * no need of gcc in clang build * Add a cmake build as well * Add cmake builds and print options * build without lapack on cmake * parallel build * See if ubuntu 19.04 fixes the ICE * Remove qemu armv8 builds * arm32 build * Fix typo * TST: add SkylakeX AVX512 CI test * adapt the C-level reproducer code for some recent SkylakeX AVX512 kernel issues, provided by Isuru Fernando and modified by Martin Kroeker, for usage in the utest suite * add an Intel SDE SkylakeX emulation utest run to the Azure CI matrix; a custom Docker build was required because Ubuntu image provided by Azure does not support AVX512VL instructions * Add option USE_LOCKING for single-threaded build with locking support for calling from concurrent threads * Add option USE_LOCKING for single-threaded build with locking support * Add option USE_LOCKING for SMP-like locking in USE_THREAD=0 builds * Add option USE_LOCKING but keep default settings intact * Remove unrelated change * Do not try ancient PGI hacks with recent versions of that compiler should fix #2139 * Build and run utests in any case, they do their own checks for fortran availability * Add softfp support in min/max kernels fix for #1912 * Revert "Add softfp support in min/max kernels" * Separate implementations of AMAX and IAMAX on arm As noted in #1912 and comment on #1942, the combined implementation happens to "do the right thing" on hardfp, but cannot return both value and index on softfp where they would have to share the return register * Ensure correct output for DAMAX with softfp * Use generic kernels for complex (I)AMAX to support softfp * improved zgemm power9 based on power8 * upload thread safety test folder * hook up c++ thread safety test (main Makefile) * add c++ thread test option to Makefile.rule * Document NO_AVX512 for #2151 * sgemm pipeline improved, zgemm rewritten without inner packs, ABI lxvx v20 fixed with vs52 * Fix detection of AVX512 capable compilers in getarch 21eda8b5 introduced a check in getarch.c to test if the compiler is capable of AVX512. This check currently fails, since the used __AVX2__ macro is only defined if getarch itself was compiled with AVX2/AVX512 support. Make sure this is the case by building getarch with -march=native on x86_64. It is only supposed to run on the build host anyway. * c_check: Unlink correct file * power9 zgemm ztrmm optimized * conflict resolve * Add gfortran workaround for ABI violations in LAPACKE for #2154 (see gcc bug 90329) * Add gfortran workaround for ABI violations for #2154 (see gcc bug 90329) * Add gfortran workaround for potential ABI violation for #2154 * Update fc.cmake * Remove any inadvertent use of -march=native from DYNAMIC_ARCH builds from #2143, -march=native precludes use of more specific options like -march=skylake-avx512 in individual kernels, and defeats the purpose of dynamic arch anyway. * Avoid unintentional activation of TLS code via USE_TLS=0 fixes #2149 * Do not force gcc options on non-gcc compilers fixes compile failure with pgi 18.10 as reported on OpenBLAS-users * Update Makefile.x86_64 * Zero ecx with a mov instruction PGI assembler does not like the initialization in the constraints. * Fix mov syntax * new sgemm 8x16 * Update dtrmm_kernel_16x4_power8.S * PGI compiler does not like -march=native * Fix build on FreeBSD/powerpc64. Signed-off-by: Piotr Kubaj <pkubaj@anongoth.pl> * Fix build for PPC970 on FreeBSD pt. 1 FreeBSD needs DCBT_ARG=0 as well. * Fix build for PPC970 on FreeBSD pt.2 FreeBSD needs those macros too. * cgemm/ctrmm power9 * Utest needs CBLAS but not necessarily FORTRAN * Add mingw builds to Appveyor config * Add getarch flags to disable AVX on x86 (and other small fixes to match Makefile behaviour) * Make disabling DYNAMIC_ARCH on unsupported systems work needs to be unset in the cache for the change to have any effect * Mingw32 needs leading underscore on object names (also copy BUNDERSCORE settings for FORTRAN from the corresponding Makefile)
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
  1. /*********************************************************************/
  2. /* Copyright 2009, 2010 The University of Texas at Austin. */
  3. /* All rights reserved. */
  4. /* */
  5. /* Redistribution and use in source and binary forms, with or */
  6. /* without modification, are permitted provided that the following */
  7. /* conditions are met: */
  8. /* */
  9. /* 1. Redistributions of source code must retain the above */
  10. /* copyright notice, this list of conditions and the following */
  11. /* disclaimer. */
  12. /* */
  13. /* 2. Redistributions in binary form must reproduce the above */
  14. /* copyright notice, this list of conditions and the following */
  15. /* disclaimer in the documentation and/or other materials */
  16. /* provided with the distribution. */
  17. /* */
  18. /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
  19. /* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  20. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  21. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  22. /* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
  23. /* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
  24. /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
  25. /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
  26. /* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
  27. /* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
  28. /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
  29. /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
  30. /* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  31. /* POSSIBILITY OF SUCH DAMAGE. */
  32. /* */
  33. /* The views and conclusions contained in the software and */
  34. /* documentation are those of the authors and should not be */
  35. /* interpreted as representing official policies, either expressed */
  36. /* or implied, of The University of Texas at Austin. */
  37. /*********************************************************************/
  38. #define ASSEMBLER
  39. #include "common.h"
  40. #ifndef __64BIT__
  41. #define LOAD lwz
  42. #else
  43. #define LOAD ld
  44. #endif
  45. #ifdef __64BIT__
  46. #define STACKSIZE 320
  47. #define ALPHA_R 296(SP)
  48. #define ALPHA_I 304(SP)
  49. #define FZERO 312(SP)
  50. #else
  51. #define STACKSIZE 256
  52. #define ALPHA_R 224(SP)
  53. #define ALPHA_I 232(SP)
  54. #define FZERO 240(SP)
  55. #endif
  56. #define M r3
  57. #define N r4
  58. #define K r5
  59. #if defined(linux) || defined(__FreeBSD__)
  60. #ifndef __64BIT__
  61. #define A r6
  62. #define B r7
  63. #define C r8
  64. #define LDC r9
  65. #else
  66. #define A r8
  67. #define B r9
  68. #define C r10
  69. #define LDC r6
  70. #endif
  71. #endif
  72. #if defined(_AIX) || defined(__APPLE__)
  73. #if !defined(__64BIT__) && defined(DOUBLE)
  74. #define A r10
  75. #define B r6
  76. #define C r7
  77. #define LDC r8
  78. #else
  79. #define A r8
  80. #define B r9
  81. #define C r10
  82. #define LDC r6
  83. #endif
  84. #endif
  85. #define I r24
  86. #define J r25
  87. #define AO r26
  88. #define BO r27
  89. #define CO1 r28
  90. #define CO2 r29
  91. #define PREA r30
  92. #define PREC r31
  93. #define PREB PREA
  94. #ifndef NEEDPARAM
  95. #ifndef DOUBLE
  96. #include "../cparam.h"
  97. #else
  98. #include "../zparam.h"
  99. #endif
  100. PROLOGUE
  101. PROFCODE
  102. addi SP, SP, -STACKSIZE
  103. li r0, 0
  104. stfd f14, 0(SP)
  105. stfd f15, 8(SP)
  106. stfd f16, 16(SP)
  107. stfd f17, 24(SP)
  108. stfd f18, 32(SP)
  109. stfd f19, 40(SP)
  110. stfd f20, 48(SP)
  111. stfd f21, 56(SP)
  112. stfd f22, 64(SP)
  113. stfd f23, 72(SP)
  114. stfd f24, 80(SP)
  115. stfd f25, 88(SP)
  116. stfd f26, 96(SP)
  117. stfd f27, 104(SP)
  118. stfd f28, 112(SP)
  119. stfd f29, 120(SP)
  120. stfd f30, 128(SP)
  121. stfd f31, 136(SP)
  122. #ifdef __64BIT__
  123. std r31, 144(SP)
  124. std r30, 152(SP)
  125. std r29, 160(SP)
  126. std r28, 168(SP)
  127. std r27, 176(SP)
  128. std r26, 184(SP)
  129. std r25, 192(SP)
  130. std r24, 200(SP)
  131. #else
  132. stw r31, 144(SP)
  133. stw r30, 148(SP)
  134. stw r29, 152(SP)
  135. stw r28, 156(SP)
  136. stw r27, 160(SP)
  137. stw r26, 164(SP)
  138. stw r25, 168(SP)
  139. stw r24, 172(SP)
  140. #endif
  141. stfd f1, ALPHA_R
  142. stfd f2, ALPHA_I
  143. stw r0, FZERO
  144. #if defined(linux) || defined(__FreeBSD__)
  145. #ifdef __64BIT__
  146. ld LDC, FRAMESLOT(0) + STACKSIZE(SP)
  147. #endif
  148. #endif
  149. #if defined(_AIX) || defined(__APPLE__)
  150. #ifdef __64BIT__
  151. ld LDC, FRAMESLOT(0) + STACKSIZE(SP)
  152. #else
  153. #ifdef DOUBLE
  154. lwz B, FRAMESLOT(0) + STACKSIZE(SP)
  155. lwz C, FRAMESLOT(1) + STACKSIZE(SP)
  156. lwz LDC, FRAMESLOT(2) + STACKSIZE(SP)
  157. #else
  158. lwz LDC, FRAMESLOT(0) + STACKSIZE(SP)
  159. #endif
  160. #endif
  161. #endif
  162. slwi LDC, LDC, ZBASE_SHIFT
  163. cmpwi cr0, M, 0
  164. ble LL(999)
  165. cmpwi cr0, N, 0
  166. ble LL(999)
  167. cmpwi cr0, K, 0
  168. ble LL(999)
  169. #ifndef PREFETCHTEST
  170. #ifdef PPC970
  171. li PREC, 4 * SIZE
  172. #endif
  173. #ifdef POWER4
  174. li PREC, 4 * SIZE /* is 12 best? */
  175. #endif
  176. #ifdef POWER5
  177. li PREC, 4 * SIZE /* is 12 best? */
  178. #endif
  179. #else
  180. #if defined(linux) || defined(__FreeBSD__)
  181. #ifndef __64BIT__
  182. lwz PREA, FRAMESLOT(2) + STACKSIZE(SP)
  183. lwz PREC, FRAMESLOT(3) + STACKSIZE(SP)
  184. #else
  185. ld PREA, FRAMESLOT(3) + STACKSIZE(SP)
  186. ld PREC, FRAMESLOT(4) + STACKSIZE(SP)
  187. #endif
  188. #endif
  189. #if defined(_AIX) || defined(__APPLE__)
  190. #ifdef __64BIT__
  191. ld PREA, FRAMESLOT(3) + STACKSIZE(SP)
  192. ld PREC, FRAMESLOT(4) + STACKSIZE(SP)
  193. #else
  194. #ifdef DOUBLE
  195. lwz PREA, FRAMESLOT(4) + STACKSIZE(SP)
  196. lwz PREC, FRAMESLOT(5) + STACKSIZE(SP)
  197. #else
  198. lwz PREA, FRAMESLOT(3) + STACKSIZE(SP)
  199. lwz PREC, FRAMESLOT(4) + STACKSIZE(SP)
  200. #endif
  201. #endif
  202. #endif
  203. #endif
  204. #ifndef PREFETCHTEST
  205. #ifdef PPC970
  206. #ifdef ALLOC_HUGETLB
  207. li PREA, (16 * 5 * SIZE + 16)
  208. #else
  209. li PREA, (16 * 9 * SIZE + 16)
  210. #endif
  211. #endif
  212. #ifdef POWER4
  213. #ifdef ALLOC_HUGETLB
  214. li PREA, (16 * 1 * SIZE + 16)
  215. #else
  216. li PREA, (16 * 2 * SIZE + 16)
  217. #endif
  218. #endif
  219. #ifdef POWER5
  220. li PREA, 16 * 9 * SIZE
  221. #endif
  222. #endif
  223. lfs f0, FZERO
  224. srawi. J, N, 1
  225. ble LL(KERNEL_N_AND_3_HEAD)
  226. .align 4
  227. LL(KERNEL_MainHead):
  228. fmr f1, f0
  229. fmr f2, f0
  230. fmr f3, f0
  231. fmr f4, f0
  232. fmr f5, f0
  233. fmr f6, f0
  234. fmr f7, f0
  235. fmr f8, f0
  236. fmr f9, f0
  237. fmr f10, f0
  238. fmr f11, f0
  239. fmr f12, f0
  240. fmr f13, f0
  241. fmr f14, f0
  242. fmr f15, f0
  243. mr CO1, C
  244. add CO2, C, LDC
  245. add C, CO2, LDC
  246. srawi. I, M, 1
  247. mr AO, A
  248. ble LL(KERNEL_M_AND_3)
  249. .align 4
  250. LL(KERNEL_MainSubHead):
  251. LFD f16, 0 * SIZE(AO)
  252. LFD f17, 1 * SIZE(AO)
  253. LFD f18, 2 * SIZE(AO)
  254. LFD f19, 3 * SIZE(AO)
  255. LFD f20, 0 * SIZE(B)
  256. LFD f21, 1 * SIZE(B)
  257. LFD f22, 2 * SIZE(B)
  258. LFD f23, 3 * SIZE(B)
  259. LFD f24, 4 * SIZE(AO)
  260. LFD f25, 5 * SIZE(AO)
  261. LFD f26, 6 * SIZE(AO)
  262. LFD f27, 7 * SIZE(AO)
  263. srawi. r0, K, 2
  264. mr BO, B
  265. mtspr CTR, r0
  266. ble LL(KERNEL_K_AND_7)
  267. .align 4
  268. LL(KERNEL_MainLoop):
  269. fmadd f0, f16, f20, f0
  270. fmadd f4, f16, f21, f4
  271. LFD f28, 4 * SIZE(BO)
  272. fmadd f8, f16, f22, f8
  273. fmadd f12, f16, f23, f12
  274. LFD f16, 8 * SIZE(AO)
  275. fmadd f1, f17, f20, f1
  276. fmadd f5, f17, f21, f5
  277. LFD f29, 5 * SIZE(BO)
  278. fmadd f9, f17, f22, f9
  279. fmadd f13, f17, f23, f13
  280. LFD f17, 9 * SIZE(AO)
  281. fmadd f2, f18, f20, f2
  282. fmadd f6, f18, f21, f6
  283. LFD f30, 6 * SIZE(BO)
  284. fmadd f10, f18, f22, f10
  285. fmadd f14, f18, f23, f14
  286. LFD f18, 10 * SIZE(AO)
  287. fmadd f3, f19, f20, f3
  288. fmadd f7, f19, f21, f7
  289. LFD f31, 7 * SIZE(BO)
  290. fmadd f11, f19, f22, f11
  291. fmadd f15, f19, f23, f15
  292. LFD f19, 11 * SIZE(AO)
  293. fmadd f0, f24, f28, f0
  294. fmadd f4, f24, f29, f4
  295. LFD f20, 8 * SIZE(BO)
  296. fmadd f8, f24, f30, f8
  297. fmadd f12, f24, f31, f12
  298. LFD f24, 12 * SIZE(AO)
  299. fmadd f1, f25, f28, f1
  300. fmadd f5, f25, f29, f5
  301. LFD f21, 9 * SIZE(BO)
  302. fmadd f9, f25, f30, f9
  303. fmadd f13, f25, f31, f13
  304. LFD f25, 13 * SIZE(AO)
  305. fmadd f2, f26, f28, f2
  306. fmadd f6, f26, f29, f6
  307. LFD f22, 10 * SIZE(BO)
  308. fmadd f10, f26, f30, f10
  309. fmadd f14, f26, f31, f14
  310. LFD f26, 14 * SIZE(AO)
  311. fmadd f3, f27, f28, f3
  312. fmadd f7, f27, f29, f7
  313. LFD f23, 11 * SIZE(BO)
  314. fmadd f11, f27, f30, f11
  315. fmadd f15, f27, f31, f15
  316. LFD f27, 15 * SIZE(AO)
  317. fmadd f0, f16, f20, f0
  318. fmadd f4, f16, f21, f4
  319. LFD f28, 12 * SIZE(BO)
  320. fmadd f8, f16, f22, f8
  321. fmadd f12, f16, f23, f12
  322. LFDU f16, 16 * SIZE(AO)
  323. fmadd f1, f17, f20, f1
  324. fmadd f5, f17, f21, f5
  325. LFD f29, 13 * SIZE(BO)
  326. fmadd f9, f17, f22, f9
  327. fmadd f13, f17, f23, f13
  328. LFD f17, 1 * SIZE(AO)
  329. fmadd f2, f18, f20, f2
  330. fmadd f6, f18, f21, f6
  331. LFD f30, 14 * SIZE(BO)
  332. fmadd f10, f18, f22, f10
  333. fmadd f14, f18, f23, f14
  334. LFD f18, 2 * SIZE(AO)
  335. fmadd f3, f19, f20, f3
  336. fmadd f7, f19, f21, f7
  337. LFD f31, 15 * SIZE(BO)
  338. fmadd f11, f19, f22, f11
  339. fmadd f15, f19, f23, f15
  340. LFD f19, 3 * SIZE(AO)
  341. fmadd f0, f24, f28, f0
  342. fmadd f4, f24, f29, f4
  343. LFDU f20, 16 * SIZE(BO)
  344. fmadd f8, f24, f30, f8
  345. fmadd f12, f24, f31, f12
  346. LFD f24, 4 * SIZE(AO)
  347. fmadd f1, f25, f28, f1
  348. fmadd f5, f25, f29, f5
  349. LFD f21, 1 * SIZE(BO)
  350. fmadd f9, f25, f30, f9
  351. fmadd f13, f25, f31, f13
  352. LFD f25, 5 * SIZE(AO)
  353. fmadd f2, f26, f28, f2
  354. fmadd f6, f26, f29, f6
  355. LFD f22, 2 * SIZE(BO)
  356. fmadd f10, f26, f30, f10
  357. fmadd f14, f26, f31, f14
  358. LFD f26, 6 * SIZE(AO)
  359. fmadd f3, f27, f28, f3
  360. fmadd f7, f27, f29, f7
  361. LFD f23, 3 * SIZE(BO)
  362. fmadd f11, f27, f30, f11
  363. fmadd f15, f27, f31, f15
  364. LFD f27, 7 * SIZE(AO)
  365. bdnz LL(KERNEL_MainLoop)
  366. .align 4
  367. LL(KERNEL_K_AND_7):
  368. andi. r0, K, 3
  369. lfd f30, ALPHA_R
  370. lfd f31, ALPHA_I
  371. mtspr CTR, r0
  372. ble LL(KERNEL_MainFinish)
  373. .align 4
  374. LL(KERNEL_SubLoop):
  375. fmadd f0, f16, f20, f0
  376. fmadd f4, f16, f21, f4
  377. fmadd f8, f16, f22, f8
  378. fmadd f12, f16, f23, f12
  379. LFD f16, 4 * SIZE(AO)
  380. fmadd f1, f17, f20, f1
  381. fmadd f5, f17, f21, f5
  382. fmadd f9, f17, f22, f9
  383. fmadd f13, f17, f23, f13
  384. LFD f17, 5 * SIZE(AO)
  385. fmadd f2, f18, f20, f2
  386. fmadd f6, f18, f21, f6
  387. fmadd f10, f18, f22, f10
  388. fmadd f14, f18, f23, f14
  389. LFD f18, 6 * SIZE(AO)
  390. fmadd f3, f19, f20, f3
  391. LFD f20, 4 * SIZE(BO)
  392. fmadd f7, f19, f21, f7
  393. LFD f21, 5 * SIZE(BO)
  394. fmadd f11, f19, f22, f11
  395. LFD f22, 6 * SIZE(BO)
  396. fmadd f15, f19, f23, f15
  397. LFD f19, 7 * SIZE(AO)
  398. LFD f23, 7 * SIZE(BO)
  399. addi BO, BO, 4 * SIZE
  400. addi AO, AO, 4 * SIZE
  401. bdnz LL(KERNEL_SubLoop)
  402. .align 4
  403. LL(KERNEL_MainFinish):
  404. LFD f16, 0 * SIZE(CO1)
  405. LFD f17, 1 * SIZE(CO1)
  406. LFD f18, 2 * SIZE(CO1)
  407. LFD f19, 3 * SIZE(CO1)
  408. #if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \
  409. defined(CC) || defined(CR) || defined(RC) || defined(RR)
  410. FSUB f0, f0, f5
  411. FADD f1, f1, f4
  412. FSUB f2, f2, f7
  413. FADD f3, f3, f6
  414. LFD f20, 0 * SIZE(CO2)
  415. LFD f21, 1 * SIZE(CO2)
  416. LFD f22, 2 * SIZE(CO2)
  417. LFD f23, 3 * SIZE(CO2)
  418. FSUB f8, f8, f13
  419. FADD f9, f9, f12
  420. FSUB f10, f10, f15
  421. FADD f11, f11, f14
  422. #elif defined(CN) || defined(CT) || defined(RN) || defined(RT)
  423. FADD f0, f0, f5
  424. FSUB f1, f1, f4
  425. FADD f2, f2, f7
  426. FSUB f3, f3, f6
  427. LFD f20, 0 * SIZE(CO2)
  428. LFD f21, 1 * SIZE(CO2)
  429. LFD f22, 2 * SIZE(CO2)
  430. LFD f23, 3 * SIZE(CO2)
  431. FADD f8, f8, f13
  432. FSUB f9, f9, f12
  433. FADD f10, f10, f15
  434. FSUB f11, f11, f14
  435. #else /* defined(NC) || defined(TC) || defined(NR) || defined(TR) */
  436. FADD f0, f0, f5
  437. FSUB f1, f4, f1
  438. FADD f2, f2, f7
  439. FSUB f3, f6, f3
  440. LFD f20, 0 * SIZE(CO2)
  441. LFD f21, 1 * SIZE(CO2)
  442. LFD f22, 2 * SIZE(CO2)
  443. LFD f23, 3 * SIZE(CO2)
  444. FADD f8, f8, f13
  445. FSUB f9, f12, f9
  446. FADD f10, f10, f15
  447. FSUB f11, f14, f11
  448. #endif
  449. #if defined(NN) || defined(NT) || defined(TN) || defined(TT)
  450. FMADD f16, f30, f0, f16
  451. FMADD f17, f30, f1, f17
  452. FMADD f18, f30, f2, f18
  453. FMADD f19, f30, f3, f19
  454. FMADD f20, f30, f8, f20
  455. FMADD f21, f30, f9, f21
  456. FMADD f22, f30, f10, f22
  457. FMADD f23, f30, f11, f23
  458. FNMSUB f16, f31, f1, f16
  459. FMADD f17, f31, f0, f17
  460. FNMSUB f18, f31, f3, f18
  461. FMADD f19, f31, f2, f19
  462. FNMSUB f20, f31, f9, f20
  463. FMADD f21, f31, f8, f21
  464. FNMSUB f22, f31, f11, f22
  465. FMADD f23, f31, f10, f23
  466. #else /* defined(CN)||defined(CT)||defined(NC)||defined(TC)||defined(CC) */
  467. /* defined(RN)||defined(RT)||defined(NR)||defined(TR)||defined(CR) */
  468. /* defined(RC)|| defined(RR) */
  469. FMADD f16, f30, f0, f16
  470. FNMSUB f17, f30, f1, f17
  471. FMADD f18, f30, f2, f18
  472. FNMSUB f19, f30, f3, f19
  473. FMADD f20, f30, f8, f20
  474. FNMSUB f21, f30, f9, f21
  475. FMADD f22, f30, f10, f22
  476. FNMSUB f23, f30, f11, f23
  477. FMADD f16, f31, f1, f16
  478. FMADD f17, f31, f0, f17
  479. FMADD f18, f31, f3, f18
  480. FMADD f19, f31, f2, f19
  481. FMADD f20, f31, f9, f20
  482. FMADD f21, f31, f8, f21
  483. FMADD f22, f31, f11, f22
  484. FMADD f23, f31, f10, f23
  485. #endif
  486. STFD f16, 0 * SIZE(CO1)
  487. STFD f17, 1 * SIZE(CO1)
  488. STFD f18, 2 * SIZE(CO1)
  489. STFD f19, 3 * SIZE(CO1)
  490. lfs f0, FZERO
  491. fmr f1, f0
  492. fmr f2, f0
  493. fmr f3, f0
  494. STFD f20, 0 * SIZE(CO2)
  495. STFD f21, 1 * SIZE(CO2)
  496. STFD f22, 2 * SIZE(CO2)
  497. STFD f23, 3 * SIZE(CO2)
  498. fmr f4, f0
  499. fmr f5, f0
  500. fmr f6, f0
  501. fmr f7, f0
  502. fmr f8, f0
  503. fmr f9, f0
  504. fmr f10, f0
  505. fmr f11, f0
  506. fmr f12, f0
  507. fmr f13, f0
  508. fmr f14, f0
  509. fmr f15, f0
  510. addi CO1, CO1, 4 * SIZE
  511. addi CO2, CO2, 4 * SIZE
  512. addic. I, I, -1
  513. bgt LL(KERNEL_MainSubHead)
  514. .align 4
  515. LL(KERNEL_M_AND_3):
  516. andi. I, M, 1
  517. ble LL(KERNEL_MainTail)
  518. .align 4
  519. LL(KERNEL_M_AND_3_SubHead):
  520. LFD f16, 0 * SIZE(AO)
  521. LFD f17, 1 * SIZE(AO)
  522. LFD f18, 2 * SIZE(AO)
  523. LFD f19, 3 * SIZE(AO)
  524. LFD f20, 0 * SIZE(B)
  525. LFD f21, 1 * SIZE(B)
  526. LFD f22, 2 * SIZE(B)
  527. LFD f23, 3 * SIZE(B)
  528. LFD f24, 4 * SIZE(B)
  529. LFD f25, 5 * SIZE(B)
  530. LFD f26, 6 * SIZE(B)
  531. LFD f27, 7 * SIZE(B)
  532. lfs f0, FZERO
  533. fmr f1, f0
  534. fmr f2, f0
  535. fmr f3, f0
  536. fmr f4, f0
  537. fmr f5, f0
  538. fmr f6, f0
  539. fmr f7, f0
  540. srawi. r0, K, 2
  541. mr BO, B
  542. mtspr CTR, r0
  543. ble LL(KERNEL_M_AND_3_K_AND_3)
  544. .align 4
  545. LL(KERNEL_M_AND_3_MainLoop):
  546. fmadd f0, f16, f20, f0
  547. fmadd f1, f16, f21, f1
  548. fmadd f2, f16, f22, f2
  549. fmadd f3, f16, f23, f3
  550. fmadd f4, f17, f20, f4
  551. fmadd f5, f17, f21, f5
  552. fmadd f6, f17, f22, f6
  553. fmadd f7, f17, f23, f7
  554. LFD f20, 8 * SIZE(BO)
  555. LFD f21, 9 * SIZE(BO)
  556. LFD f22, 10 * SIZE(BO)
  557. LFD f23, 11 * SIZE(BO)
  558. fmadd f0, f18, f24, f0
  559. fmadd f1, f18, f25, f1
  560. fmadd f2, f18, f26, f2
  561. fmadd f3, f18, f27, f3
  562. fmadd f4, f19, f24, f4
  563. fmadd f5, f19, f25, f5
  564. fmadd f6, f19, f26, f6
  565. fmadd f7, f19, f27, f7
  566. LFD f24, 12 * SIZE(BO)
  567. LFD f25, 13 * SIZE(BO)
  568. LFD f26, 14 * SIZE(BO)
  569. LFD f27, 15 * SIZE(BO)
  570. LFD f16, 4 * SIZE(AO)
  571. LFD f17, 5 * SIZE(AO)
  572. LFD f18, 6 * SIZE(AO)
  573. LFD f19, 7 * SIZE(AO)
  574. fmadd f0, f16, f20, f0
  575. fmadd f1, f16, f21, f1
  576. fmadd f2, f16, f22, f2
  577. fmadd f3, f16, f23, f3
  578. fmadd f4, f17, f20, f4
  579. fmadd f5, f17, f21, f5
  580. fmadd f6, f17, f22, f6
  581. fmadd f7, f17, f23, f7
  582. LFD f20, 16 * SIZE(BO)
  583. LFD f21, 17 * SIZE(BO)
  584. LFD f22, 18 * SIZE(BO)
  585. LFD f23, 19 * SIZE(BO)
  586. fmadd f0, f18, f24, f0
  587. fmadd f1, f18, f25, f1
  588. fmadd f2, f18, f26, f2
  589. fmadd f3, f18, f27, f3
  590. fmadd f4, f19, f24, f4
  591. fmadd f5, f19, f25, f5
  592. fmadd f6, f19, f26, f6
  593. fmadd f7, f19, f27, f7
  594. LFD f16, 8 * SIZE(AO)
  595. LFD f17, 9 * SIZE(AO)
  596. LFD f18, 10 * SIZE(AO)
  597. LFD f19, 11 * SIZE(AO)
  598. LFD f24, 20 * SIZE(BO)
  599. LFD f25, 21 * SIZE(BO)
  600. LFD f26, 22 * SIZE(BO)
  601. LFD f27, 23 * SIZE(BO)
  602. addi BO, BO, 16 * SIZE
  603. addi AO, AO, 8 * SIZE
  604. bdnz LL(KERNEL_M_AND_3_MainLoop)
  605. .align 4
  606. LL(KERNEL_M_AND_3_K_AND_3):
  607. andi. r0, K, 3
  608. lfd f30, ALPHA_R
  609. lfd f31, ALPHA_I
  610. mtspr CTR, r0
  611. ble LL(KERNEL_M_AND3_Finish)
  612. .align 4
  613. LL(KERNEL_M_AND_3_SubLoop):
  614. fmadd f0, f16, f20, f0
  615. fmadd f1, f16, f21, f1
  616. fmadd f2, f16, f22, f2
  617. fmadd f3, f16, f23, f3
  618. fmadd f4, f17, f20, f4
  619. fmadd f5, f17, f21, f5
  620. fmadd f6, f17, f22, f6
  621. fmadd f7, f17, f23, f7
  622. LFD f20, 4 * SIZE(BO)
  623. LFD f21, 5 * SIZE(BO)
  624. LFD f22, 6 * SIZE(BO)
  625. LFD f23, 7 * SIZE(BO)
  626. LFD f16, 2 * SIZE(AO)
  627. LFD f17, 3 * SIZE(AO)
  628. addi AO, AO, 2 * SIZE
  629. addi BO, BO, 4 * SIZE
  630. bdnz LL(KERNEL_M_AND_3_SubLoop)
  631. .align 4
  632. LL(KERNEL_M_AND3_Finish):
  633. #if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \
  634. defined(CC) || defined(CR) || defined(RC) || defined(RR)
  635. FSUB f0, f0, f5
  636. FADD f1, f1, f4
  637. FSUB f2, f2, f7
  638. FADD f3, f3, f6
  639. #elif defined(CN) || defined(CT) || defined(RN) || defined(RT)
  640. FADD f0, f0, f5
  641. FSUB f1, f4, f1
  642. FADD f2, f2, f7
  643. FSUB f3, f6, f3
  644. #else /* defined(NC) || defined(TC) || defined(NR) || defined(TR) */
  645. FADD f0, f0, f5
  646. FSUB f1, f1, f4
  647. FADD f2, f2, f7
  648. FSUB f3, f3, f6
  649. #endif
  650. LFD f16, 0 * SIZE(CO1)
  651. LFD f17, 1 * SIZE(CO1)
  652. LFD f18, 0 * SIZE(CO2)
  653. LFD f19, 1 * SIZE(CO2)
  654. #if defined(NN) || defined(NT) || defined(TN) || defined(TT)
  655. FMADD f16, f30, f0, f16
  656. FMADD f17, f30, f1, f17
  657. FMADD f18, f30, f2, f18
  658. FMADD f19, f30, f3, f19
  659. FNMSUB f16, f31, f1, f16
  660. FMADD f17, f31, f0, f17
  661. FNMSUB f18, f31, f3, f18
  662. FMADD f19, f31, f2, f19
  663. #else /* defined(CN)||defined(CT)||defined(NC)||defined(TC)||defined(CC) */
  664. /* defined(RN)||defined(RT)||defined(NR)||defined(TR)||defined(CR) */
  665. /* defined(RC)|| defined(RR) */
  666. FMADD f16, f30, f0, f16
  667. FNMSUB f17, f30, f1, f17
  668. FMADD f18, f30, f2, f18
  669. FNMSUB f19, f30, f3, f19
  670. FMADD f16, f31, f1, f16
  671. FMADD f17, f31, f0, f17
  672. FMADD f18, f31, f3, f18
  673. FMADD f19, f31, f2, f19
  674. #endif
  675. STFD f16, 0 * SIZE(CO1)
  676. STFD f17, 1 * SIZE(CO1)
  677. STFD f18, 0 * SIZE(CO2)
  678. STFD f19, 1 * SIZE(CO2)
  679. addi CO1, CO1, 2 * SIZE
  680. addi CO2, CO2, 2 * SIZE
  681. addic. I, I, -1
  682. bgt LL(KERNEL_M_AND_3_SubHead)
  683. .align 4
  684. LL(KERNEL_MainTail):
  685. mr B, BO
  686. addic. J, J, -1
  687. lfs f0, FZERO
  688. bgt LL(KERNEL_MainHead)
  689. .align 4
  690. LL(KERNEL_N_AND_3_HEAD):
  691. andi. J, N, 1
  692. ble LL(999)
  693. .align 4
  694. LL(KERNEL_N_AND_3_MainHead):
  695. srawi. I, M, 1
  696. mr CO1, C
  697. add C, C, LDC
  698. mr AO, A
  699. ble LL(KERNEL_MN_AND_3_Head)
  700. .align 4
  701. LL(KERNEL_N_AND_3_SubHead):
  702. LFD f20, 0 * SIZE(AO)
  703. LFD f21, 1 * SIZE(AO)
  704. LFD f22, 2 * SIZE(AO)
  705. LFD f23, 3 * SIZE(AO)
  706. LFD f24, 4 * SIZE(AO)
  707. LFD f25, 5 * SIZE(AO)
  708. LFD f26, 6 * SIZE(AO)
  709. LFD f27, 7 * SIZE(AO)
  710. LFD f16, 0 * SIZE(B)
  711. LFD f17, 1 * SIZE(B)
  712. LFD f18, 2 * SIZE(B)
  713. LFD f19, 3 * SIZE(B)
  714. lfs f0, FZERO
  715. fmr f1, f0
  716. fmr f2, f0
  717. fmr f3, f0
  718. fmr f4, f0
  719. fmr f5, f0
  720. fmr f6, f0
  721. fmr f7, f0
  722. srawi. r0, K, 2
  723. mr BO, B
  724. mtspr CTR, r0
  725. ble LL(KERNEL_N_AND_3_K_AND_3)
  726. .align 4
  727. LL(KERNEL_N_AND_3_MainLoop):
  728. fmadd f0, f16, f20, f0
  729. fmadd f1, f16, f21, f1
  730. fmadd f2, f16, f22, f2
  731. fmadd f3, f16, f23, f3
  732. fmadd f4, f17, f20, f4
  733. fmadd f5, f17, f21, f5
  734. fmadd f6, f17, f22, f6
  735. fmadd f7, f17, f23, f7
  736. LFD f20, 8 * SIZE(AO)
  737. LFD f21, 9 * SIZE(AO)
  738. LFD f22, 10 * SIZE(AO)
  739. LFD f23, 11 * SIZE(AO)
  740. fmadd f0, f18, f24, f0
  741. fmadd f1, f18, f25, f1
  742. fmadd f2, f18, f26, f2
  743. fmadd f3, f18, f27, f3
  744. fmadd f4, f19, f24, f4
  745. fmadd f5, f19, f25, f5
  746. fmadd f6, f19, f26, f6
  747. fmadd f7, f19, f27, f7
  748. LFD f24, 12 * SIZE(AO)
  749. LFD f25, 13 * SIZE(AO)
  750. LFD f26, 14 * SIZE(AO)
  751. LFD f27, 15 * SIZE(AO)
  752. LFD f16, 4 * SIZE(BO)
  753. LFD f17, 5 * SIZE(BO)
  754. LFD f18, 6 * SIZE(BO)
  755. LFD f19, 7 * SIZE(BO)
  756. fmadd f0, f16, f20, f0
  757. fmadd f1, f16, f21, f1
  758. fmadd f2, f16, f22, f2
  759. fmadd f3, f16, f23, f3
  760. fmadd f4, f17, f20, f4
  761. fmadd f5, f17, f21, f5
  762. fmadd f6, f17, f22, f6
  763. fmadd f7, f17, f23, f7
  764. LFD f20, 16 * SIZE(AO)
  765. LFD f21, 17 * SIZE(AO)
  766. LFD f22, 18 * SIZE(AO)
  767. LFD f23, 19 * SIZE(AO)
  768. fmadd f0, f18, f24, f0
  769. fmadd f1, f18, f25, f1
  770. fmadd f2, f18, f26, f2
  771. fmadd f3, f18, f27, f3
  772. fmadd f4, f19, f24, f4
  773. fmadd f5, f19, f25, f5
  774. fmadd f6, f19, f26, f6
  775. fmadd f7, f19, f27, f7
  776. LFD f24, 20 * SIZE(AO)
  777. LFD f25, 21 * SIZE(AO)
  778. LFD f26, 22 * SIZE(AO)
  779. LFD f27, 23 * SIZE(AO)
  780. LFD f16, 8 * SIZE(BO)
  781. LFD f17, 9 * SIZE(BO)
  782. LFD f18, 10 * SIZE(BO)
  783. LFD f19, 11 * SIZE(BO)
  784. addi AO, AO, 16 * SIZE
  785. addi BO, BO, 8 * SIZE
  786. dcbt PREA, AO
  787. dcbt PREA, BO
  788. bdnz LL(KERNEL_N_AND_3_MainLoop)
  789. .align 4
  790. LL(KERNEL_N_AND_3_K_AND_3):
  791. andi. r0, K, 3
  792. lfd f30, ALPHA_R
  793. lfd f31, ALPHA_I
  794. mtspr CTR, r0
  795. ble LL(KERNEL_N_AND_3_Finish)
  796. .align 4
  797. LL(KERNEL_N_AND_3_SubLoop):
  798. fmadd f0, f16, f20, f0
  799. fmadd f1, f16, f21, f1
  800. fmadd f2, f16, f22, f2
  801. fmadd f3, f16, f23, f3
  802. fmadd f4, f17, f20, f4
  803. fmadd f5, f17, f21, f5
  804. fmadd f6, f17, f22, f6
  805. fmadd f7, f17, f23, f7
  806. LFD f20, 4 * SIZE(AO)
  807. LFD f21, 5 * SIZE(AO)
  808. LFD f22, 6 * SIZE(AO)
  809. LFD f23, 7 * SIZE(AO)
  810. LFD f16, 2 * SIZE(BO)
  811. LFD f17, 3 * SIZE(BO)
  812. addi BO, BO, 2 * SIZE
  813. addi AO, AO, 4 * SIZE
  814. bdnz LL(KERNEL_N_AND_3_SubLoop)
  815. .align 4
  816. LL(KERNEL_N_AND_3_Finish):
  817. #if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \
  818. defined(CC) || defined(CR) || defined(RC) || defined(RR)
  819. FSUB f0, f0, f5
  820. FADD f1, f1, f4
  821. FSUB f2, f2, f7
  822. FADD f3, f3, f6
  823. #elif defined(CN) || defined(CT) || defined(RN) || defined(RT)
  824. FADD f0, f0, f5
  825. FSUB f1, f1, f4
  826. FADD f2, f2, f7
  827. FSUB f3, f3, f6
  828. #else /* defined(NC) || defined(TC) || defined(NR) || defined(TR) */
  829. FADD f0, f0, f5
  830. FSUB f1, f4, f1
  831. FADD f2, f2, f7
  832. FSUB f3, f6, f3
  833. #endif
  834. LFD f16, 0 * SIZE(CO1)
  835. LFD f17, 1 * SIZE(CO1)
  836. LFD f18, 2 * SIZE(CO1)
  837. LFD f19, 3 * SIZE(CO1)
  838. #if defined(NN) || defined(NT) || defined(TN) || defined(TT)
  839. FMADD f16, f30, f0, f16
  840. FMADD f17, f30, f1, f17
  841. FMADD f18, f30, f2, f18
  842. FMADD f19, f30, f3, f19
  843. FNMSUB f16, f31, f1, f16
  844. FMADD f17, f31, f0, f17
  845. FNMSUB f18, f31, f3, f18
  846. FMADD f19, f31, f2, f19
  847. #else /* defined(CN)||defined(CT)||defined(NC)||defined(TC)||defined(CC) */
  848. /* defined(RN)||defined(RT)||defined(NR)||defined(TR)||defined(CR) */
  849. /* defined(RC)|| defined(RR) */
  850. FMADD f16, f30, f0, f16
  851. FNMSUB f17, f30, f1, f17
  852. FMADD f18, f30, f2, f18
  853. FNMSUB f19, f30, f3, f19
  854. FMADD f16, f31, f1, f16
  855. FMADD f17, f31, f0, f17
  856. FMADD f18, f31, f3, f18
  857. FMADD f19, f31, f2, f19
  858. #endif
  859. STFD f16, 0 * SIZE(CO1)
  860. STFD f17, 1 * SIZE(CO1)
  861. STFD f18, 2 * SIZE(CO1)
  862. STFD f19, 3 * SIZE(CO1)
  863. addi CO1, CO1, 4 * SIZE
  864. addic. I, I, -1
  865. bgt LL(KERNEL_N_AND_3_SubHead)
  866. .align 4
  867. LL(KERNEL_MN_AND_3_Head):
  868. andi. I, M, 1
  869. ble LL(KERNEL_SubEnd)
  870. .align 4
  871. LL(KERNEL_MN_AND_3_SubHead):
  872. LFD f16, 0 * SIZE(AO)
  873. LFD f17, 1 * SIZE(AO)
  874. LFD f18, 2 * SIZE(AO)
  875. LFD f19, 3 * SIZE(AO)
  876. LFD f20, 0 * SIZE(B)
  877. LFD f21, 1 * SIZE(B)
  878. LFD f22, 2 * SIZE(B)
  879. LFD f23, 3 * SIZE(B)
  880. lfs f0, FZERO
  881. fmr f1, f0
  882. fmr f2, f0
  883. fmr f3, f0
  884. fmr f4, f0
  885. fmr f5, f0
  886. fmr f6, f0
  887. fmr f7, f0
  888. srawi. r0, K, 2
  889. mr BO, B
  890. mtspr CTR, r0
  891. ble LL(KERNEL_MN_AND_3_K_AND_3)
  892. .align 4
  893. LL(KERNEL_MN_AND_3_MainLoop):
  894. fmadd f0, f16, f20, f0
  895. fmadd f1, f17, f21, f1
  896. fmadd f2, f17, f20, f2
  897. fmadd f3, f16, f21, f3
  898. LFD f16, 4 * SIZE(AO)
  899. LFD f17, 5 * SIZE(AO)
  900. LFD f20, 4 * SIZE(BO)
  901. LFD f21, 5 * SIZE(BO)
  902. fmadd f4, f18, f22, f4
  903. fmadd f5, f19, f23, f5
  904. fmadd f6, f19, f22, f6
  905. fmadd f7, f18, f23, f7
  906. LFD f18, 6 * SIZE(AO)
  907. LFD f19, 7 * SIZE(AO)
  908. LFD f22, 6 * SIZE(BO)
  909. LFD f23, 7 * SIZE(BO)
  910. fmadd f0, f16, f20, f0
  911. fmadd f1, f17, f21, f1
  912. fmadd f2, f17, f20, f2
  913. fmadd f3, f16, f21, f3
  914. LFD f16, 8 * SIZE(AO)
  915. LFD f17, 9 * SIZE(AO)
  916. LFD f20, 8 * SIZE(BO)
  917. LFD f21, 9 * SIZE(BO)
  918. fmadd f4, f18, f22, f4
  919. fmadd f5, f19, f23, f5
  920. fmadd f6, f19, f22, f6
  921. fmadd f7, f18, f23, f7
  922. LFD f18, 10 * SIZE(AO)
  923. LFD f19, 11 * SIZE(AO)
  924. LFD f22, 10 * SIZE(BO)
  925. LFD f23, 11 * SIZE(BO)
  926. addi AO, AO, 8 * SIZE
  927. addi BO, BO, 8 * SIZE
  928. bdnz LL(KERNEL_MN_AND_3_MainLoop)
  929. .align 4
  930. LL(KERNEL_MN_AND_3_K_AND_3):
  931. fadd f0, f0, f4
  932. fadd f1, f1, f5
  933. fadd f2, f2, f6
  934. fadd f3, f3, f7
  935. andi. r0, K, 3
  936. lfd f30, ALPHA_R
  937. lfd f31, ALPHA_I
  938. mtspr CTR,r0
  939. ble LL(KERNEL_MN_AND_3_Finish)
  940. .align 4
  941. LL(KERNEL_MN_AND_3_SubLoop):
  942. fmadd f0, f16, f20, f0
  943. fmadd f1, f17, f21, f1
  944. fmadd f2, f17, f20, f2
  945. fmadd f3, f16, f21, f3
  946. LFD f16, 2 * SIZE(AO)
  947. LFD f17, 3 * SIZE(AO)
  948. LFD f20, 2 * SIZE(BO)
  949. LFD f21, 3 * SIZE(BO)
  950. addi AO, AO, 2 * SIZE
  951. addi BO, BO, 2 * SIZE
  952. bdnz LL(KERNEL_MN_AND_3_SubLoop)
  953. .align 4
  954. LL(KERNEL_MN_AND_3_Finish):
  955. #if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \
  956. defined(CC) || defined(CR) || defined(RC) || defined(RR)
  957. fsub f0, f0, f1
  958. fadd f2, f2, f3
  959. #elif defined(CN) || defined(CT) || defined(RN) || defined(RT)
  960. fadd f0, f0, f1
  961. fsub f2, f2, f3
  962. #else
  963. fadd f0, f0, f1
  964. fsub f2, f3, f2
  965. #endif
  966. LFD f16, 0 * SIZE(CO1)
  967. LFD f17, 1 * SIZE(CO1)
  968. #if defined(NN) || defined(NT) || defined(TN) || defined(TT)
  969. FMADD f16, f30, f0, f16
  970. FMADD f17, f30, f2, f17
  971. FNMSUB f16, f31, f2, f16
  972. FMADD f17, f31, f0, f17
  973. #else /* defined(CN)||defined(CT)||defined(NC)||defined(TC)||defined(CC) */
  974. /* defined(RN)||defined(RT)||defined(NR)||defined(TR)||defined(CR) */
  975. /* defined(RC) || defined(RR) */
  976. FMADD f16, f30, f0, f16
  977. FNMSUB f17, f30, f2, f17
  978. FMADD f16, f31, f2, f16
  979. FMADD f17, f31, f0, f17
  980. #endif
  981. STFD f16, 0 * SIZE(CO1)
  982. STFD f17, 1 * SIZE(CO1)
  983. addi CO1, CO1, 2 * SIZE
  984. addic. I, I, -1
  985. bgt LL(KERNEL_MN_AND_3_SubHead)
  986. .align 4
  987. LL(KERNEL_SubEnd):
  988. mr B, BO
  989. addic. J, J, -1
  990. bgt LL(KERNEL_N_AND_3_MainHead)
  991. .align 4
  992. LL(999):
  993. addi r3, 0, 0
  994. lfd f14, 0(SP)
  995. lfd f15, 8(SP)
  996. lfd f16, 16(SP)
  997. lfd f17, 24(SP)
  998. lfd f18, 32(SP)
  999. lfd f19, 40(SP)
  1000. lfd f20, 48(SP)
  1001. lfd f21, 56(SP)
  1002. lfd f22, 64(SP)
  1003. lfd f23, 72(SP)
  1004. lfd f24, 80(SP)
  1005. lfd f25, 88(SP)
  1006. lfd f26, 96(SP)
  1007. lfd f27, 104(SP)
  1008. lfd f28, 112(SP)
  1009. lfd f29, 120(SP)
  1010. lfd f30, 128(SP)
  1011. lfd f31, 136(SP)
  1012. #ifdef __64BIT__
  1013. ld r31, 144(SP)
  1014. ld r30, 152(SP)
  1015. ld r29, 160(SP)
  1016. ld r28, 168(SP)
  1017. ld r27, 176(SP)
  1018. ld r26, 184(SP)
  1019. ld r25, 192(SP)
  1020. ld r24, 200(SP)
  1021. #else
  1022. lwz r31, 144(SP)
  1023. lwz r30, 148(SP)
  1024. lwz r29, 152(SP)
  1025. lwz r28, 156(SP)
  1026. lwz r27, 160(SP)
  1027. lwz r26, 164(SP)
  1028. lwz r25, 168(SP)
  1029. lwz r24, 172(SP)
  1030. #endif
  1031. addi SP, SP, STACKSIZE
  1032. blr
  1033. EPILOGUE
  1034. #endif