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.

param.h 89 kB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
5 years ago
12 years ago
12 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12 years ago
12 years ago
12 years ago
5 years ago
5 years ago
12 years ago
5 years ago
5 years ago
12 years ago
5 years ago
12 years ago
5 years ago
5 years ago
5 years ago
12 years ago
6 years ago
12 years ago
12 years ago
12 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
12 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
12 years ago
12 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742
  1. /*****************************************************************************
  2. Copyright (c) 2011-2014, The OpenBLAS Project
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are
  6. met:
  7. 1. Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in
  11. the documentation and/or other materials provided with the
  12. distribution.
  13. 3. Neither the name of the OpenBLAS project nor the names of
  14. its contributors may be used to endorse or promote products
  15. derived from this software without specific prior written
  16. permission.
  17. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  18. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  21. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  23. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  24. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  25. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  26. USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. **********************************************************************************/
  28. /*********************************************************************/
  29. /* Copyright 2009, 2010 The University of Texas at Austin. */
  30. /* All rights reserved. */
  31. /* */
  32. /* Redistribution and use in source and binary forms, with or */
  33. /* without modification, are permitted provided that the following */
  34. /* conditions are met: */
  35. /* */
  36. /* 1. Redistributions of source code must retain the above */
  37. /* copyright notice, this list of conditions and the following */
  38. /* disclaimer. */
  39. /* */
  40. /* 2. Redistributions in binary form must reproduce the above */
  41. /* copyright notice, this list of conditions and the following */
  42. /* disclaimer in the documentation and/or other materials */
  43. /* provided with the distribution. */
  44. /* */
  45. /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
  46. /* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  47. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  48. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  49. /* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
  50. /* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
  51. /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
  52. /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
  53. /* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
  54. /* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
  55. /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
  56. /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
  57. /* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  58. /* POSSIBILITY OF SUCH DAMAGE. */
  59. /* */
  60. /* The views and conclusions contained in the software and */
  61. /* documentation are those of the authors and should not be */
  62. /* interpreted as representing official policies, either expressed */
  63. /* or implied, of The University of Texas at Austin. */
  64. /*********************************************************************/
  65. #ifndef PARAM_H
  66. #define PARAM_H
  67. #define SBGEMM_DEFAULT_UNROLL_N 4
  68. #define SBGEMM_DEFAULT_UNROLL_M 8
  69. #define SBGEMM_DEFAULT_UNROLL_MN 32
  70. #define SBGEMM_DEFAULT_P 256
  71. #define SBGEMM_DEFAULT_R 256
  72. #define SBGEMM_DEFAULT_Q 256
  73. #ifdef OPTERON
  74. #define SNUMOPT 4
  75. #define DNUMOPT 2
  76. #define GEMM_DEFAULT_OFFSET_A 64
  77. #define GEMM_DEFAULT_OFFSET_B 256
  78. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x01ffffUL
  79. #define SGEMM_DEFAULT_UNROLL_N 4
  80. #define DGEMM_DEFAULT_UNROLL_N 4
  81. #define QGEMM_DEFAULT_UNROLL_N 2
  82. #define CGEMM_DEFAULT_UNROLL_N 2
  83. #define ZGEMM_DEFAULT_UNROLL_N 2
  84. #define XGEMM_DEFAULT_UNROLL_N 1
  85. #ifdef ARCH_X86
  86. #define SGEMM_DEFAULT_UNROLL_M 4
  87. #define DGEMM_DEFAULT_UNROLL_M 2
  88. #define QGEMM_DEFAULT_UNROLL_M 2
  89. #define CGEMM_DEFAULT_UNROLL_M 2
  90. #define ZGEMM_DEFAULT_UNROLL_M 1
  91. #define XGEMM_DEFAULT_UNROLL_M 1
  92. #else
  93. #define SGEMM_DEFAULT_UNROLL_M 8
  94. #define DGEMM_DEFAULT_UNROLL_M 4
  95. #define QGEMM_DEFAULT_UNROLL_M 2
  96. #define CGEMM_DEFAULT_UNROLL_M 4
  97. #define ZGEMM_DEFAULT_UNROLL_M 2
  98. #define XGEMM_DEFAULT_UNROLL_M 1
  99. #endif
  100. #define SGEMM_DEFAULT_P sgemm_p
  101. #define DGEMM_DEFAULT_P dgemm_p
  102. #define QGEMM_DEFAULT_P qgemm_p
  103. #define CGEMM_DEFAULT_P cgemm_p
  104. #define ZGEMM_DEFAULT_P zgemm_p
  105. #define XGEMM_DEFAULT_P xgemm_p
  106. #define SGEMM_DEFAULT_R sgemm_r
  107. #define DGEMM_DEFAULT_R dgemm_r
  108. #define QGEMM_DEFAULT_R qgemm_r
  109. #define CGEMM_DEFAULT_R cgemm_r
  110. #define ZGEMM_DEFAULT_R zgemm_r
  111. #define XGEMM_DEFAULT_R xgemm_r
  112. #ifdef ALLOC_HUGETLB
  113. #define SGEMM_DEFAULT_Q 248
  114. #define DGEMM_DEFAULT_Q 248
  115. #define QGEMM_DEFAULT_Q 248
  116. #define CGEMM_DEFAULT_Q 248
  117. #define ZGEMM_DEFAULT_Q 248
  118. #define XGEMM_DEFAULT_Q 248
  119. #else
  120. #define SGEMM_DEFAULT_Q 240
  121. #define DGEMM_DEFAULT_Q 240
  122. #define QGEMM_DEFAULT_Q 240
  123. #define CGEMM_DEFAULT_Q 240
  124. #define ZGEMM_DEFAULT_Q 240
  125. #define XGEMM_DEFAULT_Q 240
  126. #endif
  127. #define SYMV_P 16
  128. #define HAVE_EXCLUSIVE_CACHE
  129. #endif
  130. #if defined(BARCELONA) || defined(SHANGHAI) || defined(BOBCAT)
  131. #define SNUMOPT 8
  132. #define DNUMOPT 4
  133. #define GEMM_DEFAULT_OFFSET_A 64
  134. #define GEMM_DEFAULT_OFFSET_B 832
  135. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0fffUL
  136. #define SGEMM_DEFAULT_UNROLL_N 4
  137. #define DGEMM_DEFAULT_UNROLL_N 4
  138. #define QGEMM_DEFAULT_UNROLL_N 2
  139. #define CGEMM_DEFAULT_UNROLL_N 2
  140. #define ZGEMM_DEFAULT_UNROLL_N 2
  141. #define XGEMM_DEFAULT_UNROLL_N 1
  142. #ifdef ARCH_X86
  143. #define SGEMM_DEFAULT_UNROLL_M 4
  144. #define DGEMM_DEFAULT_UNROLL_M 2
  145. #define QGEMM_DEFAULT_UNROLL_M 2
  146. #define CGEMM_DEFAULT_UNROLL_M 2
  147. #define ZGEMM_DEFAULT_UNROLL_M 1
  148. #define XGEMM_DEFAULT_UNROLL_M 1
  149. #else
  150. #define SGEMM_DEFAULT_UNROLL_M 8
  151. #define DGEMM_DEFAULT_UNROLL_M 4
  152. #define QGEMM_DEFAULT_UNROLL_M 2
  153. #define CGEMM_DEFAULT_UNROLL_M 4
  154. #define ZGEMM_DEFAULT_UNROLL_M 2
  155. #define XGEMM_DEFAULT_UNROLL_M 1
  156. #endif
  157. #if 0
  158. #define SGEMM_DEFAULT_P 496
  159. #define DGEMM_DEFAULT_P 248
  160. #define QGEMM_DEFAULT_P 124
  161. #define CGEMM_DEFAULT_P 248
  162. #define ZGEMM_DEFAULT_P 124
  163. #define XGEMM_DEFAULT_P 62
  164. #define SGEMM_DEFAULT_Q 248
  165. #define DGEMM_DEFAULT_Q 248
  166. #define QGEMM_DEFAULT_Q 248
  167. #define CGEMM_DEFAULT_Q 248
  168. #define ZGEMM_DEFAULT_Q 248
  169. #define XGEMM_DEFAULT_Q 248
  170. #else
  171. #define SGEMM_DEFAULT_P 448
  172. #define DGEMM_DEFAULT_P 224
  173. #define QGEMM_DEFAULT_P 112
  174. #define CGEMM_DEFAULT_P 224
  175. #define ZGEMM_DEFAULT_P 112
  176. #define XGEMM_DEFAULT_P 56
  177. #define SGEMM_DEFAULT_Q 224
  178. #define DGEMM_DEFAULT_Q 224
  179. #define QGEMM_DEFAULT_Q 224
  180. #define CGEMM_DEFAULT_Q 224
  181. #define ZGEMM_DEFAULT_Q 224
  182. #define XGEMM_DEFAULT_Q 224
  183. #endif
  184. #define SGEMM_DEFAULT_R sgemm_r
  185. #define QGEMM_DEFAULT_R qgemm_r
  186. #define DGEMM_DEFAULT_R dgemm_r
  187. #define CGEMM_DEFAULT_R cgemm_r
  188. #define ZGEMM_DEFAULT_R zgemm_r
  189. #define XGEMM_DEFAULT_R xgemm_r
  190. #define SYMV_P 16
  191. #define HAVE_EXCLUSIVE_CACHE
  192. #define GEMM_THREAD gemm_thread_mn
  193. #endif
  194. #ifdef BULLDOZER
  195. #define SNUMOPT 8
  196. #define DNUMOPT 4
  197. #define GEMM_DEFAULT_OFFSET_A 64
  198. #define GEMM_DEFAULT_OFFSET_B 832
  199. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0fffUL
  200. #define QGEMM_DEFAULT_UNROLL_N 2
  201. #define CGEMM_DEFAULT_UNROLL_N 2
  202. #define ZGEMM_DEFAULT_UNROLL_N 2
  203. #define XGEMM_DEFAULT_UNROLL_N 1
  204. #ifdef ARCH_X86
  205. #define SGEMM_DEFAULT_UNROLL_N 4
  206. #define DGEMM_DEFAULT_UNROLL_N 4
  207. #define SGEMM_DEFAULT_UNROLL_M 4
  208. #define DGEMM_DEFAULT_UNROLL_M 2
  209. #define QGEMM_DEFAULT_UNROLL_M 2
  210. #define CGEMM_DEFAULT_UNROLL_M 2
  211. #define ZGEMM_DEFAULT_UNROLL_M 1
  212. #define XGEMM_DEFAULT_UNROLL_M 1
  213. #else
  214. #define SGEMM_DEFAULT_UNROLL_N 2
  215. #define DGEMM_DEFAULT_UNROLL_N 2
  216. #define SGEMM_DEFAULT_UNROLL_M 16
  217. #define DGEMM_DEFAULT_UNROLL_M 8
  218. #define QGEMM_DEFAULT_UNROLL_M 2
  219. #define CGEMM_DEFAULT_UNROLL_M 4
  220. #define ZGEMM_DEFAULT_UNROLL_M 2
  221. #define XGEMM_DEFAULT_UNROLL_M 1
  222. #define CGEMM3M_DEFAULT_UNROLL_N 4
  223. #define CGEMM3M_DEFAULT_UNROLL_M 8
  224. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  225. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  226. #define DGEMM_DEFAULT_UNROLL_MN 16
  227. #define GEMV_UNROLL 8
  228. #endif
  229. #if defined(ARCH_X86_64)
  230. #define SGEMM_DEFAULT_P 768
  231. #define DGEMM_DEFAULT_P 384
  232. #else
  233. #define SGEMM_DEFAULT_P 448
  234. #define DGEMM_DEFAULT_P 224
  235. #endif
  236. #define QGEMM_DEFAULT_P 112
  237. #define CGEMM_DEFAULT_P 224
  238. #define ZGEMM_DEFAULT_P 112
  239. #define XGEMM_DEFAULT_P 56
  240. #if defined(ARCH_X86_64)
  241. #define SGEMM_DEFAULT_Q 168
  242. #define DGEMM_DEFAULT_Q 168
  243. #else
  244. #define SGEMM_DEFAULT_Q 224
  245. #define DGEMM_DEFAULT_Q 224
  246. #endif
  247. #define QGEMM_DEFAULT_Q 224
  248. #define CGEMM_DEFAULT_Q 224
  249. #define ZGEMM_DEFAULT_Q 224
  250. #define XGEMM_DEFAULT_Q 224
  251. #define CGEMM3M_DEFAULT_P 448
  252. #define ZGEMM3M_DEFAULT_P 224
  253. #define XGEMM3M_DEFAULT_P 112
  254. #define CGEMM3M_DEFAULT_Q 224
  255. #define ZGEMM3M_DEFAULT_Q 224
  256. #define XGEMM3M_DEFAULT_Q 224
  257. #define CGEMM3M_DEFAULT_R 12288
  258. #define ZGEMM3M_DEFAULT_R 12288
  259. #define XGEMM3M_DEFAULT_R 12288
  260. #define SGEMM_DEFAULT_R sgemm_r
  261. #define QGEMM_DEFAULT_R qgemm_r
  262. #define DGEMM_DEFAULT_R dgemm_r
  263. #define CGEMM_DEFAULT_R cgemm_r
  264. #define ZGEMM_DEFAULT_R zgemm_r
  265. #define XGEMM_DEFAULT_R xgemm_r
  266. #define SYMV_P 16
  267. #define HAVE_EXCLUSIVE_CACHE
  268. #define GEMM_THREAD gemm_thread_mn
  269. #endif
  270. #ifdef PILEDRIVER
  271. #define SNUMOPT 8
  272. #define DNUMOPT 4
  273. #define GEMM_DEFAULT_OFFSET_A 64
  274. #define GEMM_DEFAULT_OFFSET_B 832
  275. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0fffUL
  276. #define QGEMM_DEFAULT_UNROLL_N 2
  277. #define CGEMM_DEFAULT_UNROLL_N 2
  278. #define ZGEMM_DEFAULT_UNROLL_N 2
  279. #define XGEMM_DEFAULT_UNROLL_N 1
  280. #ifdef ARCH_X86
  281. #define SGEMM_DEFAULT_UNROLL_N 4
  282. #define DGEMM_DEFAULT_UNROLL_N 4
  283. #define SGEMM_DEFAULT_UNROLL_M 4
  284. #define DGEMM_DEFAULT_UNROLL_M 2
  285. #define QGEMM_DEFAULT_UNROLL_M 2
  286. #define CGEMM_DEFAULT_UNROLL_M 2
  287. #define ZGEMM_DEFAULT_UNROLL_M 1
  288. #define XGEMM_DEFAULT_UNROLL_M 1
  289. #else
  290. #define SGEMM_DEFAULT_UNROLL_N 2
  291. #define DGEMM_DEFAULT_UNROLL_N 2
  292. #define SGEMM_DEFAULT_UNROLL_M 16
  293. #define DGEMM_DEFAULT_UNROLL_M 8
  294. #define QGEMM_DEFAULT_UNROLL_M 2
  295. #define CGEMM_DEFAULT_UNROLL_M 4
  296. #define ZGEMM_DEFAULT_UNROLL_M 2
  297. #define XGEMM_DEFAULT_UNROLL_M 1
  298. #define CGEMM3M_DEFAULT_UNROLL_N 4
  299. #define CGEMM3M_DEFAULT_UNROLL_M 8
  300. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  301. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  302. #define GEMV_UNROLL 8
  303. #endif
  304. #if defined(ARCH_X86_64)
  305. #define SGEMM_DEFAULT_P 768
  306. #define DGEMM_DEFAULT_P 768
  307. #define ZGEMM_DEFAULT_P 384
  308. #define CGEMM_DEFAULT_P 768
  309. #else
  310. #define SGEMM_DEFAULT_P 448
  311. #define DGEMM_DEFAULT_P 480
  312. #define ZGEMM_DEFAULT_P 112
  313. #define CGEMM_DEFAULT_P 224
  314. #endif
  315. #define QGEMM_DEFAULT_P 112
  316. #define XGEMM_DEFAULT_P 56
  317. #if defined(ARCH_X86_64)
  318. #define SGEMM_DEFAULT_Q 192
  319. #define DGEMM_DEFAULT_Q 168
  320. #define ZGEMM_DEFAULT_Q 168
  321. #define CGEMM_DEFAULT_Q 168
  322. #else
  323. #define SGEMM_DEFAULT_Q 224
  324. #define DGEMM_DEFAULT_Q 224
  325. #define ZGEMM_DEFAULT_Q 224
  326. #define CGEMM_DEFAULT_Q 224
  327. #endif
  328. #define QGEMM_DEFAULT_Q 224
  329. #define XGEMM_DEFAULT_Q 224
  330. #define CGEMM3M_DEFAULT_P 448
  331. #define ZGEMM3M_DEFAULT_P 224
  332. #define XGEMM3M_DEFAULT_P 112
  333. #define CGEMM3M_DEFAULT_Q 224
  334. #define ZGEMM3M_DEFAULT_Q 224
  335. #define XGEMM3M_DEFAULT_Q 224
  336. #define CGEMM3M_DEFAULT_R 12288
  337. #define ZGEMM3M_DEFAULT_R 12288
  338. #define XGEMM3M_DEFAULT_R 12288
  339. #define SGEMM_DEFAULT_R 12288
  340. #define QGEMM_DEFAULT_R qgemm_r
  341. #define DGEMM_DEFAULT_R 12288
  342. #define CGEMM_DEFAULT_R cgemm_r
  343. #define ZGEMM_DEFAULT_R zgemm_r
  344. #define XGEMM_DEFAULT_R xgemm_r
  345. #define SYMV_P 16
  346. #define HAVE_EXCLUSIVE_CACHE
  347. #define GEMM_THREAD gemm_thread_mn
  348. #endif
  349. #ifdef STEAMROLLER
  350. #define SNUMOPT 8
  351. #define DNUMOPT 4
  352. #define GEMM_DEFAULT_OFFSET_A 64
  353. #define GEMM_DEFAULT_OFFSET_B 832
  354. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0fffUL
  355. #define QGEMM_DEFAULT_UNROLL_N 2
  356. #define CGEMM_DEFAULT_UNROLL_N 2
  357. #define ZGEMM_DEFAULT_UNROLL_N 2
  358. #define XGEMM_DEFAULT_UNROLL_N 1
  359. #ifdef ARCH_X86
  360. #define SGEMM_DEFAULT_UNROLL_N 4
  361. #define DGEMM_DEFAULT_UNROLL_N 4
  362. #define SGEMM_DEFAULT_UNROLL_M 4
  363. #define DGEMM_DEFAULT_UNROLL_M 2
  364. #define QGEMM_DEFAULT_UNROLL_M 2
  365. #define CGEMM_DEFAULT_UNROLL_M 2
  366. #define ZGEMM_DEFAULT_UNROLL_M 1
  367. #define XGEMM_DEFAULT_UNROLL_M 1
  368. #else
  369. #define SGEMM_DEFAULT_UNROLL_N 2
  370. #define DGEMM_DEFAULT_UNROLL_N 2
  371. #define SGEMM_DEFAULT_UNROLL_M 16
  372. #define DGEMM_DEFAULT_UNROLL_M 8
  373. #define QGEMM_DEFAULT_UNROLL_M 2
  374. #define CGEMM_DEFAULT_UNROLL_M 4
  375. #define ZGEMM_DEFAULT_UNROLL_M 2
  376. #define XGEMM_DEFAULT_UNROLL_M 1
  377. #define CGEMM3M_DEFAULT_UNROLL_N 4
  378. #define CGEMM3M_DEFAULT_UNROLL_M 8
  379. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  380. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  381. #define GEMV_UNROLL 8
  382. #endif
  383. #if defined(ARCH_X86_64)
  384. #define SGEMM_DEFAULT_P 768
  385. #define DGEMM_DEFAULT_P 576
  386. #define ZGEMM_DEFAULT_P 288
  387. #define CGEMM_DEFAULT_P 576
  388. #else
  389. #define SGEMM_DEFAULT_P 448
  390. #define DGEMM_DEFAULT_P 480
  391. #define ZGEMM_DEFAULT_P 112
  392. #define CGEMM_DEFAULT_P 224
  393. #endif
  394. #define QGEMM_DEFAULT_P 112
  395. #define XGEMM_DEFAULT_P 56
  396. #if defined(ARCH_X86_64)
  397. #define SGEMM_DEFAULT_Q 192
  398. #define DGEMM_DEFAULT_Q 160
  399. #define ZGEMM_DEFAULT_Q 160
  400. #define CGEMM_DEFAULT_Q 160
  401. #else
  402. #define SGEMM_DEFAULT_Q 224
  403. #define DGEMM_DEFAULT_Q 224
  404. #define ZGEMM_DEFAULT_Q 224
  405. #define CGEMM_DEFAULT_Q 224
  406. #endif
  407. #define QGEMM_DEFAULT_Q 224
  408. #define XGEMM_DEFAULT_Q 224
  409. #define CGEMM3M_DEFAULT_P 448
  410. #define ZGEMM3M_DEFAULT_P 224
  411. #define XGEMM3M_DEFAULT_P 112
  412. #define CGEMM3M_DEFAULT_Q 224
  413. #define ZGEMM3M_DEFAULT_Q 224
  414. #define XGEMM3M_DEFAULT_Q 224
  415. #define CGEMM3M_DEFAULT_R 12288
  416. #define ZGEMM3M_DEFAULT_R 12288
  417. #define XGEMM3M_DEFAULT_R 12288
  418. #define SGEMM_DEFAULT_R 12288
  419. #define QGEMM_DEFAULT_R qgemm_r
  420. #define DGEMM_DEFAULT_R 12288
  421. #define CGEMM_DEFAULT_R cgemm_r
  422. #define ZGEMM_DEFAULT_R zgemm_r
  423. #define XGEMM_DEFAULT_R xgemm_r
  424. #define SYMV_P 16
  425. #define HAVE_EXCLUSIVE_CACHE
  426. #define GEMM_THREAD gemm_thread_mn
  427. #endif
  428. #ifdef EXCAVATOR
  429. #define SNUMOPT 8
  430. #define DNUMOPT 4
  431. #define GEMM_DEFAULT_OFFSET_A 64
  432. #define GEMM_DEFAULT_OFFSET_B 832
  433. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0fffUL
  434. #define QGEMM_DEFAULT_UNROLL_N 2
  435. #define CGEMM_DEFAULT_UNROLL_N 2
  436. #define ZGEMM_DEFAULT_UNROLL_N 2
  437. #define XGEMM_DEFAULT_UNROLL_N 1
  438. #ifdef ARCH_X86
  439. #define SGEMM_DEFAULT_UNROLL_N 4
  440. #define DGEMM_DEFAULT_UNROLL_N 4
  441. #define SGEMM_DEFAULT_UNROLL_M 4
  442. #define DGEMM_DEFAULT_UNROLL_M 2
  443. #define QGEMM_DEFAULT_UNROLL_M 2
  444. #define CGEMM_DEFAULT_UNROLL_M 2
  445. #define ZGEMM_DEFAULT_UNROLL_M 1
  446. #define XGEMM_DEFAULT_UNROLL_M 1
  447. #else
  448. #define SGEMM_DEFAULT_UNROLL_N 2
  449. #define DGEMM_DEFAULT_UNROLL_N 2
  450. #define SGEMM_DEFAULT_UNROLL_M 16
  451. #define DGEMM_DEFAULT_UNROLL_M 8
  452. #define QGEMM_DEFAULT_UNROLL_M 2
  453. #define CGEMM_DEFAULT_UNROLL_M 4
  454. #define ZGEMM_DEFAULT_UNROLL_M 2
  455. #define XGEMM_DEFAULT_UNROLL_M 1
  456. #define CGEMM3M_DEFAULT_UNROLL_N 4
  457. #define CGEMM3M_DEFAULT_UNROLL_M 8
  458. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  459. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  460. #define GEMV_UNROLL 8
  461. #endif
  462. #if defined(ARCH_X86_64)
  463. #define SGEMM_DEFAULT_P 768
  464. #define DGEMM_DEFAULT_P 576
  465. #define ZGEMM_DEFAULT_P 288
  466. #define CGEMM_DEFAULT_P 576
  467. #else
  468. #define SGEMM_DEFAULT_P 448
  469. #define DGEMM_DEFAULT_P 480
  470. #define ZGEMM_DEFAULT_P 112
  471. #define CGEMM_DEFAULT_P 224
  472. #endif
  473. #define QGEMM_DEFAULT_P 112
  474. #define XGEMM_DEFAULT_P 56
  475. #if defined(ARCH_X86_64)
  476. #define SGEMM_DEFAULT_Q 192
  477. #define DGEMM_DEFAULT_Q 160
  478. #define ZGEMM_DEFAULT_Q 160
  479. #define CGEMM_DEFAULT_Q 160
  480. #else
  481. #define SGEMM_DEFAULT_Q 224
  482. #define DGEMM_DEFAULT_Q 224
  483. #define ZGEMM_DEFAULT_Q 224
  484. #define CGEMM_DEFAULT_Q 224
  485. #endif
  486. #define QGEMM_DEFAULT_Q 224
  487. #define XGEMM_DEFAULT_Q 224
  488. #define CGEMM3M_DEFAULT_P 448
  489. #define ZGEMM3M_DEFAULT_P 224
  490. #define XGEMM3M_DEFAULT_P 112
  491. #define CGEMM3M_DEFAULT_Q 224
  492. #define ZGEMM3M_DEFAULT_Q 224
  493. #define XGEMM3M_DEFAULT_Q 224
  494. #define CGEMM3M_DEFAULT_R 12288
  495. #define ZGEMM3M_DEFAULT_R 12288
  496. #define XGEMM3M_DEFAULT_R 12288
  497. #define SGEMM_DEFAULT_R 12288
  498. #define QGEMM_DEFAULT_R qgemm_r
  499. #define DGEMM_DEFAULT_R 12288
  500. #define CGEMM_DEFAULT_R cgemm_r
  501. #define ZGEMM_DEFAULT_R zgemm_r
  502. #define XGEMM_DEFAULT_R xgemm_r
  503. #define SYMV_P 16
  504. #define HAVE_EXCLUSIVE_CACHE
  505. #define GEMM_THREAD gemm_thread_mn
  506. #endif
  507. #ifdef ZEN
  508. #define SNUMOPT 16
  509. #define DNUMOPT 8
  510. #define GEMM_DEFAULT_OFFSET_A 0
  511. #define GEMM_DEFAULT_OFFSET_B 0
  512. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  513. #define SYMV_P 8
  514. #define SWITCH_RATIO 16
  515. #ifdef ARCH_X86
  516. #define SGEMM_DEFAULT_UNROLL_M 4
  517. #define DGEMM_DEFAULT_UNROLL_M 2
  518. #define QGEMM_DEFAULT_UNROLL_M 2
  519. #define CGEMM_DEFAULT_UNROLL_M 2
  520. #define ZGEMM_DEFAULT_UNROLL_M 1
  521. #define XGEMM_DEFAULT_UNROLL_M 1
  522. #define SGEMM_DEFAULT_UNROLL_N 4
  523. #define DGEMM_DEFAULT_UNROLL_N 4
  524. #define QGEMM_DEFAULT_UNROLL_N 2
  525. #define CGEMM_DEFAULT_UNROLL_N 2
  526. #define ZGEMM_DEFAULT_UNROLL_N 2
  527. #define XGEMM_DEFAULT_UNROLL_N 1
  528. #else
  529. #define SGEMM_DEFAULT_UNROLL_M 8
  530. #define DGEMM_DEFAULT_UNROLL_M 4
  531. #define QGEMM_DEFAULT_UNROLL_M 2
  532. #define CGEMM_DEFAULT_UNROLL_M 8
  533. #define ZGEMM_DEFAULT_UNROLL_M 4
  534. #define XGEMM_DEFAULT_UNROLL_M 1
  535. #define SGEMM_DEFAULT_UNROLL_N 4
  536. #define DGEMM_DEFAULT_UNROLL_N 8
  537. #define QGEMM_DEFAULT_UNROLL_N 2
  538. #define CGEMM_DEFAULT_UNROLL_N 2
  539. #define ZGEMM_DEFAULT_UNROLL_N 2
  540. #define XGEMM_DEFAULT_UNROLL_N 1
  541. /*
  542. #define SGEMM_DEFAULT_UNROLL_MN 32
  543. #define DGEMM_DEFAULT_UNROLL_MN 32
  544. */
  545. #endif
  546. #ifdef ARCH_X86
  547. #define SGEMM_DEFAULT_P 512
  548. #define SGEMM_DEFAULT_R sgemm_r
  549. #define DGEMM_DEFAULT_P 512
  550. #define DGEMM_DEFAULT_R dgemm_r
  551. #define QGEMM_DEFAULT_P 504
  552. #define QGEMM_DEFAULT_R qgemm_r
  553. #define CGEMM_DEFAULT_P 128
  554. #define CGEMM_DEFAULT_R 1024
  555. #define ZGEMM_DEFAULT_P 512
  556. #define ZGEMM_DEFAULT_R zgemm_r
  557. #define XGEMM_DEFAULT_P 252
  558. #define XGEMM_DEFAULT_R xgemm_r
  559. #define SGEMM_DEFAULT_Q 256
  560. #define DGEMM_DEFAULT_Q 256
  561. #define QGEMM_DEFAULT_Q 128
  562. #define CGEMM_DEFAULT_Q 256
  563. #define ZGEMM_DEFAULT_Q 192
  564. #define XGEMM_DEFAULT_Q 128
  565. #else
  566. #define SGEMM_DEFAULT_P 320
  567. #define DGEMM_DEFAULT_P 512
  568. #define CGEMM_DEFAULT_P 256
  569. #define ZGEMM_DEFAULT_P 192
  570. #ifdef WINDOWS_ABI
  571. #define SGEMM_DEFAULT_Q 320
  572. #define DGEMM_DEFAULT_Q 128
  573. #else
  574. #define SGEMM_DEFAULT_Q 320
  575. #define DGEMM_DEFAULT_Q 256
  576. #endif
  577. #define CGEMM_DEFAULT_Q 256
  578. #define ZGEMM_DEFAULT_Q 192
  579. #define SGEMM_DEFAULT_R sgemm_r
  580. #define DGEMM_DEFAULT_R 13824
  581. #define CGEMM_DEFAULT_R cgemm_r
  582. #define ZGEMM_DEFAULT_R zgemm_r
  583. #define QGEMM_DEFAULT_Q 128
  584. #define QGEMM_DEFAULT_P 504
  585. #define QGEMM_DEFAULT_R qgemm_r
  586. #define XGEMM_DEFAULT_P 252
  587. #define XGEMM_DEFAULT_R xgemm_r
  588. #define XGEMM_DEFAULT_Q 128
  589. #define CGEMM3M_DEFAULT_UNROLL_N 4
  590. #define CGEMM3M_DEFAULT_UNROLL_M 8
  591. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  592. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  593. #define CGEMM3M_DEFAULT_P 320
  594. #define ZGEMM3M_DEFAULT_P 256
  595. #define XGEMM3M_DEFAULT_P 112
  596. #define CGEMM3M_DEFAULT_Q 320
  597. #define ZGEMM3M_DEFAULT_Q 256
  598. #define XGEMM3M_DEFAULT_Q 224
  599. #define CGEMM3M_DEFAULT_R 12288
  600. #define ZGEMM3M_DEFAULT_R 12288
  601. #define XGEMM3M_DEFAULT_R 12288
  602. #endif
  603. #endif
  604. #ifdef ATHLON
  605. #define SNUMOPT 4
  606. #define DNUMOPT 2
  607. #define GEMM_DEFAULT_OFFSET_A 0
  608. #define GEMM_DEFAULT_OFFSET_B 384
  609. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  610. #define SGEMM_DEFAULT_UNROLL_N 4
  611. #define DGEMM_DEFAULT_UNROLL_N 4
  612. #define QGEMM_DEFAULT_UNROLL_N 2
  613. #define CGEMM_DEFAULT_UNROLL_N 2
  614. #define ZGEMM_DEFAULT_UNROLL_N 2
  615. #define XGEMM_DEFAULT_UNROLL_N 1
  616. #define SGEMM_DEFAULT_UNROLL_M 2
  617. #define DGEMM_DEFAULT_UNROLL_M 1
  618. #define QGEMM_DEFAULT_UNROLL_M 2
  619. #define CGEMM_DEFAULT_UNROLL_M 1
  620. #define ZGEMM_DEFAULT_UNROLL_M 1
  621. #define XGEMM_DEFAULT_UNROLL_M 1
  622. #define SGEMM_DEFAULT_R sgemm_r
  623. #define DGEMM_DEFAULT_R dgemm_r
  624. #define QGEMM_DEFAULT_R qgemm_r
  625. #define CGEMM_DEFAULT_R cgemm_r
  626. #define ZGEMM_DEFAULT_R zgemm_r
  627. #define XGEMM_DEFAULT_R xgemm_r
  628. #define SGEMM_DEFAULT_P 208
  629. #define DGEMM_DEFAULT_P 104
  630. #define QGEMM_DEFAULT_P 56
  631. #define CGEMM_DEFAULT_P 104
  632. #define ZGEMM_DEFAULT_P 56
  633. #define XGEMM_DEFAULT_P 28
  634. #define SGEMM_DEFAULT_Q 208
  635. #define DGEMM_DEFAULT_Q 208
  636. #define QGEMM_DEFAULT_Q 208
  637. #define CGEMM_DEFAULT_Q 208
  638. #define ZGEMM_DEFAULT_Q 208
  639. #define XGEMM_DEFAULT_Q 208
  640. #define SYMV_P 16
  641. #define HAVE_EXCLUSIVE_CACHE
  642. #endif
  643. #ifdef VIAC3
  644. #define SNUMOPT 2
  645. #define DNUMOPT 1
  646. #define GEMM_DEFAULT_OFFSET_A 0
  647. #define GEMM_DEFAULT_OFFSET_B 256
  648. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  649. #define SGEMM_DEFAULT_UNROLL_N 4
  650. #define DGEMM_DEFAULT_UNROLL_N 4
  651. #define QGEMM_DEFAULT_UNROLL_N 2
  652. #define CGEMM_DEFAULT_UNROLL_N 2
  653. #define ZGEMM_DEFAULT_UNROLL_N 2
  654. #define XGEMM_DEFAULT_UNROLL_N 1
  655. #define SGEMM_DEFAULT_UNROLL_M 2
  656. #define DGEMM_DEFAULT_UNROLL_M 1
  657. #define QGEMM_DEFAULT_UNROLL_M 2
  658. #define CGEMM_DEFAULT_UNROLL_M 1
  659. #define ZGEMM_DEFAULT_UNROLL_M 1
  660. #define XGEMM_DEFAULT_UNROLL_M 1
  661. #define SGEMM_DEFAULT_R sgemm_r
  662. #define DGEMM_DEFAULT_R dgemm_r
  663. #define QGEMM_DEFAULT_R qgemm_r
  664. #define CGEMM_DEFAULT_R cgemm_r
  665. #define ZGEMM_DEFAULT_R zgemm_r
  666. #define XGEMM_DEFAULT_R xgemm_r
  667. #define SGEMM_DEFAULT_P 128
  668. #define DGEMM_DEFAULT_P 128
  669. #define QGEMM_DEFAULT_P 128
  670. #define CGEMM_DEFAULT_P 128
  671. #define ZGEMM_DEFAULT_P 128
  672. #define XGEMM_DEFAULT_P 128
  673. #define SGEMM_DEFAULT_Q 512
  674. #define DGEMM_DEFAULT_Q 256
  675. #define QGEMM_DEFAULT_Q 256
  676. #define CGEMM_DEFAULT_Q 256
  677. #define ZGEMM_DEFAULT_Q 128
  678. #define XGEMM_DEFAULT_Q 128
  679. #define SYMV_P 16
  680. #endif
  681. #ifdef NANO
  682. #define SNUMOPT 4
  683. #define DNUMOPT 2
  684. #define GEMM_DEFAULT_OFFSET_A 64
  685. #define GEMM_DEFAULT_OFFSET_B 256
  686. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x01ffffUL
  687. #ifdef ARCH_X86
  688. #define SGEMM_DEFAULT_UNROLL_N 4
  689. #define DGEMM_DEFAULT_UNROLL_N 4
  690. #define QGEMM_DEFAULT_UNROLL_N 2
  691. #define CGEMM_DEFAULT_UNROLL_N 2
  692. #define ZGEMM_DEFAULT_UNROLL_N 2
  693. #define XGEMM_DEFAULT_UNROLL_N 1
  694. #define SGEMM_DEFAULT_UNROLL_M 4
  695. #define DGEMM_DEFAULT_UNROLL_M 2
  696. #define QGEMM_DEFAULT_UNROLL_M 2
  697. #define CGEMM_DEFAULT_UNROLL_M 2
  698. #define ZGEMM_DEFAULT_UNROLL_M 1
  699. #define XGEMM_DEFAULT_UNROLL_M 1
  700. #else
  701. #define SGEMM_DEFAULT_UNROLL_N 8
  702. #define DGEMM_DEFAULT_UNROLL_N 4
  703. #define QGEMM_DEFAULT_UNROLL_N 2
  704. #define CGEMM_DEFAULT_UNROLL_N 4
  705. #define ZGEMM_DEFAULT_UNROLL_N 2
  706. #define XGEMM_DEFAULT_UNROLL_N 1
  707. #define SGEMM_DEFAULT_UNROLL_M 4
  708. #define DGEMM_DEFAULT_UNROLL_M 4
  709. #define QGEMM_DEFAULT_UNROLL_M 2
  710. #define CGEMM_DEFAULT_UNROLL_M 2
  711. #define ZGEMM_DEFAULT_UNROLL_M 2
  712. #define XGEMM_DEFAULT_UNROLL_M 1
  713. #endif
  714. #define SGEMM_DEFAULT_P 288
  715. #define DGEMM_DEFAULT_P 288
  716. #define QGEMM_DEFAULT_P 288
  717. #define CGEMM_DEFAULT_P 288
  718. #define ZGEMM_DEFAULT_P 288
  719. #define XGEMM_DEFAULT_P 288
  720. #define SGEMM_DEFAULT_R sgemm_r
  721. #define DGEMM_DEFAULT_R dgemm_r
  722. #define QGEMM_DEFAULT_R qgemm_r
  723. #define CGEMM_DEFAULT_R cgemm_r
  724. #define ZGEMM_DEFAULT_R zgemm_r
  725. #define XGEMM_DEFAULT_R xgemm_r
  726. #define SGEMM_DEFAULT_Q 256
  727. #define DGEMM_DEFAULT_Q 128
  728. #define QGEMM_DEFAULT_Q 64
  729. #define CGEMM_DEFAULT_Q 128
  730. #define ZGEMM_DEFAULT_Q 64
  731. #define XGEMM_DEFAULT_Q 32
  732. #define SYMV_P 16
  733. #define HAVE_EXCLUSIVE_CACHE
  734. #endif
  735. #if defined(PENTIUM) || defined(PENTIUM2) || defined(PENTIUM3)
  736. #ifdef HAVE_SSE
  737. #define SNUMOPT 2
  738. #else
  739. #define SNUMOPT 1
  740. #endif
  741. #define DNUMOPT 1
  742. #define GEMM_DEFAULT_OFFSET_A 0
  743. #define GEMM_DEFAULT_OFFSET_B 0
  744. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  745. #ifdef HAVE_SSE
  746. #define SGEMM_DEFAULT_UNROLL_M 8
  747. #define CGEMM_DEFAULT_UNROLL_M 4
  748. #else
  749. #define SGEMM_DEFAULT_UNROLL_M 4
  750. #define CGEMM_DEFAULT_UNROLL_M 2
  751. #endif
  752. #define DGEMM_DEFAULT_UNROLL_M 2
  753. #define SGEMM_DEFAULT_UNROLL_N 2
  754. #define DGEMM_DEFAULT_UNROLL_N 2
  755. #define QGEMM_DEFAULT_UNROLL_M 2
  756. #define QGEMM_DEFAULT_UNROLL_N 2
  757. #define CGEMM_DEFAULT_UNROLL_N 1
  758. #define ZGEMM_DEFAULT_UNROLL_M 1
  759. #define ZGEMM_DEFAULT_UNROLL_N 1
  760. #define XGEMM_DEFAULT_UNROLL_M 1
  761. #define XGEMM_DEFAULT_UNROLL_N 1
  762. #define SGEMM_DEFAULT_P sgemm_p
  763. #define SGEMM_DEFAULT_Q 256
  764. #define SGEMM_DEFAULT_R sgemm_r
  765. #define DGEMM_DEFAULT_P dgemm_p
  766. #define DGEMM_DEFAULT_Q 256
  767. #define DGEMM_DEFAULT_R dgemm_r
  768. #define QGEMM_DEFAULT_P qgemm_p
  769. #define QGEMM_DEFAULT_Q 256
  770. #define QGEMM_DEFAULT_R qgemm_r
  771. #define CGEMM_DEFAULT_P cgemm_p
  772. #define CGEMM_DEFAULT_Q 256
  773. #define CGEMM_DEFAULT_R cgemm_r
  774. #define ZGEMM_DEFAULT_P zgemm_p
  775. #define ZGEMM_DEFAULT_Q 256
  776. #define ZGEMM_DEFAULT_R zgemm_r
  777. #define XGEMM_DEFAULT_P xgemm_p
  778. #define XGEMM_DEFAULT_Q 256
  779. #define XGEMM_DEFAULT_R xgemm_r
  780. #define SYMV_P 4
  781. #endif
  782. #ifdef PENTIUMM
  783. #define SNUMOPT 2
  784. #define DNUMOPT 1
  785. #define GEMM_DEFAULT_OFFSET_A 0
  786. #define GEMM_DEFAULT_OFFSET_B 0
  787. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  788. #ifdef CORE_YONAH
  789. #define SGEMM_DEFAULT_UNROLL_M 4
  790. #define SGEMM_DEFAULT_UNROLL_N 4
  791. #define DGEMM_DEFAULT_UNROLL_M 2
  792. #define DGEMM_DEFAULT_UNROLL_N 4
  793. #define QGEMM_DEFAULT_UNROLL_M 2
  794. #define QGEMM_DEFAULT_UNROLL_N 2
  795. #define CGEMM_DEFAULT_UNROLL_M 2
  796. #define CGEMM_DEFAULT_UNROLL_N 2
  797. #define ZGEMM_DEFAULT_UNROLL_M 1
  798. #define ZGEMM_DEFAULT_UNROLL_N 2
  799. #define XGEMM_DEFAULT_UNROLL_M 1
  800. #define XGEMM_DEFAULT_UNROLL_N 1
  801. #else
  802. #define SGEMM_DEFAULT_UNROLL_M 8
  803. #define SGEMM_DEFAULT_UNROLL_N 2
  804. #define DGEMM_DEFAULT_UNROLL_M 2
  805. #define DGEMM_DEFAULT_UNROLL_N 2
  806. #define QGEMM_DEFAULT_UNROLL_M 2
  807. #define QGEMM_DEFAULT_UNROLL_N 2
  808. #define CGEMM_DEFAULT_UNROLL_M 4
  809. #define CGEMM_DEFAULT_UNROLL_N 1
  810. #define ZGEMM_DEFAULT_UNROLL_M 1
  811. #define ZGEMM_DEFAULT_UNROLL_N 1
  812. #define XGEMM_DEFAULT_UNROLL_M 1
  813. #define XGEMM_DEFAULT_UNROLL_N 1
  814. #endif
  815. #define SGEMM_DEFAULT_P sgemm_p
  816. #define SGEMM_DEFAULT_Q 256
  817. #define SGEMM_DEFAULT_R sgemm_r
  818. #define DGEMM_DEFAULT_P dgemm_p
  819. #define DGEMM_DEFAULT_Q 256
  820. #define DGEMM_DEFAULT_R dgemm_r
  821. #define QGEMM_DEFAULT_P qgemm_p
  822. #define QGEMM_DEFAULT_Q 256
  823. #define QGEMM_DEFAULT_R qgemm_r
  824. #define CGEMM_DEFAULT_P cgemm_p
  825. #define CGEMM_DEFAULT_Q 256
  826. #define CGEMM_DEFAULT_R cgemm_r
  827. #define ZGEMM_DEFAULT_P zgemm_p
  828. #define ZGEMM_DEFAULT_Q 256
  829. #define ZGEMM_DEFAULT_R zgemm_r
  830. #define XGEMM_DEFAULT_P xgemm_p
  831. #define XGEMM_DEFAULT_Q 256
  832. #define XGEMM_DEFAULT_R xgemm_r
  833. #define SYMV_P 4
  834. #endif
  835. #ifdef CORE_NORTHWOOD
  836. #define SNUMOPT 4
  837. #define DNUMOPT 2
  838. #define GEMM_DEFAULT_OFFSET_A 0
  839. #define GEMM_DEFAULT_OFFSET_B 32
  840. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  841. #define SYMV_P 8
  842. #define SGEMM_DEFAULT_UNROLL_M 8
  843. #define DGEMM_DEFAULT_UNROLL_M 4
  844. #define QGEMM_DEFAULT_UNROLL_M 2
  845. #define CGEMM_DEFAULT_UNROLL_M 4
  846. #define ZGEMM_DEFAULT_UNROLL_M 2
  847. #define XGEMM_DEFAULT_UNROLL_M 1
  848. #define SGEMM_DEFAULT_UNROLL_N 2
  849. #define DGEMM_DEFAULT_UNROLL_N 2
  850. #define QGEMM_DEFAULT_UNROLL_N 2
  851. #define CGEMM_DEFAULT_UNROLL_N 1
  852. #define ZGEMM_DEFAULT_UNROLL_N 1
  853. #define XGEMM_DEFAULT_UNROLL_N 1
  854. #define SGEMM_DEFAULT_P sgemm_p
  855. #define SGEMM_DEFAULT_R sgemm_r
  856. #define DGEMM_DEFAULT_P dgemm_p
  857. #define DGEMM_DEFAULT_R dgemm_r
  858. #define QGEMM_DEFAULT_P qgemm_p
  859. #define QGEMM_DEFAULT_R qgemm_r
  860. #define CGEMM_DEFAULT_P cgemm_p
  861. #define CGEMM_DEFAULT_R cgemm_r
  862. #define ZGEMM_DEFAULT_P zgemm_p
  863. #define ZGEMM_DEFAULT_R zgemm_r
  864. #define XGEMM_DEFAULT_P xgemm_p
  865. #define XGEMM_DEFAULT_R xgemm_r
  866. #define SGEMM_DEFAULT_Q 128
  867. #define DGEMM_DEFAULT_Q 128
  868. #define QGEMM_DEFAULT_Q 128
  869. #define CGEMM_DEFAULT_Q 128
  870. #define ZGEMM_DEFAULT_Q 128
  871. #define XGEMM_DEFAULT_Q 128
  872. #endif
  873. #ifdef CORE_PRESCOTT
  874. #define SNUMOPT 4
  875. #define DNUMOPT 2
  876. #ifndef __64BIT__
  877. #define GEMM_DEFAULT_OFFSET_A 128
  878. #define GEMM_DEFAULT_OFFSET_B 192
  879. #else
  880. #define GEMM_DEFAULT_OFFSET_A 0
  881. #define GEMM_DEFAULT_OFFSET_B 256
  882. #endif
  883. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  884. #define SYMV_P 8
  885. #ifdef ARCH_X86
  886. #define SGEMM_DEFAULT_UNROLL_M 4
  887. #define DGEMM_DEFAULT_UNROLL_M 2
  888. #define QGEMM_DEFAULT_UNROLL_M 2
  889. #define CGEMM_DEFAULT_UNROLL_M 2
  890. #define ZGEMM_DEFAULT_UNROLL_M 1
  891. #define XGEMM_DEFAULT_UNROLL_M 1
  892. #else
  893. #define SGEMM_DEFAULT_UNROLL_M 8
  894. #define DGEMM_DEFAULT_UNROLL_M 4
  895. #define QGEMM_DEFAULT_UNROLL_M 2
  896. #define CGEMM_DEFAULT_UNROLL_M 4
  897. #define ZGEMM_DEFAULT_UNROLL_M 2
  898. #define XGEMM_DEFAULT_UNROLL_M 1
  899. #endif
  900. #define SGEMM_DEFAULT_UNROLL_N 4
  901. #define DGEMM_DEFAULT_UNROLL_N 4
  902. #define QGEMM_DEFAULT_UNROLL_N 2
  903. #define CGEMM_DEFAULT_UNROLL_N 2
  904. #define ZGEMM_DEFAULT_UNROLL_N 2
  905. #define XGEMM_DEFAULT_UNROLL_N 1
  906. #define SGEMM_DEFAULT_P sgemm_p
  907. #define SGEMM_DEFAULT_R sgemm_r
  908. #define DGEMM_DEFAULT_P dgemm_p
  909. #define DGEMM_DEFAULT_R dgemm_r
  910. #define QGEMM_DEFAULT_P qgemm_p
  911. #define QGEMM_DEFAULT_R qgemm_r
  912. #define CGEMM_DEFAULT_P cgemm_p
  913. #define CGEMM_DEFAULT_R cgemm_r
  914. #define ZGEMM_DEFAULT_P zgemm_p
  915. #define ZGEMM_DEFAULT_R zgemm_r
  916. #define XGEMM_DEFAULT_P xgemm_p
  917. #define XGEMM_DEFAULT_R xgemm_r
  918. #define SGEMM_DEFAULT_Q 128
  919. #define DGEMM_DEFAULT_Q 128
  920. #define QGEMM_DEFAULT_Q 128
  921. #define CGEMM_DEFAULT_Q 128
  922. #define ZGEMM_DEFAULT_Q 128
  923. #define XGEMM_DEFAULT_Q 128
  924. #endif
  925. #ifdef CORE2
  926. #define SNUMOPT 8
  927. #define DNUMOPT 4
  928. #define GEMM_DEFAULT_OFFSET_A 448
  929. #define GEMM_DEFAULT_OFFSET_B 128
  930. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  931. #define SYMV_P 8
  932. #define SWITCH_RATIO 4
  933. #ifdef ARCH_X86
  934. #define SGEMM_DEFAULT_UNROLL_M 8
  935. #define DGEMM_DEFAULT_UNROLL_M 4
  936. #define QGEMM_DEFAULT_UNROLL_M 2
  937. #define CGEMM_DEFAULT_UNROLL_M 4
  938. #define ZGEMM_DEFAULT_UNROLL_M 2
  939. #define XGEMM_DEFAULT_UNROLL_M 1
  940. #define SGEMM_DEFAULT_UNROLL_N 2
  941. #define DGEMM_DEFAULT_UNROLL_N 2
  942. #define QGEMM_DEFAULT_UNROLL_N 2
  943. #define CGEMM_DEFAULT_UNROLL_N 1
  944. #define ZGEMM_DEFAULT_UNROLL_N 1
  945. #define XGEMM_DEFAULT_UNROLL_N 1
  946. #define MASK(a, b) ((((a) + (b) - 1) / (b)) * (b))
  947. #else
  948. #define SGEMM_DEFAULT_UNROLL_M 8
  949. #define DGEMM_DEFAULT_UNROLL_M 4
  950. #define QGEMM_DEFAULT_UNROLL_M 2
  951. #define CGEMM_DEFAULT_UNROLL_M 4
  952. #define ZGEMM_DEFAULT_UNROLL_M 2
  953. #define XGEMM_DEFAULT_UNROLL_M 1
  954. #define SGEMM_DEFAULT_UNROLL_N 4
  955. #define DGEMM_DEFAULT_UNROLL_N 4
  956. #define QGEMM_DEFAULT_UNROLL_N 2
  957. #define CGEMM_DEFAULT_UNROLL_N 2
  958. #define ZGEMM_DEFAULT_UNROLL_N 2
  959. #define XGEMM_DEFAULT_UNROLL_N 1
  960. #endif
  961. #define SGEMM_DEFAULT_P sgemm_p
  962. #define SGEMM_DEFAULT_R sgemm_r
  963. #define DGEMM_DEFAULT_P dgemm_p
  964. #define DGEMM_DEFAULT_R dgemm_r
  965. #define QGEMM_DEFAULT_P qgemm_p
  966. #define QGEMM_DEFAULT_R qgemm_r
  967. #define CGEMM_DEFAULT_P cgemm_p
  968. #define CGEMM_DEFAULT_R cgemm_r
  969. #define ZGEMM_DEFAULT_P zgemm_p
  970. #define ZGEMM_DEFAULT_R zgemm_r
  971. #define XGEMM_DEFAULT_P xgemm_p
  972. #define XGEMM_DEFAULT_R xgemm_r
  973. #define SGEMM_DEFAULT_Q 256
  974. #define DGEMM_DEFAULT_Q 256
  975. #define QGEMM_DEFAULT_Q 256
  976. #define CGEMM_DEFAULT_Q 256
  977. #define ZGEMM_DEFAULT_Q 256
  978. #define XGEMM_DEFAULT_Q 256
  979. #endif
  980. #ifdef PENRYN
  981. #define SNUMOPT 8
  982. #define DNUMOPT 4
  983. #define GEMM_DEFAULT_OFFSET_A 128
  984. #define GEMM_DEFAULT_OFFSET_B 0
  985. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  986. #define SYMV_P 8
  987. #define SWITCH_RATIO 4
  988. #ifdef ARCH_X86
  989. #define SGEMM_DEFAULT_UNROLL_M 4
  990. #define DGEMM_DEFAULT_UNROLL_M 2
  991. #define QGEMM_DEFAULT_UNROLL_M 2
  992. #define CGEMM_DEFAULT_UNROLL_M 2
  993. #define ZGEMM_DEFAULT_UNROLL_M 1
  994. #define XGEMM_DEFAULT_UNROLL_M 1
  995. #define SGEMM_DEFAULT_UNROLL_N 4
  996. #define DGEMM_DEFAULT_UNROLL_N 4
  997. #define QGEMM_DEFAULT_UNROLL_N 2
  998. #define CGEMM_DEFAULT_UNROLL_N 2
  999. #define ZGEMM_DEFAULT_UNROLL_N 2
  1000. #define XGEMM_DEFAULT_UNROLL_N 1
  1001. #else
  1002. #define SGEMM_DEFAULT_UNROLL_M 8
  1003. #define DGEMM_DEFAULT_UNROLL_M 4
  1004. #define QGEMM_DEFAULT_UNROLL_M 2
  1005. #define CGEMM_DEFAULT_UNROLL_M 4
  1006. #define ZGEMM_DEFAULT_UNROLL_M 2
  1007. #define XGEMM_DEFAULT_UNROLL_M 1
  1008. #define SGEMM_DEFAULT_UNROLL_N 4
  1009. #define DGEMM_DEFAULT_UNROLL_N 4
  1010. #define QGEMM_DEFAULT_UNROLL_N 2
  1011. #define CGEMM_DEFAULT_UNROLL_N 2
  1012. #define ZGEMM_DEFAULT_UNROLL_N 2
  1013. #define XGEMM_DEFAULT_UNROLL_N 1
  1014. #endif
  1015. #define SGEMM_DEFAULT_P sgemm_p
  1016. #define SGEMM_DEFAULT_R sgemm_r
  1017. #define DGEMM_DEFAULT_P dgemm_p
  1018. #define DGEMM_DEFAULT_R dgemm_r
  1019. #define QGEMM_DEFAULT_P qgemm_p
  1020. #define QGEMM_DEFAULT_R qgemm_r
  1021. #define CGEMM_DEFAULT_P cgemm_p
  1022. #define CGEMM_DEFAULT_R cgemm_r
  1023. #define ZGEMM_DEFAULT_P zgemm_p
  1024. #define ZGEMM_DEFAULT_R zgemm_r
  1025. #define XGEMM_DEFAULT_P xgemm_p
  1026. #define XGEMM_DEFAULT_R xgemm_r
  1027. #define SGEMM_DEFAULT_Q 512
  1028. #define DGEMM_DEFAULT_Q 256
  1029. #define QGEMM_DEFAULT_Q 128
  1030. #define CGEMM_DEFAULT_Q 512
  1031. #define ZGEMM_DEFAULT_Q 256
  1032. #define XGEMM_DEFAULT_Q 128
  1033. #define GETRF_FACTOR 0.75
  1034. #endif
  1035. #ifdef DUNNINGTON
  1036. #define SNUMOPT 8
  1037. #define DNUMOPT 4
  1038. #define GEMM_DEFAULT_OFFSET_A 128
  1039. #define GEMM_DEFAULT_OFFSET_B 0
  1040. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1041. #define SYMV_P 8
  1042. #define SWITCH_RATIO 4
  1043. #ifdef ARCH_X86
  1044. #define SGEMM_DEFAULT_UNROLL_M 4
  1045. #define DGEMM_DEFAULT_UNROLL_M 2
  1046. #define QGEMM_DEFAULT_UNROLL_M 2
  1047. #define CGEMM_DEFAULT_UNROLL_M 2
  1048. #define ZGEMM_DEFAULT_UNROLL_M 1
  1049. #define XGEMM_DEFAULT_UNROLL_M 1
  1050. #define SGEMM_DEFAULT_UNROLL_N 4
  1051. #define DGEMM_DEFAULT_UNROLL_N 4
  1052. #define QGEMM_DEFAULT_UNROLL_N 2
  1053. #define CGEMM_DEFAULT_UNROLL_N 2
  1054. #define ZGEMM_DEFAULT_UNROLL_N 2
  1055. #define XGEMM_DEFAULT_UNROLL_N 1
  1056. #else
  1057. #define SGEMM_DEFAULT_UNROLL_M 8
  1058. #define DGEMM_DEFAULT_UNROLL_M 4
  1059. #define QGEMM_DEFAULT_UNROLL_M 2
  1060. #define CGEMM_DEFAULT_UNROLL_M 4
  1061. #define ZGEMM_DEFAULT_UNROLL_M 2
  1062. #define XGEMM_DEFAULT_UNROLL_M 1
  1063. #define SGEMM_DEFAULT_UNROLL_N 4
  1064. #define DGEMM_DEFAULT_UNROLL_N 4
  1065. #define QGEMM_DEFAULT_UNROLL_N 2
  1066. #define CGEMM_DEFAULT_UNROLL_N 2
  1067. #define ZGEMM_DEFAULT_UNROLL_N 2
  1068. #define XGEMM_DEFAULT_UNROLL_N 1
  1069. #endif
  1070. #define SGEMM_DEFAULT_P sgemm_p
  1071. #define SGEMM_DEFAULT_R sgemm_r
  1072. #define DGEMM_DEFAULT_P dgemm_p
  1073. #define DGEMM_DEFAULT_R dgemm_r
  1074. #define QGEMM_DEFAULT_P qgemm_p
  1075. #define QGEMM_DEFAULT_R qgemm_r
  1076. #define CGEMM_DEFAULT_P cgemm_p
  1077. #define CGEMM_DEFAULT_R cgemm_r
  1078. #define ZGEMM_DEFAULT_P zgemm_p
  1079. #define ZGEMM_DEFAULT_R zgemm_r
  1080. #define XGEMM_DEFAULT_P xgemm_p
  1081. #define XGEMM_DEFAULT_R xgemm_r
  1082. #define SGEMM_DEFAULT_Q 768
  1083. #define DGEMM_DEFAULT_Q 384
  1084. #define QGEMM_DEFAULT_Q 192
  1085. #define CGEMM_DEFAULT_Q 768
  1086. #define ZGEMM_DEFAULT_Q 384
  1087. #define XGEMM_DEFAULT_Q 192
  1088. #define GETRF_FACTOR 0.75
  1089. #define GEMM_THREAD gemm_thread_mn
  1090. #endif
  1091. #ifdef NEHALEM
  1092. #define SNUMOPT 8
  1093. #define DNUMOPT 4
  1094. #define GEMM_DEFAULT_OFFSET_A 32
  1095. #define GEMM_DEFAULT_OFFSET_B 0
  1096. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1097. #define SYMV_P 8
  1098. #define SWITCH_RATIO 4
  1099. #ifdef ARCH_X86
  1100. #define SGEMM_DEFAULT_UNROLL_M 4
  1101. #define DGEMM_DEFAULT_UNROLL_M 2
  1102. #define QGEMM_DEFAULT_UNROLL_M 2
  1103. #define CGEMM_DEFAULT_UNROLL_M 2
  1104. #define ZGEMM_DEFAULT_UNROLL_M 1
  1105. #define XGEMM_DEFAULT_UNROLL_M 1
  1106. #define SGEMM_DEFAULT_UNROLL_N 4
  1107. #define DGEMM_DEFAULT_UNROLL_N 4
  1108. #define QGEMM_DEFAULT_UNROLL_N 2
  1109. #define CGEMM_DEFAULT_UNROLL_N 2
  1110. #define ZGEMM_DEFAULT_UNROLL_N 2
  1111. #define XGEMM_DEFAULT_UNROLL_N 1
  1112. #else
  1113. #define SGEMM_DEFAULT_UNROLL_M 4
  1114. #define DGEMM_DEFAULT_UNROLL_M 2
  1115. #define QGEMM_DEFAULT_UNROLL_M 2
  1116. #define CGEMM_DEFAULT_UNROLL_M 2
  1117. #define ZGEMM_DEFAULT_UNROLL_M 1
  1118. #define XGEMM_DEFAULT_UNROLL_M 1
  1119. #define SGEMM_DEFAULT_UNROLL_N 8
  1120. #define DGEMM_DEFAULT_UNROLL_N 8
  1121. #define QGEMM_DEFAULT_UNROLL_N 2
  1122. #define CGEMM_DEFAULT_UNROLL_N 4
  1123. #define ZGEMM_DEFAULT_UNROLL_N 4
  1124. #define XGEMM_DEFAULT_UNROLL_N 1
  1125. #endif
  1126. #define SGEMM_DEFAULT_P 504
  1127. #define SGEMM_DEFAULT_R sgemm_r
  1128. #define DGEMM_DEFAULT_P 504
  1129. #define DGEMM_DEFAULT_R dgemm_r
  1130. #define QGEMM_DEFAULT_P 504
  1131. #define QGEMM_DEFAULT_R qgemm_r
  1132. #define CGEMM_DEFAULT_P 252
  1133. #define CGEMM_DEFAULT_R cgemm_r
  1134. #define ZGEMM_DEFAULT_P 252
  1135. #define ZGEMM_DEFAULT_R zgemm_r
  1136. #define XGEMM_DEFAULT_P 252
  1137. #define XGEMM_DEFAULT_R xgemm_r
  1138. #define SGEMM_DEFAULT_Q 512
  1139. #define DGEMM_DEFAULT_Q 256
  1140. #define QGEMM_DEFAULT_Q 128
  1141. #define CGEMM_DEFAULT_Q 512
  1142. #define ZGEMM_DEFAULT_Q 256
  1143. #define XGEMM_DEFAULT_Q 128
  1144. #define GETRF_FACTOR 0.72
  1145. #endif
  1146. #ifdef SANDYBRIDGE
  1147. #define SNUMOPT 8
  1148. #define DNUMOPT 4
  1149. #define GEMM_DEFAULT_OFFSET_A 0
  1150. #define GEMM_DEFAULT_OFFSET_B 0
  1151. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1152. #define SYMV_P 8
  1153. #define SWITCH_RATIO 4
  1154. #ifdef ARCH_X86
  1155. #define SGEMM_DEFAULT_UNROLL_M 4
  1156. #define DGEMM_DEFAULT_UNROLL_M 2
  1157. #define QGEMM_DEFAULT_UNROLL_M 2
  1158. #define CGEMM_DEFAULT_UNROLL_M 2
  1159. #define ZGEMM_DEFAULT_UNROLL_M 1
  1160. #define XGEMM_DEFAULT_UNROLL_M 1
  1161. #define SGEMM_DEFAULT_UNROLL_N 4
  1162. #define DGEMM_DEFAULT_UNROLL_N 4
  1163. #define QGEMM_DEFAULT_UNROLL_N 2
  1164. #define CGEMM_DEFAULT_UNROLL_N 2
  1165. #define ZGEMM_DEFAULT_UNROLL_N 2
  1166. #define XGEMM_DEFAULT_UNROLL_N 1
  1167. #else
  1168. #define SGEMM_DEFAULT_UNROLL_M 16
  1169. #define DGEMM_DEFAULT_UNROLL_M 8
  1170. #define QGEMM_DEFAULT_UNROLL_M 2
  1171. #define CGEMM_DEFAULT_UNROLL_M 8
  1172. #define ZGEMM_DEFAULT_UNROLL_M 1
  1173. #define XGEMM_DEFAULT_UNROLL_M 1
  1174. #define SGEMM_DEFAULT_UNROLL_N 4
  1175. #define DGEMM_DEFAULT_UNROLL_N 4
  1176. #define QGEMM_DEFAULT_UNROLL_N 2
  1177. #define CGEMM_DEFAULT_UNROLL_N 2
  1178. #define ZGEMM_DEFAULT_UNROLL_N 4
  1179. #define XGEMM_DEFAULT_UNROLL_N 1
  1180. #endif
  1181. #define SGEMM_DEFAULT_P 768
  1182. #define SGEMM_DEFAULT_R sgemm_r
  1183. /*#define SGEMM_DEFAULT_R 1024*/
  1184. #define DGEMM_DEFAULT_P 512
  1185. #define DGEMM_DEFAULT_R dgemm_r
  1186. /*#define DGEMM_DEFAULT_R 1024*/
  1187. #define QGEMM_DEFAULT_P 504
  1188. #define QGEMM_DEFAULT_R qgemm_r
  1189. #define CGEMM_DEFAULT_P 768
  1190. #define CGEMM_DEFAULT_R cgemm_r
  1191. /*#define CGEMM_DEFAULT_R 1024*/
  1192. #define ZGEMM_DEFAULT_P 512
  1193. #define ZGEMM_DEFAULT_R zgemm_r
  1194. /*#define ZGEMM_DEFAULT_R 1024*/
  1195. #define XGEMM_DEFAULT_P 252
  1196. #define XGEMM_DEFAULT_R xgemm_r
  1197. #define SGEMM_DEFAULT_Q 384
  1198. #define DGEMM_DEFAULT_Q 256
  1199. #define QGEMM_DEFAULT_Q 128
  1200. #define CGEMM_DEFAULT_Q 512
  1201. #define ZGEMM_DEFAULT_Q 192
  1202. #define XGEMM_DEFAULT_Q 128
  1203. #define CGEMM3M_DEFAULT_UNROLL_N 8
  1204. #define CGEMM3M_DEFAULT_UNROLL_M 4
  1205. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  1206. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  1207. #define CGEMM3M_DEFAULT_P 448
  1208. #define ZGEMM3M_DEFAULT_P 224
  1209. #define XGEMM3M_DEFAULT_P 112
  1210. #define CGEMM3M_DEFAULT_Q 224
  1211. #define ZGEMM3M_DEFAULT_Q 224
  1212. #define XGEMM3M_DEFAULT_Q 224
  1213. #define CGEMM3M_DEFAULT_R 12288
  1214. #define ZGEMM3M_DEFAULT_R 12288
  1215. #define XGEMM3M_DEFAULT_R 12288
  1216. #define GETRF_FACTOR 0.72
  1217. #endif
  1218. #ifdef HASWELL
  1219. #define SNUMOPT 16
  1220. #define DNUMOPT 8
  1221. #define GEMM_DEFAULT_OFFSET_A 0
  1222. #define GEMM_DEFAULT_OFFSET_B 0
  1223. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1224. #define SYMV_P 8
  1225. #if defined(XDOUBLE) || defined(DOUBLE)
  1226. #define SWITCH_RATIO 4
  1227. #define GEMM_PREFERED_SIZE 4
  1228. #else
  1229. #define SWITCH_RATIO 8
  1230. #define GEMM_PREFERED_SIZE 8
  1231. #endif
  1232. #ifdef ARCH_X86
  1233. #define SGEMM_DEFAULT_UNROLL_M 4
  1234. #define DGEMM_DEFAULT_UNROLL_M 2
  1235. #define QGEMM_DEFAULT_UNROLL_M 2
  1236. #define CGEMM_DEFAULT_UNROLL_M 2
  1237. #define ZGEMM_DEFAULT_UNROLL_M 1
  1238. #define XGEMM_DEFAULT_UNROLL_M 1
  1239. #define SGEMM_DEFAULT_UNROLL_N 4
  1240. #define DGEMM_DEFAULT_UNROLL_N 4
  1241. #define QGEMM_DEFAULT_UNROLL_N 2
  1242. #define CGEMM_DEFAULT_UNROLL_N 2
  1243. #define ZGEMM_DEFAULT_UNROLL_N 2
  1244. #define XGEMM_DEFAULT_UNROLL_N 1
  1245. #else
  1246. #define SGEMM_DEFAULT_UNROLL_M 8
  1247. #define DGEMM_DEFAULT_UNROLL_M 4
  1248. #define QGEMM_DEFAULT_UNROLL_M 2
  1249. #define CGEMM_DEFAULT_UNROLL_M 8
  1250. #define ZGEMM_DEFAULT_UNROLL_M 4
  1251. #define XGEMM_DEFAULT_UNROLL_M 1
  1252. #define SGEMM_DEFAULT_UNROLL_N 4
  1253. #define DGEMM_DEFAULT_UNROLL_N 8
  1254. #define QGEMM_DEFAULT_UNROLL_N 2
  1255. #define CGEMM_DEFAULT_UNROLL_N 2
  1256. #define ZGEMM_DEFAULT_UNROLL_N 2
  1257. #define XGEMM_DEFAULT_UNROLL_N 1
  1258. /*
  1259. #define SGEMM_DEFAULT_UNROLL_MN 32
  1260. #define DGEMM_DEFAULT_UNROLL_MN 32
  1261. */
  1262. #endif
  1263. #ifdef ARCH_X86
  1264. #define SGEMM_DEFAULT_P 512
  1265. #define SGEMM_DEFAULT_R sgemm_r
  1266. #define DGEMM_DEFAULT_P 512
  1267. #define DGEMM_DEFAULT_R dgemm_r
  1268. #define QGEMM_DEFAULT_P 504
  1269. #define QGEMM_DEFAULT_R qgemm_r
  1270. #define CGEMM_DEFAULT_P 128
  1271. #define CGEMM_DEFAULT_R 1024
  1272. #define ZGEMM_DEFAULT_P 512
  1273. #define ZGEMM_DEFAULT_R zgemm_r
  1274. #define XGEMM_DEFAULT_P 252
  1275. #define XGEMM_DEFAULT_R xgemm_r
  1276. #define SGEMM_DEFAULT_Q 256
  1277. #define DGEMM_DEFAULT_Q 256
  1278. #define QGEMM_DEFAULT_Q 128
  1279. #define CGEMM_DEFAULT_Q 256
  1280. #define ZGEMM_DEFAULT_Q 192
  1281. #define XGEMM_DEFAULT_Q 128
  1282. #else
  1283. #define SGEMM_DEFAULT_P 320
  1284. #define DGEMM_DEFAULT_P 512
  1285. #define CGEMM_DEFAULT_P 256
  1286. #define ZGEMM_DEFAULT_P 192
  1287. #ifdef WINDOWS_ABI
  1288. #define SGEMM_DEFAULT_Q 320
  1289. #define DGEMM_DEFAULT_Q 128
  1290. #else
  1291. #define SGEMM_DEFAULT_Q 320
  1292. #define DGEMM_DEFAULT_Q 256
  1293. #endif
  1294. #define CGEMM_DEFAULT_Q 256
  1295. #define ZGEMM_DEFAULT_Q 192
  1296. #define SGEMM_DEFAULT_R sgemm_r
  1297. #define DGEMM_DEFAULT_R 13824
  1298. #define CGEMM_DEFAULT_R cgemm_r
  1299. #define ZGEMM_DEFAULT_R zgemm_r
  1300. #define QGEMM_DEFAULT_Q 128
  1301. #define QGEMM_DEFAULT_P 504
  1302. #define QGEMM_DEFAULT_R qgemm_r
  1303. #define XGEMM_DEFAULT_P 252
  1304. #define XGEMM_DEFAULT_R xgemm_r
  1305. #define XGEMM_DEFAULT_Q 128
  1306. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1307. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1308. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1309. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1310. #define CGEMM3M_DEFAULT_P 320
  1311. #define ZGEMM3M_DEFAULT_P 256
  1312. #define XGEMM3M_DEFAULT_P 112
  1313. #define CGEMM3M_DEFAULT_Q 320
  1314. #define ZGEMM3M_DEFAULT_Q 256
  1315. #define XGEMM3M_DEFAULT_Q 224
  1316. #define CGEMM3M_DEFAULT_R 12288
  1317. #define ZGEMM3M_DEFAULT_R 12288
  1318. #define XGEMM3M_DEFAULT_R 12288
  1319. #endif
  1320. #endif
  1321. #ifdef SKYLAKEX
  1322. #define SNUMOPT 16
  1323. #define DNUMOPT 8
  1324. #define GEMM_DEFAULT_OFFSET_A 0
  1325. #define GEMM_DEFAULT_OFFSET_B 0
  1326. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1327. #define SYMV_P 8
  1328. #if defined(XDOUBLE) || defined(DOUBLE)
  1329. #define SWITCH_RATIO 8
  1330. #define GEMM_PREFERED_SIZE 8
  1331. #else
  1332. #define SWITCH_RATIO 16
  1333. #define GEMM_PREFERED_SIZE 16
  1334. #endif
  1335. #define USE_SGEMM_KERNEL_DIRECT 1
  1336. #ifdef ARCH_X86
  1337. #define SGEMM_DEFAULT_UNROLL_M 4
  1338. #define DGEMM_DEFAULT_UNROLL_M 2
  1339. #define QGEMM_DEFAULT_UNROLL_M 2
  1340. #define CGEMM_DEFAULT_UNROLL_M 2
  1341. #define ZGEMM_DEFAULT_UNROLL_M 1
  1342. #define XGEMM_DEFAULT_UNROLL_M 1
  1343. #define SGEMM_DEFAULT_UNROLL_N 4
  1344. #define DGEMM_DEFAULT_UNROLL_N 4
  1345. #define QGEMM_DEFAULT_UNROLL_N 2
  1346. #define CGEMM_DEFAULT_UNROLL_N 2
  1347. #define ZGEMM_DEFAULT_UNROLL_N 2
  1348. #define XGEMM_DEFAULT_UNROLL_N 1
  1349. #else
  1350. #define SGEMM_DEFAULT_UNROLL_M 16
  1351. #ifndef DYNAMIC_ARCH
  1352. #define DGEMM_DEFAULT_UNROLL_M 16
  1353. #else
  1354. #define DGEMM_DEFAULT_UNROLL_M 4
  1355. #endif
  1356. #define QGEMM_DEFAULT_UNROLL_M 2
  1357. #define CGEMM_DEFAULT_UNROLL_M 8
  1358. #define ZGEMM_DEFAULT_UNROLL_M 4
  1359. #define XGEMM_DEFAULT_UNROLL_M 1
  1360. #define SGEMM_DEFAULT_UNROLL_N 4
  1361. #ifndef DYNAMIC_ARCH
  1362. #define DGEMM_DEFAULT_UNROLL_N 2
  1363. #else
  1364. #define DGEMM_DEFAULT_UNROLL_N 8
  1365. #endif
  1366. #define QGEMM_DEFAULT_UNROLL_N 2
  1367. #define CGEMM_DEFAULT_UNROLL_N 2
  1368. #define ZGEMM_DEFAULT_UNROLL_N 2
  1369. #define XGEMM_DEFAULT_UNROLL_N 1
  1370. #define SGEMM_DEFAULT_UNROLL_MN 32
  1371. #define DGEMM_DEFAULT_UNROLL_MN 32
  1372. #endif
  1373. #ifdef ARCH_X86
  1374. #define SGEMM_DEFAULT_P 512
  1375. #define SGEMM_DEFAULT_R sgemm_r
  1376. #define DGEMM_DEFAULT_P 512
  1377. #define DGEMM_DEFAULT_R dgemm_r
  1378. #define QGEMM_DEFAULT_P 504
  1379. #define QGEMM_DEFAULT_R qgemm_r
  1380. #define CGEMM_DEFAULT_P 128
  1381. #define CGEMM_DEFAULT_R 1024
  1382. #define ZGEMM_DEFAULT_P 512
  1383. #define ZGEMM_DEFAULT_R zgemm_r
  1384. #define XGEMM_DEFAULT_P 252
  1385. #define XGEMM_DEFAULT_R xgemm_r
  1386. #define SGEMM_DEFAULT_Q 256
  1387. #define DGEMM_DEFAULT_Q 256
  1388. #define QGEMM_DEFAULT_Q 128
  1389. #define CGEMM_DEFAULT_Q 256
  1390. #define ZGEMM_DEFAULT_Q 192
  1391. #define XGEMM_DEFAULT_Q 128
  1392. #else
  1393. #define SGEMM_DEFAULT_P 448
  1394. #define DGEMM_DEFAULT_P 192
  1395. #define CGEMM_DEFAULT_P 384
  1396. #define ZGEMM_DEFAULT_P 256
  1397. #define SGEMM_DEFAULT_Q 448
  1398. #define DGEMM_DEFAULT_Q 384
  1399. #define CGEMM_DEFAULT_Q 192
  1400. #define ZGEMM_DEFAULT_Q 128
  1401. #define SGEMM_DEFAULT_R sgemm_r
  1402. #define DGEMM_DEFAULT_R 8640
  1403. #define CGEMM_DEFAULT_R cgemm_r
  1404. #define ZGEMM_DEFAULT_R zgemm_r
  1405. #define QGEMM_DEFAULT_Q 128
  1406. #define QGEMM_DEFAULT_P 504
  1407. #define QGEMM_DEFAULT_R qgemm_r
  1408. #define XGEMM_DEFAULT_P 252
  1409. #define XGEMM_DEFAULT_R xgemm_r
  1410. #define XGEMM_DEFAULT_Q 128
  1411. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1412. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1413. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1414. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1415. #define CGEMM3M_DEFAULT_P 320
  1416. #define ZGEMM3M_DEFAULT_P 256
  1417. #define XGEMM3M_DEFAULT_P 112
  1418. #define CGEMM3M_DEFAULT_Q 320
  1419. #define ZGEMM3M_DEFAULT_Q 256
  1420. #define XGEMM3M_DEFAULT_Q 224
  1421. #define CGEMM3M_DEFAULT_R 12288
  1422. #define ZGEMM3M_DEFAULT_R 12288
  1423. #define XGEMM3M_DEFAULT_R 12288
  1424. #endif
  1425. #endif
  1426. #ifdef SAPPHIRERAPIDS
  1427. #define SNUMOPT 16
  1428. #define DNUMOPT 8
  1429. #define GEMM_DEFAULT_OFFSET_A 0
  1430. #define GEMM_DEFAULT_OFFSET_B 0
  1431. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1432. #define SYMV_P 8
  1433. #if defined(XDOUBLE) || defined(DOUBLE)
  1434. #define SWITCH_RATIO 8
  1435. #define GEMM_PREFERED_SIZE 8
  1436. #else
  1437. #define SWITCH_RATIO 16
  1438. #define GEMM_PREFERED_SIZE 16
  1439. #endif
  1440. #define USE_SGEMM_KERNEL_DIRECT 1
  1441. #undef SBGEMM_DEFAULT_UNROLL_N
  1442. #undef SBGEMM_DEFAULT_UNROLL_M
  1443. #undef SBGEMM_DEFAULT_P
  1444. #undef SBGEMM_DEFAULT_R
  1445. #undef SBGEMM_DEFAULT_Q
  1446. // FIXME: actually UNROLL_M = UNROLL_N = 16
  1447. // If M and N is equal, OpenBLAS will reuse OCOPY as ICOPY.
  1448. // But for AMX, they are not the same, set UNROLL_M = 32 to workaround
  1449. #define SBGEMM_DEFAULT_UNROLL_N 16
  1450. #define SBGEMM_DEFAULT_UNROLL_M 32
  1451. #define SBGEMM_DEFAULT_P 256
  1452. #define SBGEMM_DEFAULT_Q 1024
  1453. #define SBGEMM_DEFAULT_R sbgemm_r
  1454. #ifdef ARCH_X86
  1455. #define SGEMM_DEFAULT_UNROLL_M 4
  1456. #define DGEMM_DEFAULT_UNROLL_M 2
  1457. #define QGEMM_DEFAULT_UNROLL_M 2
  1458. #define CGEMM_DEFAULT_UNROLL_M 2
  1459. #define ZGEMM_DEFAULT_UNROLL_M 1
  1460. #define XGEMM_DEFAULT_UNROLL_M 1
  1461. #define SGEMM_DEFAULT_UNROLL_N 4
  1462. #define DGEMM_DEFAULT_UNROLL_N 4
  1463. #define QGEMM_DEFAULT_UNROLL_N 2
  1464. #define CGEMM_DEFAULT_UNROLL_N 2
  1465. #define ZGEMM_DEFAULT_UNROLL_N 2
  1466. #define XGEMM_DEFAULT_UNROLL_N 1
  1467. #else
  1468. #define SGEMM_DEFAULT_UNROLL_M 16
  1469. #define DGEMM_DEFAULT_UNROLL_M 16
  1470. #define QGEMM_DEFAULT_UNROLL_M 2
  1471. #define CGEMM_DEFAULT_UNROLL_M 8
  1472. #define ZGEMM_DEFAULT_UNROLL_M 4
  1473. #define XGEMM_DEFAULT_UNROLL_M 1
  1474. #define SGEMM_DEFAULT_UNROLL_N 4
  1475. #define DGEMM_DEFAULT_UNROLL_N 2
  1476. #define QGEMM_DEFAULT_UNROLL_N 2
  1477. #define CGEMM_DEFAULT_UNROLL_N 2
  1478. #define ZGEMM_DEFAULT_UNROLL_N 2
  1479. #define XGEMM_DEFAULT_UNROLL_N 1
  1480. #define SGEMM_DEFAULT_UNROLL_MN 32
  1481. #define DGEMM_DEFAULT_UNROLL_MN 32
  1482. #endif
  1483. #ifdef ARCH_X86
  1484. #define SGEMM_DEFAULT_P 512
  1485. #define SGEMM_DEFAULT_R sgemm_r
  1486. #define DGEMM_DEFAULT_P 512
  1487. #define DGEMM_DEFAULT_R dgemm_r
  1488. #define QGEMM_DEFAULT_P 504
  1489. #define QGEMM_DEFAULT_R qgemm_r
  1490. #define CGEMM_DEFAULT_P 128
  1491. #define CGEMM_DEFAULT_R 1024
  1492. #define ZGEMM_DEFAULT_P 512
  1493. #define ZGEMM_DEFAULT_R zgemm_r
  1494. #define XGEMM_DEFAULT_P 252
  1495. #define XGEMM_DEFAULT_R xgemm_r
  1496. #define SGEMM_DEFAULT_Q 256
  1497. #define DGEMM_DEFAULT_Q 256
  1498. #define QGEMM_DEFAULT_Q 128
  1499. #define CGEMM_DEFAULT_Q 256
  1500. #define ZGEMM_DEFAULT_Q 192
  1501. #define XGEMM_DEFAULT_Q 128
  1502. #else
  1503. #define SGEMM_DEFAULT_P 640
  1504. #define DGEMM_DEFAULT_P 192
  1505. #define CGEMM_DEFAULT_P 384
  1506. #define ZGEMM_DEFAULT_P 256
  1507. #define SGEMM_DEFAULT_Q 320
  1508. #define DGEMM_DEFAULT_Q 384
  1509. #define CGEMM_DEFAULT_Q 192
  1510. #define ZGEMM_DEFAULT_Q 128
  1511. #define SGEMM_DEFAULT_R sgemm_r
  1512. #define DGEMM_DEFAULT_R 8640
  1513. #define CGEMM_DEFAULT_R cgemm_r
  1514. #define ZGEMM_DEFAULT_R zgemm_r
  1515. #define QGEMM_DEFAULT_Q 128
  1516. #define QGEMM_DEFAULT_P 504
  1517. #define QGEMM_DEFAULT_R qgemm_r
  1518. #define XGEMM_DEFAULT_P 252
  1519. #define XGEMM_DEFAULT_R xgemm_r
  1520. #define XGEMM_DEFAULT_Q 128
  1521. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1522. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1523. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1524. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1525. #define CGEMM3M_DEFAULT_P 320
  1526. #define ZGEMM3M_DEFAULT_P 256
  1527. #define XGEMM3M_DEFAULT_P 112
  1528. #define CGEMM3M_DEFAULT_Q 320
  1529. #define ZGEMM3M_DEFAULT_Q 256
  1530. #define XGEMM3M_DEFAULT_Q 224
  1531. #define CGEMM3M_DEFAULT_R 12288
  1532. #define ZGEMM3M_DEFAULT_R 12288
  1533. #define XGEMM3M_DEFAULT_R 12288
  1534. #endif
  1535. #endif
  1536. #ifdef COOPERLAKE
  1537. #define SNUMOPT 16
  1538. #define DNUMOPT 8
  1539. #define GEMM_DEFAULT_OFFSET_A 0
  1540. #define GEMM_DEFAULT_OFFSET_B 0
  1541. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1542. #define SYMV_P 8
  1543. #if defined(XDOUBLE) || defined(DOUBLE)
  1544. #define SWITCH_RATIO 8
  1545. #define GEMM_PREFERED_SIZE 8
  1546. #else
  1547. #define SWITCH_RATIO 16
  1548. #define GEMM_PREFERED_SIZE 16
  1549. #endif
  1550. #define USE_SGEMM_KERNEL_DIRECT 1
  1551. #undef SBGEMM_DEFAULT_UNROLL_N
  1552. #undef SBGEMM_DEFAULT_UNROLL_M
  1553. #undef SBGEMM_DEFAULT_P
  1554. #undef SBGEMM_DEFAULT_R
  1555. #undef SBGEMM_DEFAULT_Q
  1556. #define SBGEMM_DEFAULT_UNROLL_N 4
  1557. #define SBGEMM_DEFAULT_UNROLL_M 16
  1558. #define SBGEMM_DEFAULT_P 384
  1559. #define SBGEMM_DEFAULT_Q 768
  1560. #define SBGEMM_DEFAULT_R sbgemm_r
  1561. #ifdef ARCH_X86
  1562. #define SGEMM_DEFAULT_UNROLL_M 4
  1563. #define DGEMM_DEFAULT_UNROLL_M 2
  1564. #define QGEMM_DEFAULT_UNROLL_M 2
  1565. #define CGEMM_DEFAULT_UNROLL_M 2
  1566. #define ZGEMM_DEFAULT_UNROLL_M 1
  1567. #define XGEMM_DEFAULT_UNROLL_M 1
  1568. #define SGEMM_DEFAULT_UNROLL_N 4
  1569. #define DGEMM_DEFAULT_UNROLL_N 4
  1570. #define QGEMM_DEFAULT_UNROLL_N 2
  1571. #define CGEMM_DEFAULT_UNROLL_N 2
  1572. #define ZGEMM_DEFAULT_UNROLL_N 2
  1573. #define XGEMM_DEFAULT_UNROLL_N 1
  1574. #else
  1575. #define SGEMM_DEFAULT_UNROLL_M 16
  1576. #define DGEMM_DEFAULT_UNROLL_M 16
  1577. #define QGEMM_DEFAULT_UNROLL_M 2
  1578. #define CGEMM_DEFAULT_UNROLL_M 8
  1579. #define ZGEMM_DEFAULT_UNROLL_M 4
  1580. #define XGEMM_DEFAULT_UNROLL_M 1
  1581. #define SGEMM_DEFAULT_UNROLL_N 4
  1582. #define DGEMM_DEFAULT_UNROLL_N 2
  1583. #define QGEMM_DEFAULT_UNROLL_N 2
  1584. #define CGEMM_DEFAULT_UNROLL_N 2
  1585. #define ZGEMM_DEFAULT_UNROLL_N 2
  1586. #define XGEMM_DEFAULT_UNROLL_N 1
  1587. #define SGEMM_DEFAULT_UNROLL_MN 32
  1588. #define DGEMM_DEFAULT_UNROLL_MN 32
  1589. #endif
  1590. #ifdef ARCH_X86
  1591. #define SGEMM_DEFAULT_P 512
  1592. #define SGEMM_DEFAULT_R sgemm_r
  1593. #define DGEMM_DEFAULT_P 512
  1594. #define DGEMM_DEFAULT_R dgemm_r
  1595. #define QGEMM_DEFAULT_P 504
  1596. #define QGEMM_DEFAULT_R qgemm_r
  1597. #define CGEMM_DEFAULT_P 128
  1598. #define CGEMM_DEFAULT_R 1024
  1599. #define ZGEMM_DEFAULT_P 512
  1600. #define ZGEMM_DEFAULT_R zgemm_r
  1601. #define XGEMM_DEFAULT_P 252
  1602. #define XGEMM_DEFAULT_R xgemm_r
  1603. #define SGEMM_DEFAULT_Q 256
  1604. #define DGEMM_DEFAULT_Q 256
  1605. #define QGEMM_DEFAULT_Q 128
  1606. #define CGEMM_DEFAULT_Q 256
  1607. #define ZGEMM_DEFAULT_Q 192
  1608. #define XGEMM_DEFAULT_Q 128
  1609. #else
  1610. #define SGEMM_DEFAULT_P 640
  1611. #define DGEMM_DEFAULT_P 192
  1612. #define CGEMM_DEFAULT_P 384
  1613. #define ZGEMM_DEFAULT_P 256
  1614. #define SGEMM_DEFAULT_Q 320
  1615. #define DGEMM_DEFAULT_Q 384
  1616. #define CGEMM_DEFAULT_Q 192
  1617. #define ZGEMM_DEFAULT_Q 128
  1618. #define SGEMM_DEFAULT_R sgemm_r
  1619. #define DGEMM_DEFAULT_R 8640
  1620. #define CGEMM_DEFAULT_R cgemm_r
  1621. #define ZGEMM_DEFAULT_R zgemm_r
  1622. #define QGEMM_DEFAULT_Q 128
  1623. #define QGEMM_DEFAULT_P 504
  1624. #define QGEMM_DEFAULT_R qgemm_r
  1625. #define XGEMM_DEFAULT_P 252
  1626. #define XGEMM_DEFAULT_R xgemm_r
  1627. #define XGEMM_DEFAULT_Q 128
  1628. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1629. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1630. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1631. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1632. #define CGEMM3M_DEFAULT_P 320
  1633. #define ZGEMM3M_DEFAULT_P 256
  1634. #define XGEMM3M_DEFAULT_P 112
  1635. #define CGEMM3M_DEFAULT_Q 320
  1636. #define ZGEMM3M_DEFAULT_Q 256
  1637. #define XGEMM3M_DEFAULT_Q 224
  1638. #define CGEMM3M_DEFAULT_R 12288
  1639. #define ZGEMM3M_DEFAULT_R 12288
  1640. #define XGEMM3M_DEFAULT_R 12288
  1641. #endif
  1642. #endif
  1643. #ifdef ATOM
  1644. #define SNUMOPT 2
  1645. #define DNUMOPT 1
  1646. #define GEMM_DEFAULT_OFFSET_A 64
  1647. #define GEMM_DEFAULT_OFFSET_B 0
  1648. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  1649. #define SYMV_P 8
  1650. #ifdef ARCH_X86
  1651. #define SGEMM_DEFAULT_UNROLL_M 4
  1652. #define DGEMM_DEFAULT_UNROLL_M 2
  1653. #define QGEMM_DEFAULT_UNROLL_M 2
  1654. #define CGEMM_DEFAULT_UNROLL_M 2
  1655. #define ZGEMM_DEFAULT_UNROLL_M 1
  1656. #define XGEMM_DEFAULT_UNROLL_M 1
  1657. #else
  1658. #define SGEMM_DEFAULT_UNROLL_M 8
  1659. #define DGEMM_DEFAULT_UNROLL_M 4
  1660. #define QGEMM_DEFAULT_UNROLL_M 2
  1661. #define CGEMM_DEFAULT_UNROLL_M 4
  1662. #define ZGEMM_DEFAULT_UNROLL_M 2
  1663. #define XGEMM_DEFAULT_UNROLL_M 1
  1664. #endif
  1665. #define SGEMM_DEFAULT_UNROLL_N 4
  1666. #define DGEMM_DEFAULT_UNROLL_N 2
  1667. #define QGEMM_DEFAULT_UNROLL_N 2
  1668. #define CGEMM_DEFAULT_UNROLL_N 2
  1669. #define ZGEMM_DEFAULT_UNROLL_N 1
  1670. #define XGEMM_DEFAULT_UNROLL_N 1
  1671. #define SGEMM_DEFAULT_P sgemm_p
  1672. #define SGEMM_DEFAULT_R sgemm_r
  1673. #define DGEMM_DEFAULT_P dgemm_p
  1674. #define DGEMM_DEFAULT_R dgemm_r
  1675. #define QGEMM_DEFAULT_P qgemm_p
  1676. #define QGEMM_DEFAULT_R qgemm_r
  1677. #define CGEMM_DEFAULT_P cgemm_p
  1678. #define CGEMM_DEFAULT_R cgemm_r
  1679. #define ZGEMM_DEFAULT_P zgemm_p
  1680. #define ZGEMM_DEFAULT_R zgemm_r
  1681. #define XGEMM_DEFAULT_P xgemm_p
  1682. #define XGEMM_DEFAULT_R xgemm_r
  1683. #define SGEMM_DEFAULT_Q 256
  1684. #define DGEMM_DEFAULT_Q 256
  1685. #define QGEMM_DEFAULT_Q 256
  1686. #define CGEMM_DEFAULT_Q 256
  1687. #define ZGEMM_DEFAULT_Q 256
  1688. #define XGEMM_DEFAULT_Q 256
  1689. #endif
  1690. #ifdef ITANIUM2
  1691. #define SNUMOPT 4
  1692. #define DNUMOPT 4
  1693. #define GEMM_DEFAULT_OFFSET_A 0
  1694. #define GEMM_DEFAULT_OFFSET_B 128
  1695. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1696. #define SGEMM_DEFAULT_UNROLL_M 8
  1697. #define SGEMM_DEFAULT_UNROLL_N 8
  1698. #define DGEMM_DEFAULT_UNROLL_M 8
  1699. #define DGEMM_DEFAULT_UNROLL_N 8
  1700. #define QGEMM_DEFAULT_UNROLL_M 8
  1701. #define QGEMM_DEFAULT_UNROLL_N 8
  1702. #define CGEMM_DEFAULT_UNROLL_M 4
  1703. #define CGEMM_DEFAULT_UNROLL_N 4
  1704. #define ZGEMM_DEFAULT_UNROLL_M 4
  1705. #define ZGEMM_DEFAULT_UNROLL_N 4
  1706. #define XGEMM_DEFAULT_UNROLL_M 4
  1707. #define XGEMM_DEFAULT_UNROLL_N 4
  1708. #define SGEMM_DEFAULT_P sgemm_p
  1709. #define DGEMM_DEFAULT_P dgemm_p
  1710. #define QGEMM_DEFAULT_P qgemm_p
  1711. #define CGEMM_DEFAULT_P cgemm_p
  1712. #define ZGEMM_DEFAULT_P zgemm_p
  1713. #define XGEMM_DEFAULT_P xgemm_p
  1714. #define SGEMM_DEFAULT_Q 1024
  1715. #define DGEMM_DEFAULT_Q 1024
  1716. #define QGEMM_DEFAULT_Q 1024
  1717. #define CGEMM_DEFAULT_Q 1024
  1718. #define ZGEMM_DEFAULT_Q 1024
  1719. #define XGEMM_DEFAULT_Q 1024
  1720. #define SGEMM_DEFAULT_R sgemm_r
  1721. #define DGEMM_DEFAULT_R dgemm_r
  1722. #define QGEMM_DEFAULT_R qgemm_r
  1723. #define CGEMM_DEFAULT_R cgemm_r
  1724. #define ZGEMM_DEFAULT_R zgemm_r
  1725. #define XGEMM_DEFAULT_R xgemm_r
  1726. #define SYMV_P 16
  1727. #define GETRF_FACTOR 0.65
  1728. #endif
  1729. #if defined(EV4) || defined(EV5) || defined(EV6)
  1730. #ifdef EV4
  1731. #define SNUMOPT 1
  1732. #define DNUMOPT 1
  1733. #else
  1734. #define SNUMOPT 2
  1735. #define DNUMOPT 2
  1736. #endif
  1737. #define GEMM_DEFAULT_OFFSET_A 512
  1738. #define GEMM_DEFAULT_OFFSET_B 512
  1739. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  1740. #define SGEMM_DEFAULT_UNROLL_M 4
  1741. #define SGEMM_DEFAULT_UNROLL_N 4
  1742. #define DGEMM_DEFAULT_UNROLL_M 4
  1743. #define DGEMM_DEFAULT_UNROLL_N 4
  1744. #define CGEMM_DEFAULT_UNROLL_M 2
  1745. #define CGEMM_DEFAULT_UNROLL_N 2
  1746. #define ZGEMM_DEFAULT_UNROLL_M 2
  1747. #define ZGEMM_DEFAULT_UNROLL_N 2
  1748. #define SYMV_P 8
  1749. #ifdef EV4
  1750. #define SGEMM_DEFAULT_P 32
  1751. #define SGEMM_DEFAULT_Q 112
  1752. #define SGEMM_DEFAULT_R 256
  1753. #define DGEMM_DEFAULT_P 32
  1754. #define DGEMM_DEFAULT_Q 56
  1755. #define DGEMM_DEFAULT_R 256
  1756. #define CGEMM_DEFAULT_P 32
  1757. #define CGEMM_DEFAULT_Q 64
  1758. #define CGEMM_DEFAULT_R 240
  1759. #define ZGEMM_DEFAULT_P 32
  1760. #define ZGEMM_DEFAULT_Q 32
  1761. #define ZGEMM_DEFAULT_R 240
  1762. #endif
  1763. #ifdef EV5
  1764. #define SGEMM_DEFAULT_P 64
  1765. #define SGEMM_DEFAULT_Q 256
  1766. #define DGEMM_DEFAULT_P 64
  1767. #define DGEMM_DEFAULT_Q 128
  1768. #define CGEMM_DEFAULT_P 64
  1769. #define CGEMM_DEFAULT_Q 128
  1770. #define ZGEMM_DEFAULT_P 64
  1771. #define ZGEMM_DEFAULT_Q 64
  1772. #endif
  1773. #ifdef EV6
  1774. #define SGEMM_DEFAULT_P 256
  1775. #define SGEMM_DEFAULT_Q 512
  1776. #define DGEMM_DEFAULT_P 256
  1777. #define DGEMM_DEFAULT_Q 256
  1778. #define CGEMM_DEFAULT_P 256
  1779. #define CGEMM_DEFAULT_Q 256
  1780. #define ZGEMM_DEFAULT_P 128
  1781. #define ZGEMM_DEFAULT_Q 256
  1782. #endif
  1783. #endif
  1784. #ifdef CELL
  1785. #define SNUMOPT 2
  1786. #define DNUMOPT 2
  1787. #define GEMM_DEFAULT_OFFSET_A 0
  1788. #define GEMM_DEFAULT_OFFSET_B 8192
  1789. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  1790. #define SGEMM_DEFAULT_UNROLL_M 16
  1791. #define SGEMM_DEFAULT_UNROLL_N 4
  1792. #define DGEMM_DEFAULT_UNROLL_M 4
  1793. #define DGEMM_DEFAULT_UNROLL_N 4
  1794. #define CGEMM_DEFAULT_UNROLL_M 8
  1795. #define CGEMM_DEFAULT_UNROLL_N 2
  1796. #define ZGEMM_DEFAULT_UNROLL_M 2
  1797. #define ZGEMM_DEFAULT_UNROLL_N 2
  1798. #define SGEMM_DEFAULT_P 128
  1799. #define DGEMM_DEFAULT_P 128
  1800. #define CGEMM_DEFAULT_P 128
  1801. #define ZGEMM_DEFAULT_P 128
  1802. #define SGEMM_DEFAULT_Q 512
  1803. #define DGEMM_DEFAULT_Q 256
  1804. #define CGEMM_DEFAULT_Q 256
  1805. #define ZGEMM_DEFAULT_Q 128
  1806. #define SYMV_P 4
  1807. #endif
  1808. #ifdef PPCG4
  1809. #define GEMM_DEFAULT_OFFSET_A 0
  1810. #define GEMM_DEFAULT_OFFSET_B 1024
  1811. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1812. #define SGEMM_DEFAULT_UNROLL_M 16
  1813. #define SGEMM_DEFAULT_UNROLL_N 4
  1814. #define DGEMM_DEFAULT_UNROLL_M 4
  1815. #define DGEMM_DEFAULT_UNROLL_N 4
  1816. #define CGEMM_DEFAULT_UNROLL_M 2
  1817. #define CGEMM_DEFAULT_UNROLL_N 2
  1818. #define ZGEMM_DEFAULT_UNROLL_M 2
  1819. #define ZGEMM_DEFAULT_UNROLL_N 2
  1820. #define SGEMM_DEFAULT_P 256
  1821. #define DGEMM_DEFAULT_P 128
  1822. #define CGEMM_DEFAULT_P 128
  1823. #define ZGEMM_DEFAULT_P 64
  1824. #define SGEMM_DEFAULT_Q 256
  1825. #define DGEMM_DEFAULT_Q 256
  1826. #define CGEMM_DEFAULT_Q 256
  1827. #define ZGEMM_DEFAULT_Q 256
  1828. #define SYMV_P 4
  1829. #endif
  1830. #ifdef PPC970
  1831. #define SNUMOPT 4
  1832. #define DNUMOPT 4
  1833. #define GEMM_DEFAULT_OFFSET_A 2688
  1834. #define GEMM_DEFAULT_OFFSET_B 3072
  1835. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1836. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1837. #define SGEMM_DEFAULT_UNROLL_M 4
  1838. #else
  1839. #define SGEMM_DEFAULT_UNROLL_M 16
  1840. #endif
  1841. #define SGEMM_DEFAULT_UNROLL_N 4
  1842. #define DGEMM_DEFAULT_UNROLL_M 4
  1843. #define DGEMM_DEFAULT_UNROLL_N 4
  1844. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1845. #define CGEMM_DEFAULT_UNROLL_M 2
  1846. #else
  1847. #define CGEMM_DEFAULT_UNROLL_M 8
  1848. #endif
  1849. #define CGEMM_DEFAULT_UNROLL_N 2
  1850. #define ZGEMM_DEFAULT_UNROLL_M 2
  1851. #define ZGEMM_DEFAULT_UNROLL_N 2
  1852. #if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD)
  1853. #if L2_SIZE == 1024976
  1854. #define SGEMM_DEFAULT_P 320
  1855. #define DGEMM_DEFAULT_P 256
  1856. #define CGEMM_DEFAULT_P 256
  1857. #define ZGEMM_DEFAULT_P 256
  1858. #else
  1859. #define SGEMM_DEFAULT_P 176
  1860. #define DGEMM_DEFAULT_P 176
  1861. #define CGEMM_DEFAULT_P 176
  1862. #define ZGEMM_DEFAULT_P 176
  1863. #endif
  1864. #endif
  1865. #define SGEMM_DEFAULT_Q 512
  1866. #define DGEMM_DEFAULT_Q 256
  1867. #define CGEMM_DEFAULT_Q 256
  1868. #define ZGEMM_DEFAULT_Q 128
  1869. #define SYMV_P 4
  1870. #endif
  1871. #ifdef PPC440
  1872. #define SNUMOPT 2
  1873. #define DNUMOPT 2
  1874. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1875. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1876. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1877. #define SGEMM_DEFAULT_UNROLL_M 4
  1878. #define SGEMM_DEFAULT_UNROLL_N 4
  1879. #define DGEMM_DEFAULT_UNROLL_M 4
  1880. #define DGEMM_DEFAULT_UNROLL_N 4
  1881. #define CGEMM_DEFAULT_UNROLL_M 2
  1882. #define CGEMM_DEFAULT_UNROLL_N 2
  1883. #define ZGEMM_DEFAULT_UNROLL_M 2
  1884. #define ZGEMM_DEFAULT_UNROLL_N 2
  1885. #define SGEMM_DEFAULT_P 512
  1886. #define DGEMM_DEFAULT_P 512
  1887. #define CGEMM_DEFAULT_P 512
  1888. #define ZGEMM_DEFAULT_P 512
  1889. #define SGEMM_DEFAULT_Q 1024
  1890. #define DGEMM_DEFAULT_Q 512
  1891. #define CGEMM_DEFAULT_Q 512
  1892. #define ZGEMM_DEFAULT_Q 256
  1893. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  1894. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  1895. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  1896. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  1897. #define SYMV_P 4
  1898. #endif
  1899. #ifdef PPC440FP2
  1900. #define SNUMOPT 4
  1901. #define DNUMOPT 4
  1902. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1903. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1904. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1905. #define SGEMM_DEFAULT_UNROLL_M 8
  1906. #define SGEMM_DEFAULT_UNROLL_N 4
  1907. #define DGEMM_DEFAULT_UNROLL_M 8
  1908. #define DGEMM_DEFAULT_UNROLL_N 4
  1909. #define CGEMM_DEFAULT_UNROLL_M 4
  1910. #define CGEMM_DEFAULT_UNROLL_N 2
  1911. #define ZGEMM_DEFAULT_UNROLL_M 4
  1912. #define ZGEMM_DEFAULT_UNROLL_N 2
  1913. #define SGEMM_DEFAULT_P 128
  1914. #define DGEMM_DEFAULT_P 128
  1915. #define CGEMM_DEFAULT_P 128
  1916. #define ZGEMM_DEFAULT_P 128
  1917. #if 1
  1918. #define SGEMM_DEFAULT_Q 4096
  1919. #define DGEMM_DEFAULT_Q 3072
  1920. #define CGEMM_DEFAULT_Q 2048
  1921. #define ZGEMM_DEFAULT_Q 1024
  1922. #else
  1923. #define SGEMM_DEFAULT_Q 512
  1924. #define DGEMM_DEFAULT_Q 256
  1925. #define CGEMM_DEFAULT_Q 256
  1926. #define ZGEMM_DEFAULT_Q 128
  1927. #endif
  1928. #define SYMV_P 4
  1929. #endif
  1930. #if defined(POWER3) || defined(POWER4) || defined(POWER5)
  1931. #define GEMM_DEFAULT_OFFSET_A 0
  1932. #define GEMM_DEFAULT_OFFSET_B 2048
  1933. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1934. #define SGEMM_DEFAULT_UNROLL_M 4
  1935. #define SGEMM_DEFAULT_UNROLL_N 4
  1936. #define DGEMM_DEFAULT_UNROLL_M 4
  1937. #define DGEMM_DEFAULT_UNROLL_N 4
  1938. #define CGEMM_DEFAULT_UNROLL_M 2
  1939. #define CGEMM_DEFAULT_UNROLL_N 2
  1940. #define ZGEMM_DEFAULT_UNROLL_M 2
  1941. #define ZGEMM_DEFAULT_UNROLL_N 2
  1942. #ifdef POWER3
  1943. #define SNUMOPT 4
  1944. #define DNUMOPT 4
  1945. #define SGEMM_DEFAULT_P 256
  1946. #define SGEMM_DEFAULT_Q 432
  1947. #define SGEMM_DEFAULT_R 1012
  1948. #define DGEMM_DEFAULT_P 256
  1949. #define DGEMM_DEFAULT_Q 216
  1950. #define DGEMM_DEFAULT_R 1012
  1951. #define CGEMM_DEFAULT_P 256
  1952. #define CGEMM_DEFAULT_Q 104
  1953. #define CGEMM_DEFAULT_R 1012
  1954. #define ZGEMM_DEFAULT_P 256
  1955. #define ZGEMM_DEFAULT_Q 104
  1956. #define ZGEMM_DEFAULT_R 1012
  1957. #endif
  1958. #if defined(POWER4)
  1959. #ifdef ALLOC_HUGETLB
  1960. #define SGEMM_DEFAULT_P 184
  1961. #define DGEMM_DEFAULT_P 184
  1962. #define CGEMM_DEFAULT_P 184
  1963. #define ZGEMM_DEFAULT_P 184
  1964. #else
  1965. #define SGEMM_DEFAULT_P 144
  1966. #define DGEMM_DEFAULT_P 144
  1967. #define CGEMM_DEFAULT_P 144
  1968. #define ZGEMM_DEFAULT_P 144
  1969. #endif
  1970. #define SGEMM_DEFAULT_Q 256
  1971. #define CGEMM_DEFAULT_Q 256
  1972. #define DGEMM_DEFAULT_Q 256
  1973. #define ZGEMM_DEFAULT_Q 256
  1974. #endif
  1975. #if defined(POWER5)
  1976. #ifdef ALLOC_HUGETLB
  1977. #define SGEMM_DEFAULT_P 512
  1978. #define DGEMM_DEFAULT_P 256
  1979. #define CGEMM_DEFAULT_P 256
  1980. #define ZGEMM_DEFAULT_P 128
  1981. #else
  1982. #define SGEMM_DEFAULT_P 320
  1983. #define DGEMM_DEFAULT_P 160
  1984. #define CGEMM_DEFAULT_P 160
  1985. #define ZGEMM_DEFAULT_P 80
  1986. #endif
  1987. #define SGEMM_DEFAULT_Q 256
  1988. #define CGEMM_DEFAULT_Q 256
  1989. #define DGEMM_DEFAULT_Q 256
  1990. #define ZGEMM_DEFAULT_Q 256
  1991. #endif
  1992. #define SYMV_P 8
  1993. #endif
  1994. #if defined(POWER6)
  1995. #define SNUMOPT 4
  1996. #define DNUMOPT 4
  1997. #define GEMM_DEFAULT_OFFSET_A 384
  1998. #define GEMM_DEFAULT_OFFSET_B 1024
  1999. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2000. #define SGEMM_DEFAULT_UNROLL_M 4
  2001. #define SGEMM_DEFAULT_UNROLL_N 4
  2002. #define DGEMM_DEFAULT_UNROLL_M 4
  2003. #define DGEMM_DEFAULT_UNROLL_N 4
  2004. #define CGEMM_DEFAULT_UNROLL_M 2
  2005. #define CGEMM_DEFAULT_UNROLL_N 4
  2006. #define ZGEMM_DEFAULT_UNROLL_M 2
  2007. #define ZGEMM_DEFAULT_UNROLL_N 4
  2008. #define SGEMM_DEFAULT_P 992
  2009. #define DGEMM_DEFAULT_P 480
  2010. #define CGEMM_DEFAULT_P 488
  2011. #define ZGEMM_DEFAULT_P 248
  2012. #define SGEMM_DEFAULT_Q 504
  2013. #define DGEMM_DEFAULT_Q 504
  2014. #define CGEMM_DEFAULT_Q 400
  2015. #define ZGEMM_DEFAULT_Q 400
  2016. #define SYMV_P 8
  2017. #endif
  2018. #if defined(POWER8)
  2019. #define SNUMOPT 16
  2020. #define DNUMOPT 8
  2021. #define GEMM_DEFAULT_OFFSET_A 0
  2022. #define GEMM_DEFAULT_OFFSET_B 65536
  2023. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2024. #if defined(__32BIT__)
  2025. #warning using BINARY32==POWER6
  2026. #define SGEMM_DEFAULT_UNROLL_M 4
  2027. #define SGEMM_DEFAULT_UNROLL_N 4
  2028. #define DGEMM_DEFAULT_UNROLL_M 4
  2029. #define DGEMM_DEFAULT_UNROLL_N 4
  2030. #define CGEMM_DEFAULT_UNROLL_M 2
  2031. #define CGEMM_DEFAULT_UNROLL_N 4
  2032. #define ZGEMM_DEFAULT_UNROLL_M 2
  2033. #define ZGEMM_DEFAULT_UNROLL_N 4
  2034. #else
  2035. #define SGEMM_DEFAULT_UNROLL_M 16
  2036. #define SGEMM_DEFAULT_UNROLL_N 8
  2037. #define DGEMM_DEFAULT_UNROLL_M 16
  2038. #define DGEMM_DEFAULT_UNROLL_N 4
  2039. #define CGEMM_DEFAULT_UNROLL_M 8
  2040. #define CGEMM_DEFAULT_UNROLL_N 4
  2041. #define ZGEMM_DEFAULT_UNROLL_M 8
  2042. #define ZGEMM_DEFAULT_UNROLL_N 2
  2043. #endif
  2044. #define SGEMM_DEFAULT_P 1280UL
  2045. #define DGEMM_DEFAULT_P 640UL
  2046. #define CGEMM_DEFAULT_P 640UL
  2047. #define ZGEMM_DEFAULT_P 320UL
  2048. #define SGEMM_DEFAULT_Q 640UL
  2049. #define DGEMM_DEFAULT_Q 720UL
  2050. #define CGEMM_DEFAULT_Q 640UL
  2051. #define ZGEMM_DEFAULT_Q 640UL
  2052. #if 0
  2053. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  2054. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  2055. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  2056. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  2057. #endif
  2058. #define SGEMM_DEFAULT_R 4096
  2059. #define DGEMM_DEFAULT_R 4096
  2060. #define CGEMM_DEFAULT_R 4096
  2061. #define ZGEMM_DEFAULT_R 4096
  2062. #define SYMV_P 8
  2063. #endif
  2064. #if defined(POWER9)
  2065. #define SNUMOPT 16
  2066. #define DNUMOPT 8
  2067. #define GEMM_DEFAULT_OFFSET_A 0
  2068. #define GEMM_DEFAULT_OFFSET_B 65536
  2069. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2070. #define SWITCH_RATIO 16
  2071. #define GEMM_PREFERED_SIZE 16
  2072. #define SGEMM_DEFAULT_UNROLL_M 16
  2073. #define SGEMM_DEFAULT_UNROLL_N 8
  2074. #define DGEMM_DEFAULT_UNROLL_M 16
  2075. #define DGEMM_DEFAULT_UNROLL_N 4
  2076. #define CGEMM_DEFAULT_UNROLL_M 8
  2077. #define CGEMM_DEFAULT_UNROLL_N 4
  2078. #define ZGEMM_DEFAULT_UNROLL_M 8
  2079. #define ZGEMM_DEFAULT_UNROLL_N 2
  2080. #define SGEMM_DEFAULT_P 832
  2081. #define DGEMM_DEFAULT_P 128
  2082. #define CGEMM_DEFAULT_P 512
  2083. #define ZGEMM_DEFAULT_P 256
  2084. #define SGEMM_DEFAULT_Q 1026
  2085. #define DGEMM_DEFAULT_Q 384
  2086. #define CGEMM_DEFAULT_Q 1026
  2087. #define ZGEMM_DEFAULT_Q 1026
  2088. #define SGEMM_DEFAULT_R 4096
  2089. #define DGEMM_DEFAULT_R 4096
  2090. #define CGEMM_DEFAULT_R 4096
  2091. #define ZGEMM_DEFAULT_R 4096
  2092. #define SYMV_P 8
  2093. #endif
  2094. #if defined(POWER10)
  2095. #define SNUMOPT 16
  2096. #define DNUMOPT 8
  2097. #define GEMM_DEFAULT_OFFSET_A 0
  2098. #define GEMM_DEFAULT_OFFSET_B 65536
  2099. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2100. #define SWITCH_RATIO 16
  2101. #define GEMM_PREFERED_SIZE 16
  2102. #define SGEMM_DEFAULT_UNROLL_M 16
  2103. #define SGEMM_DEFAULT_UNROLL_N 8
  2104. #if defined(HAVE_GAS) && (HAVE_GAS == 1)
  2105. #define DGEMM_DEFAULT_UNROLL_M 16
  2106. #define DGEMM_DEFAULT_UNROLL_N 4
  2107. #else
  2108. #define DGEMM_DEFAULT_UNROLL_M 8
  2109. #define DGEMM_DEFAULT_UNROLL_N 8
  2110. #endif
  2111. #define CGEMM_DEFAULT_UNROLL_M 8
  2112. #define CGEMM_DEFAULT_UNROLL_N 4
  2113. #define ZGEMM_DEFAULT_UNROLL_M 8
  2114. #define ZGEMM_DEFAULT_UNROLL_N 2
  2115. #define SGEMM_DEFAULT_P 512
  2116. #define DGEMM_DEFAULT_P 384
  2117. #define CGEMM_DEFAULT_P 512
  2118. #define ZGEMM_DEFAULT_P 256
  2119. #define SGEMM_DEFAULT_Q 512
  2120. #define DGEMM_DEFAULT_Q 512
  2121. #define CGEMM_DEFAULT_Q 384
  2122. #define ZGEMM_DEFAULT_Q 384
  2123. #define SGEMM_DEFAULT_R 4096
  2124. #define DGEMM_DEFAULT_R 4096
  2125. #define CGEMM_DEFAULT_R 4096
  2126. #define ZGEMM_DEFAULT_R 4096
  2127. #define SYMV_P 8
  2128. #undef SBGEMM_DEFAULT_UNROLL_N
  2129. #undef SBGEMM_DEFAULT_UNROLL_M
  2130. #undef SBGEMM_DEFAULT_P
  2131. #undef SBGEMM_DEFAULT_R
  2132. #undef SBGEMM_DEFAULT_Q
  2133. #define SBGEMM_DEFAULT_UNROLL_M 16
  2134. #define SBGEMM_DEFAULT_UNROLL_N 8
  2135. #define SBGEMM_DEFAULT_P 832
  2136. #define SBGEMM_DEFAULT_Q 1026
  2137. #define SBGEMM_DEFAULT_R 4096
  2138. #endif
  2139. #if defined(SPARC) && defined(V7)
  2140. #define SNUMOPT 4
  2141. #define DNUMOPT 4
  2142. #define GEMM_DEFAULT_OFFSET_A 0
  2143. #define GEMM_DEFAULT_OFFSET_B 2048
  2144. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2145. #define SGEMM_DEFAULT_UNROLL_M 2
  2146. #define SGEMM_DEFAULT_UNROLL_N 8
  2147. #define DGEMM_DEFAULT_UNROLL_M 2
  2148. #define DGEMM_DEFAULT_UNROLL_N 8
  2149. #define CGEMM_DEFAULT_UNROLL_M 1
  2150. #define CGEMM_DEFAULT_UNROLL_N 4
  2151. #define ZGEMM_DEFAULT_UNROLL_M 1
  2152. #define ZGEMM_DEFAULT_UNROLL_N 4
  2153. #define SGEMM_DEFAULT_P 256
  2154. #define DGEMM_DEFAULT_P 256
  2155. #define CGEMM_DEFAULT_P 256
  2156. #define ZGEMM_DEFAULT_P 256
  2157. #define SGEMM_DEFAULT_Q 512
  2158. #define DGEMM_DEFAULT_Q 256
  2159. #define CGEMM_DEFAULT_Q 256
  2160. #define ZGEMM_DEFAULT_Q 128
  2161. #define SYMV_P 8
  2162. #define GEMM_THREAD gemm_thread_mn
  2163. #endif
  2164. #if (defined(SPARC) && defined(V9)) || defined(__sparc_v9__)
  2165. #define SNUMOPT 2
  2166. #define DNUMOPT 2
  2167. #define GEMM_DEFAULT_OFFSET_A 0
  2168. #define GEMM_DEFAULT_OFFSET_B 2048
  2169. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2170. #define SGEMM_DEFAULT_UNROLL_M 4
  2171. #define SGEMM_DEFAULT_UNROLL_N 4
  2172. #define DGEMM_DEFAULT_UNROLL_M 4
  2173. #define DGEMM_DEFAULT_UNROLL_N 4
  2174. #define CGEMM_DEFAULT_UNROLL_M 2
  2175. #define CGEMM_DEFAULT_UNROLL_N 2
  2176. #define ZGEMM_DEFAULT_UNROLL_M 2
  2177. #define ZGEMM_DEFAULT_UNROLL_N 2
  2178. #define SGEMM_DEFAULT_P 512
  2179. #define DGEMM_DEFAULT_P 512
  2180. #define CGEMM_DEFAULT_P 512
  2181. #define ZGEMM_DEFAULT_P 512
  2182. #define SGEMM_DEFAULT_Q 1024
  2183. #define DGEMM_DEFAULT_Q 512
  2184. #define CGEMM_DEFAULT_Q 512
  2185. #define ZGEMM_DEFAULT_Q 256
  2186. #define SYMV_P 8
  2187. #endif
  2188. #ifdef SICORTEX
  2189. #define SNUMOPT 2
  2190. #define DNUMOPT 2
  2191. #define GEMM_DEFAULT_OFFSET_A 0
  2192. #define GEMM_DEFAULT_OFFSET_B 0
  2193. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2194. #define SGEMM_DEFAULT_UNROLL_M 2
  2195. #define SGEMM_DEFAULT_UNROLL_N 8
  2196. #define DGEMM_DEFAULT_UNROLL_M 2
  2197. #define DGEMM_DEFAULT_UNROLL_N 8
  2198. #define CGEMM_DEFAULT_UNROLL_M 1
  2199. #define CGEMM_DEFAULT_UNROLL_N 4
  2200. #define ZGEMM_DEFAULT_UNROLL_M 1
  2201. #define ZGEMM_DEFAULT_UNROLL_N 4
  2202. #define SGEMM_DEFAULT_P 108
  2203. #define DGEMM_DEFAULT_P 112
  2204. #define CGEMM_DEFAULT_P 108
  2205. #define ZGEMM_DEFAULT_P 112
  2206. #define SGEMM_DEFAULT_Q 288
  2207. #define DGEMM_DEFAULT_Q 144
  2208. #define CGEMM_DEFAULT_Q 144
  2209. #define ZGEMM_DEFAULT_Q 72
  2210. #define SGEMM_DEFAULT_R 2000
  2211. #define DGEMM_DEFAULT_R 2000
  2212. #define CGEMM_DEFAULT_R 2000
  2213. #define ZGEMM_DEFAULT_R 2000
  2214. #define SYMV_P 16
  2215. #endif
  2216. #if defined(LOONGSON3R4)
  2217. #define SNUMOPT 2
  2218. #define DNUMOPT 2
  2219. #define GEMM_DEFAULT_OFFSET_A 0
  2220. #define GEMM_DEFAULT_OFFSET_B 0
  2221. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2222. #ifdef HAVE_MSA
  2223. #define SGEMM_DEFAULT_UNROLL_M 8
  2224. #define SGEMM_DEFAULT_UNROLL_N 8
  2225. #define DGEMM_DEFAULT_UNROLL_M 8
  2226. #define DGEMM_DEFAULT_UNROLL_N 4
  2227. #define CGEMM_DEFAULT_UNROLL_M 8
  2228. #define CGEMM_DEFAULT_UNROLL_N 4
  2229. #define ZGEMM_DEFAULT_UNROLL_M 4
  2230. #define ZGEMM_DEFAULT_UNROLL_N 4
  2231. #else
  2232. #define SGEMM_DEFAULT_UNROLL_M 8
  2233. #define SGEMM_DEFAULT_UNROLL_N 4
  2234. #define DGEMM_DEFAULT_UNROLL_M 4
  2235. #define DGEMM_DEFAULT_UNROLL_N 4
  2236. #define CGEMM_DEFAULT_UNROLL_M 4
  2237. #define CGEMM_DEFAULT_UNROLL_N 2
  2238. #define ZGEMM_DEFAULT_UNROLL_M 2
  2239. #define ZGEMM_DEFAULT_UNROLL_N 2
  2240. #endif
  2241. #define SGEMM_DEFAULT_P 64
  2242. #define DGEMM_DEFAULT_P 44
  2243. #define CGEMM_DEFAULT_P 64
  2244. #define ZGEMM_DEFAULT_P 32
  2245. #define SGEMM_DEFAULT_Q 192
  2246. #define DGEMM_DEFAULT_Q 92
  2247. #define CGEMM_DEFAULT_Q 128
  2248. #define ZGEMM_DEFAULT_Q 80
  2249. #define SGEMM_DEFAULT_R 640
  2250. #define DGEMM_DEFAULT_R dgemm_r
  2251. #define CGEMM_DEFAULT_R 640
  2252. #define ZGEMM_DEFAULT_R 640
  2253. #define GEMM_OFFSET_A1 0x10000
  2254. #define GEMM_OFFSET_B1 0x100000
  2255. #define SYMV_P 16
  2256. #endif
  2257. #if defined(LOONGSON3R3)
  2258. ////Copy from SICORTEX
  2259. #define SNUMOPT 2
  2260. #define DNUMOPT 2
  2261. #define GEMM_DEFAULT_OFFSET_A 0
  2262. #define GEMM_DEFAULT_OFFSET_B 0
  2263. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2264. #define SGEMM_DEFAULT_UNROLL_M 8
  2265. #define SGEMM_DEFAULT_UNROLL_N 4
  2266. #define DGEMM_DEFAULT_UNROLL_M 4
  2267. #define DGEMM_DEFAULT_UNROLL_N 4
  2268. #define CGEMM_DEFAULT_UNROLL_M 4
  2269. #define CGEMM_DEFAULT_UNROLL_N 2
  2270. #define ZGEMM_DEFAULT_UNROLL_M 2
  2271. #define ZGEMM_DEFAULT_UNROLL_N 2
  2272. #define SGEMM_DEFAULT_P 64
  2273. #define DGEMM_DEFAULT_P 44
  2274. #define CGEMM_DEFAULT_P 64
  2275. #define ZGEMM_DEFAULT_P 32
  2276. #define SGEMM_DEFAULT_Q 192
  2277. #define DGEMM_DEFAULT_Q 92
  2278. #define CGEMM_DEFAULT_Q 128
  2279. #define ZGEMM_DEFAULT_Q 80
  2280. #define SGEMM_DEFAULT_R 640
  2281. #define DGEMM_DEFAULT_R dgemm_r
  2282. #define CGEMM_DEFAULT_R 640
  2283. #define ZGEMM_DEFAULT_R 640
  2284. #define GEMM_OFFSET_A1 0x10000
  2285. #define GEMM_OFFSET_B1 0x100000
  2286. #define SYMV_P 16
  2287. #endif
  2288. #if defined (LOONGSON3R5)
  2289. #define SNUMOPT 2
  2290. #define DNUMOPT 2
  2291. #define GEMM_DEFAULT_OFFSET_A 0
  2292. #define GEMM_DEFAULT_OFFSET_B 0
  2293. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2294. #define SGEMM_DEFAULT_UNROLL_N 8
  2295. #define DGEMM_DEFAULT_UNROLL_N 8
  2296. #define QGEMM_DEFAULT_UNROLL_N 2
  2297. #define CGEMM_DEFAULT_UNROLL_N 4
  2298. #define ZGEMM_DEFAULT_UNROLL_N 4
  2299. #define XGEMM_DEFAULT_UNROLL_N 1
  2300. #define SGEMM_DEFAULT_UNROLL_M 2
  2301. #define DGEMM_DEFAULT_UNROLL_M 2
  2302. #define QGEMM_DEFAULT_UNROLL_M 2
  2303. #define CGEMM_DEFAULT_UNROLL_M 1
  2304. #define ZGEMM_DEFAULT_UNROLL_M 1
  2305. #define XGEMM_DEFAULT_UNROLL_M 1
  2306. #define SGEMM_DEFAULT_P sgemm_p
  2307. #define DGEMM_DEFAULT_P dgemm_p
  2308. #define QGEMM_DEFAULT_P qgemm_p
  2309. #define CGEMM_DEFAULT_P cgemm_p
  2310. #define ZGEMM_DEFAULT_P zgemm_p
  2311. #define XGEMM_DEFAULT_P xgemm_p
  2312. #define SGEMM_DEFAULT_R sgemm_r
  2313. #define DGEMM_DEFAULT_R dgemm_r
  2314. #define QGEMM_DEFAULT_R qgemm_r
  2315. #define CGEMM_DEFAULT_R cgemm_r
  2316. #define ZGEMM_DEFAULT_R zgemm_r
  2317. #define XGEMM_DEFAULT_R xgemm_r
  2318. #define SGEMM_DEFAULT_Q 128
  2319. #define DGEMM_DEFAULT_Q 128
  2320. #define QGEMM_DEFAULT_Q 128
  2321. #define CGEMM_DEFAULT_Q 128
  2322. #define ZGEMM_DEFAULT_Q 128
  2323. #define XGEMM_DEFAULT_Q 128
  2324. #define SYMV_P 16
  2325. #endif
  2326. #if defined(P5600) || defined(MIPS1004K) || defined(MIPS24K) || defined(I6400) || defined(P6600) || defined(I6500)
  2327. #define SNUMOPT 2
  2328. #define DNUMOPT 2
  2329. #define GEMM_DEFAULT_OFFSET_A 0
  2330. #define GEMM_DEFAULT_OFFSET_B 0
  2331. #define GEMM_DEFAULT_ALIGN (BLASLONG) 0x03fffUL
  2332. #if defined(HAVE_MSA) && !defined(NO_MSA)
  2333. #define SGEMM_DEFAULT_UNROLL_M 8
  2334. #define SGEMM_DEFAULT_UNROLL_N 8
  2335. #define DGEMM_DEFAULT_UNROLL_M 8
  2336. #define DGEMM_DEFAULT_UNROLL_N 4
  2337. #define CGEMM_DEFAULT_UNROLL_M 8
  2338. #define CGEMM_DEFAULT_UNROLL_N 4
  2339. #define ZGEMM_DEFAULT_UNROLL_M 4
  2340. #define ZGEMM_DEFAULT_UNROLL_N 4
  2341. #else
  2342. #define SGEMM_DEFAULT_UNROLL_M 2
  2343. #define SGEMM_DEFAULT_UNROLL_N 2
  2344. #define DGEMM_DEFAULT_UNROLL_M 2
  2345. #define DGEMM_DEFAULT_UNROLL_N 2
  2346. #define CGEMM_DEFAULT_UNROLL_M 2
  2347. #define CGEMM_DEFAULT_UNROLL_N 2
  2348. #define ZGEMM_DEFAULT_UNROLL_M 2
  2349. #define ZGEMM_DEFAULT_UNROLL_N 2
  2350. #endif
  2351. #define SGEMM_DEFAULT_P 128
  2352. #define DGEMM_DEFAULT_P 128
  2353. #define CGEMM_DEFAULT_P 96
  2354. #define ZGEMM_DEFAULT_P 64
  2355. #define SGEMM_DEFAULT_Q 240
  2356. #define DGEMM_DEFAULT_Q 120
  2357. #define CGEMM_DEFAULT_Q 120
  2358. #define ZGEMM_DEFAULT_Q 120
  2359. #define SGEMM_DEFAULT_R 12288
  2360. #define DGEMM_DEFAULT_R 8192
  2361. #define CGEMM_DEFAULT_R 4096
  2362. #define ZGEMM_DEFAULT_R 4096
  2363. #define SYMV_P 16
  2364. #endif
  2365. #ifdef RISCV64_GENERIC
  2366. #define GEMM_DEFAULT_OFFSET_A 0
  2367. #define GEMM_DEFAULT_OFFSET_B 0
  2368. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2369. #define SGEMM_DEFAULT_UNROLL_M 2
  2370. #define SGEMM_DEFAULT_UNROLL_N 2
  2371. #define DGEMM_DEFAULT_UNROLL_M 2
  2372. #define DGEMM_DEFAULT_UNROLL_N 2
  2373. #define CGEMM_DEFAULT_UNROLL_M 2
  2374. #define CGEMM_DEFAULT_UNROLL_N 2
  2375. #define ZGEMM_DEFAULT_UNROLL_M 2
  2376. #define ZGEMM_DEFAULT_UNROLL_N 2
  2377. #define SGEMM_DEFAULT_P 128
  2378. #define DGEMM_DEFAULT_P 128
  2379. #define CGEMM_DEFAULT_P 96
  2380. #define ZGEMM_DEFAULT_P 64
  2381. #define SGEMM_DEFAULT_Q 240
  2382. #define DGEMM_DEFAULT_Q 120
  2383. #define CGEMM_DEFAULT_Q 120
  2384. #define ZGEMM_DEFAULT_Q 120
  2385. #define SGEMM_DEFAULT_R 12288
  2386. #define DGEMM_DEFAULT_R 8192
  2387. #define CGEMM_DEFAULT_R 4096
  2388. #define ZGEMM_DEFAULT_R 4096
  2389. #define SYMV_P 16
  2390. #define GEMM_DEFAULT_OFFSET_A 0
  2391. #define GEMM_DEFAULT_OFFSET_B 0
  2392. #endif
  2393. #ifdef C910V
  2394. #define GEMM_DEFAULT_OFFSET_A 0
  2395. #define GEMM_DEFAULT_OFFSET_B 0
  2396. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2397. #define SGEMM_DEFAULT_UNROLL_M 16
  2398. #define SGEMM_DEFAULT_UNROLL_N 4
  2399. #define DGEMM_DEFAULT_UNROLL_M 8
  2400. #define DGEMM_DEFAULT_UNROLL_N 4
  2401. #define CGEMM_DEFAULT_UNROLL_M 2
  2402. #define CGEMM_DEFAULT_UNROLL_N 2
  2403. #define ZGEMM_DEFAULT_UNROLL_M 2
  2404. #define ZGEMM_DEFAULT_UNROLL_N 2
  2405. #define SGEMM_DEFAULT_P 160
  2406. #define DGEMM_DEFAULT_P 160
  2407. #define CGEMM_DEFAULT_P 96
  2408. #define ZGEMM_DEFAULT_P 64
  2409. #define SGEMM_DEFAULT_Q 240
  2410. #define DGEMM_DEFAULT_Q 128
  2411. #define CGEMM_DEFAULT_Q 120
  2412. #define ZGEMM_DEFAULT_Q 120
  2413. #define SGEMM_DEFAULT_R 12288
  2414. #define DGEMM_DEFAULT_R 8192
  2415. #define CGEMM_DEFAULT_R 4096
  2416. #define ZGEMM_DEFAULT_R 4096
  2417. #define SYMV_P 16
  2418. #define GEMM_DEFAULT_OFFSET_A 0
  2419. #define GEMM_DEFAULT_OFFSET_B 0
  2420. #endif
  2421. #ifdef ARMV7
  2422. #define SNUMOPT 2
  2423. #define DNUMOPT 2
  2424. #define GEMM_DEFAULT_OFFSET_A 0
  2425. #define GEMM_DEFAULT_OFFSET_B 0
  2426. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2427. #define SGEMM_DEFAULT_UNROLL_M 4
  2428. #define SGEMM_DEFAULT_UNROLL_N 4
  2429. #define DGEMM_DEFAULT_UNROLL_M 4
  2430. #define DGEMM_DEFAULT_UNROLL_N 4
  2431. #define CGEMM_DEFAULT_UNROLL_M 2
  2432. #define CGEMM_DEFAULT_UNROLL_N 2
  2433. #define ZGEMM_DEFAULT_UNROLL_M 2
  2434. #define ZGEMM_DEFAULT_UNROLL_N 2
  2435. #define SGEMM_DEFAULT_P 128
  2436. #define DGEMM_DEFAULT_P 128
  2437. #define CGEMM_DEFAULT_P 96
  2438. #define ZGEMM_DEFAULT_P 64
  2439. #define SGEMM_DEFAULT_Q 240
  2440. #define DGEMM_DEFAULT_Q 120
  2441. #define CGEMM_DEFAULT_Q 120
  2442. #define ZGEMM_DEFAULT_Q 120
  2443. #define SGEMM_DEFAULT_R 12288
  2444. #define DGEMM_DEFAULT_R 8192
  2445. #define CGEMM_DEFAULT_R 4096
  2446. #define ZGEMM_DEFAULT_R 4096
  2447. #define SYMV_P 16
  2448. #endif
  2449. #if defined(ARMV6)
  2450. #define SNUMOPT 2
  2451. #define DNUMOPT 2
  2452. #define GEMM_DEFAULT_OFFSET_A 0
  2453. #define GEMM_DEFAULT_OFFSET_B 0
  2454. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2455. #define SGEMM_DEFAULT_UNROLL_M 4
  2456. #define SGEMM_DEFAULT_UNROLL_N 2
  2457. #define DGEMM_DEFAULT_UNROLL_M 4
  2458. #define DGEMM_DEFAULT_UNROLL_N 2
  2459. #define CGEMM_DEFAULT_UNROLL_M 2
  2460. #define CGEMM_DEFAULT_UNROLL_N 2
  2461. #define ZGEMM_DEFAULT_UNROLL_M 2
  2462. #define ZGEMM_DEFAULT_UNROLL_N 2
  2463. #define SGEMM_DEFAULT_P 128
  2464. #define DGEMM_DEFAULT_P 128
  2465. #define CGEMM_DEFAULT_P 96
  2466. #define ZGEMM_DEFAULT_P 64
  2467. #define SGEMM_DEFAULT_Q 240
  2468. #define DGEMM_DEFAULT_Q 120
  2469. #define CGEMM_DEFAULT_Q 120
  2470. #define ZGEMM_DEFAULT_Q 120
  2471. #define SGEMM_DEFAULT_R 12288
  2472. #define DGEMM_DEFAULT_R 8192
  2473. #define CGEMM_DEFAULT_R 4096
  2474. #define ZGEMM_DEFAULT_R 4096
  2475. #define SYMV_P 16
  2476. #endif
  2477. /* Common ARMv8 parameters */
  2478. #if defined(ARMV8)
  2479. #define SNUMOPT 2
  2480. #define DNUMOPT 2
  2481. #define GEMM_DEFAULT_OFFSET_A 0
  2482. #define GEMM_DEFAULT_OFFSET_B 0
  2483. #ifdef _WIN64
  2484. /* Use explicit casting for win64 as LLP64 datamodel is used */
  2485. #define GEMM_DEFAULT_ALIGN (BLASULONG)0x03fffUL
  2486. #else
  2487. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2488. #endif
  2489. #define SYMV_P 16
  2490. #if defined(CORTEXA57) || \
  2491. defined(CORTEXA72) || defined(CORTEXA73) || \
  2492. defined(FALKOR) || defined(TSV110) || defined(EMAG8180) || defined(VORTEX)
  2493. #define SGEMM_DEFAULT_UNROLL_M 16
  2494. #define SGEMM_DEFAULT_UNROLL_N 4
  2495. #define DGEMM_DEFAULT_UNROLL_M 8
  2496. #define DGEMM_DEFAULT_UNROLL_N 4
  2497. #define CGEMM_DEFAULT_UNROLL_M 8
  2498. #define CGEMM_DEFAULT_UNROLL_N 4
  2499. #define ZGEMM_DEFAULT_UNROLL_M 4
  2500. #define ZGEMM_DEFAULT_UNROLL_N 4
  2501. /*FIXME: this should be using the cache size, but there is currently no easy way to
  2502. query that on ARM. So if getarch counted more than 8 cores we simply assume the host
  2503. is a big desktop or server with abundant cache rather than a phone or embedded device */
  2504. #if NUM_CORES > 8 || defined(TSV110) || defined(EMAG8180) || defined(VORTEX)
  2505. #define SGEMM_DEFAULT_P 512
  2506. #define DGEMM_DEFAULT_P 256
  2507. #define CGEMM_DEFAULT_P 256
  2508. #define ZGEMM_DEFAULT_P 128
  2509. #define SGEMM_DEFAULT_Q 1024
  2510. #define DGEMM_DEFAULT_Q 512
  2511. #define CGEMM_DEFAULT_Q 512
  2512. #define ZGEMM_DEFAULT_Q 512
  2513. #else
  2514. #define SGEMM_DEFAULT_P 128
  2515. #define DGEMM_DEFAULT_P 160
  2516. #define CGEMM_DEFAULT_P 128
  2517. #define ZGEMM_DEFAULT_P 128
  2518. #define SGEMM_DEFAULT_Q 352
  2519. #define DGEMM_DEFAULT_Q 128
  2520. #define CGEMM_DEFAULT_Q 224
  2521. #define ZGEMM_DEFAULT_Q 112
  2522. #endif
  2523. #define SGEMM_DEFAULT_R 4096
  2524. #define DGEMM_DEFAULT_R 4096
  2525. #define CGEMM_DEFAULT_R 4096
  2526. #define ZGEMM_DEFAULT_R 2048
  2527. #elif defined(CORTEXA53) || defined(CORTEXA55)
  2528. #define SGEMM_DEFAULT_UNROLL_M 8
  2529. #define SGEMM_DEFAULT_UNROLL_N 8
  2530. #define DGEMM_DEFAULT_UNROLL_M 4
  2531. #define DGEMM_DEFAULT_UNROLL_N 4
  2532. #define CGEMM_DEFAULT_UNROLL_M 8
  2533. #define CGEMM_DEFAULT_UNROLL_N 4
  2534. #define ZGEMM_DEFAULT_UNROLL_M 4
  2535. #define ZGEMM_DEFAULT_UNROLL_N 4
  2536. #define SGEMM_DEFAULT_P 256
  2537. #define DGEMM_DEFAULT_P 160
  2538. #define CGEMM_DEFAULT_P 128
  2539. #define ZGEMM_DEFAULT_P 128
  2540. #define SGEMM_DEFAULT_Q 256
  2541. #define DGEMM_DEFAULT_Q 128
  2542. #define CGEMM_DEFAULT_Q 224
  2543. #define ZGEMM_DEFAULT_Q 112
  2544. #define SGEMM_DEFAULT_R 4096
  2545. #define DGEMM_DEFAULT_R 4096
  2546. #define CGEMM_DEFAULT_R 4096
  2547. #define ZGEMM_DEFAULT_R 2048
  2548. #elif defined(THUNDERX)
  2549. #define SGEMM_DEFAULT_UNROLL_M 4
  2550. #define SGEMM_DEFAULT_UNROLL_N 4
  2551. #define DGEMM_DEFAULT_UNROLL_M 2
  2552. #define DGEMM_DEFAULT_UNROLL_N 2
  2553. #define CGEMM_DEFAULT_UNROLL_M 2
  2554. #define CGEMM_DEFAULT_UNROLL_N 2
  2555. #define ZGEMM_DEFAULT_UNROLL_M 2
  2556. #define ZGEMM_DEFAULT_UNROLL_N 2
  2557. #define SGEMM_DEFAULT_P 128
  2558. #define DGEMM_DEFAULT_P 128
  2559. #define CGEMM_DEFAULT_P 96
  2560. #define ZGEMM_DEFAULT_P 64
  2561. #define SGEMM_DEFAULT_Q 240
  2562. #define DGEMM_DEFAULT_Q 120
  2563. #define CGEMM_DEFAULT_Q 120
  2564. #define ZGEMM_DEFAULT_Q 120
  2565. #define SGEMM_DEFAULT_R 12288
  2566. #define DGEMM_DEFAULT_R 8192
  2567. #define CGEMM_DEFAULT_R 4096
  2568. #define ZGEMM_DEFAULT_R 4096
  2569. #elif defined(THUNDERX2T99)
  2570. #define SGEMM_DEFAULT_UNROLL_M 16
  2571. #define SGEMM_DEFAULT_UNROLL_N 4
  2572. #define DGEMM_DEFAULT_UNROLL_M 8
  2573. #define DGEMM_DEFAULT_UNROLL_N 4
  2574. #define CGEMM_DEFAULT_UNROLL_M 8
  2575. #define CGEMM_DEFAULT_UNROLL_N 4
  2576. #define ZGEMM_DEFAULT_UNROLL_M 4
  2577. #define ZGEMM_DEFAULT_UNROLL_N 4
  2578. #define SGEMM_DEFAULT_P 128
  2579. #define DGEMM_DEFAULT_P 160
  2580. #define CGEMM_DEFAULT_P 128
  2581. #define ZGEMM_DEFAULT_P 128
  2582. #define SGEMM_DEFAULT_Q 352
  2583. #define DGEMM_DEFAULT_Q 128
  2584. #define CGEMM_DEFAULT_Q 224
  2585. #define ZGEMM_DEFAULT_Q 112
  2586. #define SGEMM_DEFAULT_R 4096
  2587. #define DGEMM_DEFAULT_R 4096
  2588. #define CGEMM_DEFAULT_R 4096
  2589. #define ZGEMM_DEFAULT_R 4096
  2590. #elif defined(THUNDERX3T110)
  2591. #define SGEMM_DEFAULT_UNROLL_M 16
  2592. #define SGEMM_DEFAULT_UNROLL_N 4
  2593. #define DGEMM_DEFAULT_UNROLL_M 8
  2594. #define DGEMM_DEFAULT_UNROLL_N 4
  2595. #define CGEMM_DEFAULT_UNROLL_M 8
  2596. #define CGEMM_DEFAULT_UNROLL_N 4
  2597. #define ZGEMM_DEFAULT_UNROLL_M 4
  2598. #define ZGEMM_DEFAULT_UNROLL_N 4
  2599. #define SGEMM_DEFAULT_P 128
  2600. #define DGEMM_DEFAULT_P 320
  2601. #define CGEMM_DEFAULT_P 128
  2602. #define ZGEMM_DEFAULT_P 128
  2603. #define SGEMM_DEFAULT_Q 352
  2604. #define DGEMM_DEFAULT_Q 128
  2605. #define CGEMM_DEFAULT_Q 224
  2606. #define ZGEMM_DEFAULT_Q 112
  2607. #define SGEMM_DEFAULT_R 4096
  2608. #define DGEMM_DEFAULT_R 4096
  2609. #define CGEMM_DEFAULT_R 4096
  2610. #define ZGEMM_DEFAULT_R 4096
  2611. #elif defined(NEOVERSEN1)
  2612. #define SGEMM_DEFAULT_UNROLL_M 16
  2613. #define SGEMM_DEFAULT_UNROLL_N 4
  2614. #define DGEMM_DEFAULT_UNROLL_M 8
  2615. #define DGEMM_DEFAULT_UNROLL_N 4
  2616. #define CGEMM_DEFAULT_UNROLL_M 8
  2617. #define CGEMM_DEFAULT_UNROLL_N 4
  2618. #define ZGEMM_DEFAULT_UNROLL_M 4
  2619. #define ZGEMM_DEFAULT_UNROLL_N 4
  2620. #define SGEMM_DEFAULT_P 128
  2621. #define DGEMM_DEFAULT_P 160
  2622. #define CGEMM_DEFAULT_P 128
  2623. #define ZGEMM_DEFAULT_P 128
  2624. #define SGEMM_DEFAULT_Q 352
  2625. #define DGEMM_DEFAULT_Q 128
  2626. #define CGEMM_DEFAULT_Q 224
  2627. #define ZGEMM_DEFAULT_Q 112
  2628. #define SGEMM_DEFAULT_R 4096
  2629. #define DGEMM_DEFAULT_R 4096
  2630. #define CGEMM_DEFAULT_R 4096
  2631. #define ZGEMM_DEFAULT_R 4096
  2632. #elif defined(ARMV8SVE) || defined(A64FX)
  2633. /* When all BLAS3 routines are implemeted with SVE, SGEMM_DEFAULT_UNROLL_M should be "sve_vl".
  2634. Until then, just keep it different than DGEMM_DEFAULT_UNROLL_N to keep copy routines in both directions seperated. */
  2635. #define SGEMM_DEFAULT_UNROLL_M 4
  2636. #define SGEMM_DEFAULT_UNROLL_N 8
  2637. /* SGEMM_UNROLL_MN is calculated as max(SGEMM_UNROLL_M, SGEMM_UNROLL_N)
  2638. * Since we don't define SGEMM_UNROLL_M correctly we have to manually set this macro.
  2639. * If SVE size is ever more than 1024, this should be increased also. */
  2640. #define SGEMM_DEFAULT_UNROLL_MN 32
  2641. /* When all BLAS3 routines are implemeted with SVE, DGEMM_DEFAULT_UNROLL_M should be "sve_vl".
  2642. Until then, just keep it different than DGEMM_DEFAULT_UNROLL_N to keep copy routines in both directions seperated. */
  2643. #define DGEMM_DEFAULT_UNROLL_M 2
  2644. #define DGEMM_DEFAULT_UNROLL_N 8
  2645. #define DGEMM_DEFAULT_UNROLL_MN 32
  2646. #define CGEMM_DEFAULT_UNROLL_M 8
  2647. #define CGEMM_DEFAULT_UNROLL_N 4
  2648. #define ZGEMM_DEFAULT_UNROLL_M 4
  2649. #define ZGEMM_DEFAULT_UNROLL_N 4
  2650. #define SGEMM_DEFAULT_P 128
  2651. #define DGEMM_DEFAULT_P 160
  2652. #define CGEMM_DEFAULT_P 128
  2653. #define ZGEMM_DEFAULT_P 128
  2654. #define SGEMM_DEFAULT_Q 352
  2655. #define DGEMM_DEFAULT_Q 128
  2656. #define CGEMM_DEFAULT_Q 224
  2657. #define ZGEMM_DEFAULT_Q 112
  2658. #define SGEMM_DEFAULT_R 4096
  2659. #define DGEMM_DEFAULT_R 4096
  2660. #define CGEMM_DEFAULT_R 4096
  2661. #define ZGEMM_DEFAULT_R 4096
  2662. #else /* Other/undetected ARMv8 cores */
  2663. #define SGEMM_DEFAULT_UNROLL_M 16
  2664. #define SGEMM_DEFAULT_UNROLL_N 4
  2665. #define DGEMM_DEFAULT_UNROLL_M 4
  2666. #define DGEMM_DEFAULT_UNROLL_N 8
  2667. #define CGEMM_DEFAULT_UNROLL_M 8
  2668. #define CGEMM_DEFAULT_UNROLL_N 4
  2669. #define ZGEMM_DEFAULT_UNROLL_M 4
  2670. #define ZGEMM_DEFAULT_UNROLL_N 4
  2671. #define SGEMM_DEFAULT_P 128
  2672. #define DGEMM_DEFAULT_P 160
  2673. #define CGEMM_DEFAULT_P 128
  2674. #define ZGEMM_DEFAULT_P 128
  2675. #define SGEMM_DEFAULT_Q 352
  2676. #define DGEMM_DEFAULT_Q 128
  2677. #define CGEMM_DEFAULT_Q 224
  2678. #define ZGEMM_DEFAULT_Q 112
  2679. #define SGEMM_DEFAULT_R 4096
  2680. #define DGEMM_DEFAULT_R 4096
  2681. #define CGEMM_DEFAULT_R 4096
  2682. #define ZGEMM_DEFAULT_R 4096
  2683. #endif /* Cores */
  2684. #endif /* ARMv8 */
  2685. #if defined(ARMV5)
  2686. #define SNUMOPT 2
  2687. #define DNUMOPT 2
  2688. #define GEMM_DEFAULT_OFFSET_A 0
  2689. #define GEMM_DEFAULT_OFFSET_B 0
  2690. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2691. #define SGEMM_DEFAULT_UNROLL_M 2
  2692. #define SGEMM_DEFAULT_UNROLL_N 2
  2693. #define DGEMM_DEFAULT_UNROLL_M 2
  2694. #define DGEMM_DEFAULT_UNROLL_N 2
  2695. #define CGEMM_DEFAULT_UNROLL_M 2
  2696. #define CGEMM_DEFAULT_UNROLL_N 2
  2697. #define ZGEMM_DEFAULT_UNROLL_M 2
  2698. #define ZGEMM_DEFAULT_UNROLL_N 2
  2699. #define SGEMM_DEFAULT_P 128
  2700. #define DGEMM_DEFAULT_P 128
  2701. #define CGEMM_DEFAULT_P 96
  2702. #define ZGEMM_DEFAULT_P 64
  2703. #define SGEMM_DEFAULT_Q 240
  2704. #define DGEMM_DEFAULT_Q 120
  2705. #define CGEMM_DEFAULT_Q 120
  2706. #define ZGEMM_DEFAULT_Q 120
  2707. #define SGEMM_DEFAULT_R 12288
  2708. #define DGEMM_DEFAULT_R 8192
  2709. #define CGEMM_DEFAULT_R 4096
  2710. #define ZGEMM_DEFAULT_R 4096
  2711. #define SYMV_P 16
  2712. #endif
  2713. #ifdef CORTEXA9
  2714. #define SNUMOPT 2
  2715. #define DNUMOPT 2
  2716. #define GEMM_DEFAULT_OFFSET_A 0
  2717. #define GEMM_DEFAULT_OFFSET_B 0
  2718. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2719. #define SGEMM_DEFAULT_UNROLL_M 4
  2720. #define SGEMM_DEFAULT_UNROLL_N 4
  2721. #define DGEMM_DEFAULT_UNROLL_M 4
  2722. #define DGEMM_DEFAULT_UNROLL_N 4
  2723. #define CGEMM_DEFAULT_UNROLL_M 2
  2724. #define CGEMM_DEFAULT_UNROLL_N 2
  2725. #define ZGEMM_DEFAULT_UNROLL_M 2
  2726. #define ZGEMM_DEFAULT_UNROLL_N 2
  2727. #define SGEMM_DEFAULT_P 128
  2728. #define DGEMM_DEFAULT_P 128
  2729. #define CGEMM_DEFAULT_P 96
  2730. #define ZGEMM_DEFAULT_P 64
  2731. #define SGEMM_DEFAULT_Q 240
  2732. #define DGEMM_DEFAULT_Q 120
  2733. #define CGEMM_DEFAULT_Q 120
  2734. #define ZGEMM_DEFAULT_Q 120
  2735. #define SGEMM_DEFAULT_R 12288
  2736. #define DGEMM_DEFAULT_R 8192
  2737. #define CGEMM_DEFAULT_R 4096
  2738. #define ZGEMM_DEFAULT_R 4096
  2739. #define SYMV_P 16
  2740. #endif
  2741. #ifdef CORTEXA15
  2742. #define SNUMOPT 2
  2743. #define DNUMOPT 2
  2744. #define GEMM_DEFAULT_OFFSET_A 0
  2745. #define GEMM_DEFAULT_OFFSET_B 0
  2746. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2747. #define SGEMM_DEFAULT_UNROLL_M 4
  2748. #define SGEMM_DEFAULT_UNROLL_N 4
  2749. #define DGEMM_DEFAULT_UNROLL_M 4
  2750. #define DGEMM_DEFAULT_UNROLL_N 4
  2751. #define CGEMM_DEFAULT_UNROLL_M 2
  2752. #define CGEMM_DEFAULT_UNROLL_N 2
  2753. #define ZGEMM_DEFAULT_UNROLL_M 2
  2754. #define ZGEMM_DEFAULT_UNROLL_N 2
  2755. #define SGEMM_DEFAULT_P 128
  2756. #define DGEMM_DEFAULT_P 128
  2757. #define CGEMM_DEFAULT_P 96
  2758. #define ZGEMM_DEFAULT_P 64
  2759. #define SGEMM_DEFAULT_Q 240
  2760. #define DGEMM_DEFAULT_Q 120
  2761. #define CGEMM_DEFAULT_Q 120
  2762. #define ZGEMM_DEFAULT_Q 120
  2763. #define SGEMM_DEFAULT_R 12288
  2764. #define DGEMM_DEFAULT_R 8192
  2765. #define CGEMM_DEFAULT_R 4096
  2766. #define ZGEMM_DEFAULT_R 4096
  2767. #define SYMV_P 16
  2768. #endif
  2769. #if defined(ZARCH_GENERIC)
  2770. #define SNUMOPT 2
  2771. #define DNUMOPT 2
  2772. #define GEMM_DEFAULT_OFFSET_A 0
  2773. #define GEMM_DEFAULT_OFFSET_B 0
  2774. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2775. #define SGEMM_DEFAULT_UNROLL_M 2
  2776. #define SGEMM_DEFAULT_UNROLL_N 2
  2777. #define DGEMM_DEFAULT_UNROLL_M 2
  2778. #define DGEMM_DEFAULT_UNROLL_N 2
  2779. #define CGEMM_DEFAULT_UNROLL_M 2
  2780. #define CGEMM_DEFAULT_UNROLL_N 2
  2781. #define ZGEMM_DEFAULT_UNROLL_M 2
  2782. #define ZGEMM_DEFAULT_UNROLL_N 2
  2783. #define SGEMM_DEFAULT_P 128
  2784. #define DGEMM_DEFAULT_P 128
  2785. #define CGEMM_DEFAULT_P 96
  2786. #define ZGEMM_DEFAULT_P 64
  2787. #define SGEMM_DEFAULT_Q 240
  2788. #define DGEMM_DEFAULT_Q 120
  2789. #define CGEMM_DEFAULT_Q 120
  2790. #define ZGEMM_DEFAULT_Q 120
  2791. #define SGEMM_DEFAULT_R 12288
  2792. #define DGEMM_DEFAULT_R 8192
  2793. #define CGEMM_DEFAULT_R 4096
  2794. #define ZGEMM_DEFAULT_R 4096
  2795. #define SYMV_P 16
  2796. #endif
  2797. #if defined(Z13)
  2798. #define SNUMOPT 2
  2799. #define DNUMOPT 2
  2800. #define GEMM_DEFAULT_OFFSET_A 0
  2801. #define GEMM_DEFAULT_OFFSET_B 0
  2802. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2803. #define SGEMM_DEFAULT_UNROLL_M 8
  2804. #define SGEMM_DEFAULT_UNROLL_N 4
  2805. #define DGEMM_DEFAULT_UNROLL_M 8
  2806. #define DGEMM_DEFAULT_UNROLL_N 4
  2807. #define CGEMM_DEFAULT_UNROLL_M 4
  2808. #define CGEMM_DEFAULT_UNROLL_N 4
  2809. #define ZGEMM_DEFAULT_UNROLL_M 4
  2810. #define ZGEMM_DEFAULT_UNROLL_N 4
  2811. #define SGEMM_DEFAULT_P 456
  2812. #define DGEMM_DEFAULT_P 320
  2813. #define CGEMM_DEFAULT_P 480
  2814. #define ZGEMM_DEFAULT_P 224
  2815. #define SGEMM_DEFAULT_Q 488
  2816. #define DGEMM_DEFAULT_Q 384
  2817. #define CGEMM_DEFAULT_Q 128
  2818. #define ZGEMM_DEFAULT_Q 352
  2819. #define SGEMM_DEFAULT_R 8192
  2820. #define DGEMM_DEFAULT_R 4096
  2821. #define CGEMM_DEFAULT_R 4096
  2822. #define ZGEMM_DEFAULT_R 2048
  2823. #define SYMV_P 16
  2824. #endif
  2825. #if defined(Z14)
  2826. #define SNUMOPT 2
  2827. #define DNUMOPT 2
  2828. #define GEMM_DEFAULT_OFFSET_A 0
  2829. #define GEMM_DEFAULT_OFFSET_B 0
  2830. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2831. #define SGEMM_DEFAULT_UNROLL_M 16
  2832. #define SGEMM_DEFAULT_UNROLL_N 4
  2833. #define DGEMM_DEFAULT_UNROLL_M 8
  2834. #define DGEMM_DEFAULT_UNROLL_N 4
  2835. #define CGEMM_DEFAULT_UNROLL_M 4
  2836. #define CGEMM_DEFAULT_UNROLL_N 4
  2837. #define ZGEMM_DEFAULT_UNROLL_M 4
  2838. #define ZGEMM_DEFAULT_UNROLL_N 4
  2839. #define SGEMM_DEFAULT_P 480
  2840. #define DGEMM_DEFAULT_P 320
  2841. #define CGEMM_DEFAULT_P 480
  2842. #define ZGEMM_DEFAULT_P 224
  2843. #define SGEMM_DEFAULT_Q 512
  2844. #define DGEMM_DEFAULT_Q 384
  2845. #define CGEMM_DEFAULT_Q 128
  2846. #define ZGEMM_DEFAULT_Q 352
  2847. #define SGEMM_DEFAULT_R 8192
  2848. #define DGEMM_DEFAULT_R 4096
  2849. #define CGEMM_DEFAULT_R 4096
  2850. #define ZGEMM_DEFAULT_R 2048
  2851. #define SYMV_P 16
  2852. #endif
  2853. #ifdef GENERIC
  2854. #define SNUMOPT 2
  2855. #define DNUMOPT 2
  2856. #define GEMM_DEFAULT_OFFSET_A 0
  2857. #define GEMM_DEFAULT_OFFSET_B 0
  2858. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  2859. #define SGEMM_DEFAULT_UNROLL_N 2
  2860. #define DGEMM_DEFAULT_UNROLL_N 2
  2861. #define QGEMM_DEFAULT_UNROLL_N 2
  2862. #define CGEMM_DEFAULT_UNROLL_N 2
  2863. #define ZGEMM_DEFAULT_UNROLL_N 2
  2864. #define XGEMM_DEFAULT_UNROLL_N 1
  2865. #ifdef ARCH_X86
  2866. #define SGEMM_DEFAULT_UNROLL_M 2
  2867. #define DGEMM_DEFAULT_UNROLL_M 2
  2868. #define QGEMM_DEFAULT_UNROLL_M 2
  2869. #define CGEMM_DEFAULT_UNROLL_M 2
  2870. #define ZGEMM_DEFAULT_UNROLL_M 2
  2871. #define XGEMM_DEFAULT_UNROLL_M 1
  2872. #else
  2873. #define SGEMM_DEFAULT_UNROLL_M 2
  2874. #define DGEMM_DEFAULT_UNROLL_M 2
  2875. #define QGEMM_DEFAULT_UNROLL_M 2
  2876. #define CGEMM_DEFAULT_UNROLL_M 2
  2877. #define ZGEMM_DEFAULT_UNROLL_M 2
  2878. #define XGEMM_DEFAULT_UNROLL_M 1
  2879. #endif
  2880. #ifdef ARCH_MIPS
  2881. #define SGEMM_DEFAULT_P 128
  2882. #define DGEMM_DEFAULT_P 128
  2883. #define CGEMM_DEFAULT_P 96
  2884. #define ZGEMM_DEFAULT_P 64
  2885. #define SGEMM_DEFAULT_Q 240
  2886. #define DGEMM_DEFAULT_Q 120
  2887. #define CGEMM_DEFAULT_Q 120
  2888. #define ZGEMM_DEFAULT_Q 120
  2889. #define SGEMM_DEFAULT_R 12288
  2890. #define DGEMM_DEFAULT_R 8192
  2891. #define CGEMM_DEFAULT_R 4096
  2892. #define ZGEMM_DEFAULT_R 4096
  2893. #else
  2894. #define SGEMM_DEFAULT_P sgemm_p
  2895. #define DGEMM_DEFAULT_P dgemm_p
  2896. #define QGEMM_DEFAULT_P qgemm_p
  2897. #define CGEMM_DEFAULT_P cgemm_p
  2898. #define ZGEMM_DEFAULT_P zgemm_p
  2899. #define XGEMM_DEFAULT_P xgemm_p
  2900. #define SGEMM_DEFAULT_R sgemm_r
  2901. #define DGEMM_DEFAULT_R dgemm_r
  2902. #define QGEMM_DEFAULT_R qgemm_r
  2903. #define CGEMM_DEFAULT_R cgemm_r
  2904. #define ZGEMM_DEFAULT_R zgemm_r
  2905. #define XGEMM_DEFAULT_R xgemm_r
  2906. #define SGEMM_DEFAULT_Q 128
  2907. #define DGEMM_DEFAULT_Q 128
  2908. #define QGEMM_DEFAULT_Q 128
  2909. #define CGEMM_DEFAULT_Q 128
  2910. #define ZGEMM_DEFAULT_Q 128
  2911. #define XGEMM_DEFAULT_Q 128
  2912. #endif
  2913. #define SYMV_P 16
  2914. #endif
  2915. #ifndef QGEMM_DEFAULT_UNROLL_M
  2916. #define QGEMM_DEFAULT_UNROLL_M 2
  2917. #endif
  2918. #ifndef QGEMM_DEFAULT_UNROLL_N
  2919. #define QGEMM_DEFAULT_UNROLL_N 2
  2920. #endif
  2921. #ifndef XGEMM_DEFAULT_UNROLL_M
  2922. #define XGEMM_DEFAULT_UNROLL_M 2
  2923. #endif
  2924. #ifndef XGEMM_DEFAULT_UNROLL_N
  2925. #define XGEMM_DEFAULT_UNROLL_N 2
  2926. #endif
  2927. #ifndef HAVE_SSE2
  2928. #define SHUFPD_0 shufps $0x44,
  2929. #define SHUFPD_1 shufps $0x4e,
  2930. #define SHUFPD_2 shufps $0xe4,
  2931. #define SHUFPD_3 shufps $0xee,
  2932. #endif
  2933. #ifndef SHUFPD_0
  2934. #define SHUFPD_0 shufpd $0,
  2935. #endif
  2936. #ifndef SHUFPD_1
  2937. #define SHUFPD_1 shufpd $1,
  2938. #endif
  2939. #ifndef SHUFPD_2
  2940. #define SHUFPD_2 shufpd $2,
  2941. #endif
  2942. #ifndef SHUFPD_3
  2943. #define SHUFPD_3 shufpd $3,
  2944. #endif
  2945. #ifndef SHUFPS_39
  2946. #define SHUFPS_39 shufps $0x39,
  2947. #endif
  2948. #endif