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 88 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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721
  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. #define DGEMM_DEFAULT_UNROLL_M 16
  1352. #define QGEMM_DEFAULT_UNROLL_M 2
  1353. #define CGEMM_DEFAULT_UNROLL_M 8
  1354. #define ZGEMM_DEFAULT_UNROLL_M 4
  1355. #define XGEMM_DEFAULT_UNROLL_M 1
  1356. #define SGEMM_DEFAULT_UNROLL_N 4
  1357. #define DGEMM_DEFAULT_UNROLL_N 2
  1358. #define QGEMM_DEFAULT_UNROLL_N 2
  1359. #define CGEMM_DEFAULT_UNROLL_N 2
  1360. #define ZGEMM_DEFAULT_UNROLL_N 2
  1361. #define XGEMM_DEFAULT_UNROLL_N 1
  1362. #define SGEMM_DEFAULT_UNROLL_MN 32
  1363. #define DGEMM_DEFAULT_UNROLL_MN 32
  1364. #endif
  1365. #ifdef ARCH_X86
  1366. #define SGEMM_DEFAULT_P 512
  1367. #define SGEMM_DEFAULT_R sgemm_r
  1368. #define DGEMM_DEFAULT_P 512
  1369. #define DGEMM_DEFAULT_R dgemm_r
  1370. #define QGEMM_DEFAULT_P 504
  1371. #define QGEMM_DEFAULT_R qgemm_r
  1372. #define CGEMM_DEFAULT_P 128
  1373. #define CGEMM_DEFAULT_R 1024
  1374. #define ZGEMM_DEFAULT_P 512
  1375. #define ZGEMM_DEFAULT_R zgemm_r
  1376. #define XGEMM_DEFAULT_P 252
  1377. #define XGEMM_DEFAULT_R xgemm_r
  1378. #define SGEMM_DEFAULT_Q 256
  1379. #define DGEMM_DEFAULT_Q 256
  1380. #define QGEMM_DEFAULT_Q 128
  1381. #define CGEMM_DEFAULT_Q 256
  1382. #define ZGEMM_DEFAULT_Q 192
  1383. #define XGEMM_DEFAULT_Q 128
  1384. #else
  1385. #define SGEMM_DEFAULT_P 448
  1386. #define DGEMM_DEFAULT_P 192
  1387. #define CGEMM_DEFAULT_P 384
  1388. #define ZGEMM_DEFAULT_P 256
  1389. #define SGEMM_DEFAULT_Q 448
  1390. #define DGEMM_DEFAULT_Q 384
  1391. #define CGEMM_DEFAULT_Q 192
  1392. #define ZGEMM_DEFAULT_Q 128
  1393. #define SGEMM_DEFAULT_R sgemm_r
  1394. #define DGEMM_DEFAULT_R 8640
  1395. #define CGEMM_DEFAULT_R cgemm_r
  1396. #define ZGEMM_DEFAULT_R zgemm_r
  1397. #define QGEMM_DEFAULT_Q 128
  1398. #define QGEMM_DEFAULT_P 504
  1399. #define QGEMM_DEFAULT_R qgemm_r
  1400. #define XGEMM_DEFAULT_P 252
  1401. #define XGEMM_DEFAULT_R xgemm_r
  1402. #define XGEMM_DEFAULT_Q 128
  1403. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1404. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1405. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1406. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1407. #define CGEMM3M_DEFAULT_P 320
  1408. #define ZGEMM3M_DEFAULT_P 256
  1409. #define XGEMM3M_DEFAULT_P 112
  1410. #define CGEMM3M_DEFAULT_Q 320
  1411. #define ZGEMM3M_DEFAULT_Q 256
  1412. #define XGEMM3M_DEFAULT_Q 224
  1413. #define CGEMM3M_DEFAULT_R 12288
  1414. #define ZGEMM3M_DEFAULT_R 12288
  1415. #define XGEMM3M_DEFAULT_R 12288
  1416. #endif
  1417. #endif
  1418. #ifdef SAPPHIRERAPIDS
  1419. #define SNUMOPT 16
  1420. #define DNUMOPT 8
  1421. #define GEMM_DEFAULT_OFFSET_A 0
  1422. #define GEMM_DEFAULT_OFFSET_B 0
  1423. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1424. #define SYMV_P 8
  1425. #if defined(XDOUBLE) || defined(DOUBLE)
  1426. #define SWITCH_RATIO 8
  1427. #define GEMM_PREFERED_SIZE 8
  1428. #else
  1429. #define SWITCH_RATIO 16
  1430. #define GEMM_PREFERED_SIZE 16
  1431. #endif
  1432. #define USE_SGEMM_KERNEL_DIRECT 1
  1433. #undef SBGEMM_DEFAULT_UNROLL_N
  1434. #undef SBGEMM_DEFAULT_UNROLL_M
  1435. #undef SBGEMM_DEFAULT_P
  1436. #undef SBGEMM_DEFAULT_R
  1437. #undef SBGEMM_DEFAULT_Q
  1438. // FIXME: actually UNROLL_M = UNROLL_N = 16
  1439. // If M and N is equal, OpenBLAS will reuse OCOPY as ICOPY.
  1440. // But for AMX, they are not the same, set UNROLL_M = 32 to workaround
  1441. #define SBGEMM_DEFAULT_UNROLL_N 16
  1442. #define SBGEMM_DEFAULT_UNROLL_M 32
  1443. #define SBGEMM_DEFAULT_P 256
  1444. #define SBGEMM_DEFAULT_Q 1024
  1445. #define SBGEMM_DEFAULT_R sbgemm_r
  1446. #ifdef ARCH_X86
  1447. #define SGEMM_DEFAULT_UNROLL_M 4
  1448. #define DGEMM_DEFAULT_UNROLL_M 2
  1449. #define QGEMM_DEFAULT_UNROLL_M 2
  1450. #define CGEMM_DEFAULT_UNROLL_M 2
  1451. #define ZGEMM_DEFAULT_UNROLL_M 1
  1452. #define XGEMM_DEFAULT_UNROLL_M 1
  1453. #define SGEMM_DEFAULT_UNROLL_N 4
  1454. #define DGEMM_DEFAULT_UNROLL_N 4
  1455. #define QGEMM_DEFAULT_UNROLL_N 2
  1456. #define CGEMM_DEFAULT_UNROLL_N 2
  1457. #define ZGEMM_DEFAULT_UNROLL_N 2
  1458. #define XGEMM_DEFAULT_UNROLL_N 1
  1459. #else
  1460. #define SGEMM_DEFAULT_UNROLL_M 16
  1461. #define DGEMM_DEFAULT_UNROLL_M 16
  1462. #define QGEMM_DEFAULT_UNROLL_M 2
  1463. #define CGEMM_DEFAULT_UNROLL_M 8
  1464. #define ZGEMM_DEFAULT_UNROLL_M 4
  1465. #define XGEMM_DEFAULT_UNROLL_M 1
  1466. #define SGEMM_DEFAULT_UNROLL_N 4
  1467. #define DGEMM_DEFAULT_UNROLL_N 2
  1468. #define QGEMM_DEFAULT_UNROLL_N 2
  1469. #define CGEMM_DEFAULT_UNROLL_N 2
  1470. #define ZGEMM_DEFAULT_UNROLL_N 2
  1471. #define XGEMM_DEFAULT_UNROLL_N 1
  1472. #define SGEMM_DEFAULT_UNROLL_MN 32
  1473. #define DGEMM_DEFAULT_UNROLL_MN 32
  1474. #endif
  1475. #ifdef ARCH_X86
  1476. #define SGEMM_DEFAULT_P 512
  1477. #define SGEMM_DEFAULT_R sgemm_r
  1478. #define DGEMM_DEFAULT_P 512
  1479. #define DGEMM_DEFAULT_R dgemm_r
  1480. #define QGEMM_DEFAULT_P 504
  1481. #define QGEMM_DEFAULT_R qgemm_r
  1482. #define CGEMM_DEFAULT_P 128
  1483. #define CGEMM_DEFAULT_R 1024
  1484. #define ZGEMM_DEFAULT_P 512
  1485. #define ZGEMM_DEFAULT_R zgemm_r
  1486. #define XGEMM_DEFAULT_P 252
  1487. #define XGEMM_DEFAULT_R xgemm_r
  1488. #define SGEMM_DEFAULT_Q 256
  1489. #define DGEMM_DEFAULT_Q 256
  1490. #define QGEMM_DEFAULT_Q 128
  1491. #define CGEMM_DEFAULT_Q 256
  1492. #define ZGEMM_DEFAULT_Q 192
  1493. #define XGEMM_DEFAULT_Q 128
  1494. #else
  1495. #define SGEMM_DEFAULT_P 640
  1496. #define DGEMM_DEFAULT_P 192
  1497. #define CGEMM_DEFAULT_P 384
  1498. #define ZGEMM_DEFAULT_P 256
  1499. #define SGEMM_DEFAULT_Q 320
  1500. #define DGEMM_DEFAULT_Q 384
  1501. #define CGEMM_DEFAULT_Q 192
  1502. #define ZGEMM_DEFAULT_Q 128
  1503. #define SGEMM_DEFAULT_R sgemm_r
  1504. #define DGEMM_DEFAULT_R 8640
  1505. #define CGEMM_DEFAULT_R cgemm_r
  1506. #define ZGEMM_DEFAULT_R zgemm_r
  1507. #define QGEMM_DEFAULT_Q 128
  1508. #define QGEMM_DEFAULT_P 504
  1509. #define QGEMM_DEFAULT_R qgemm_r
  1510. #define XGEMM_DEFAULT_P 252
  1511. #define XGEMM_DEFAULT_R xgemm_r
  1512. #define XGEMM_DEFAULT_Q 128
  1513. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1514. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1515. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1516. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1517. #define CGEMM3M_DEFAULT_P 320
  1518. #define ZGEMM3M_DEFAULT_P 256
  1519. #define XGEMM3M_DEFAULT_P 112
  1520. #define CGEMM3M_DEFAULT_Q 320
  1521. #define ZGEMM3M_DEFAULT_Q 256
  1522. #define XGEMM3M_DEFAULT_Q 224
  1523. #define CGEMM3M_DEFAULT_R 12288
  1524. #define ZGEMM3M_DEFAULT_R 12288
  1525. #define XGEMM3M_DEFAULT_R 12288
  1526. #endif
  1527. #endif
  1528. #ifdef COOPERLAKE
  1529. #define SNUMOPT 16
  1530. #define DNUMOPT 8
  1531. #define GEMM_DEFAULT_OFFSET_A 0
  1532. #define GEMM_DEFAULT_OFFSET_B 0
  1533. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1534. #define SYMV_P 8
  1535. #if defined(XDOUBLE) || defined(DOUBLE)
  1536. #define SWITCH_RATIO 8
  1537. #define GEMM_PREFERED_SIZE 8
  1538. #else
  1539. #define SWITCH_RATIO 16
  1540. #define GEMM_PREFERED_SIZE 16
  1541. #endif
  1542. #define USE_SGEMM_KERNEL_DIRECT 1
  1543. #undef SBGEMM_DEFAULT_UNROLL_N
  1544. #undef SBGEMM_DEFAULT_UNROLL_M
  1545. #undef SBGEMM_DEFAULT_P
  1546. #undef SBGEMM_DEFAULT_R
  1547. #undef SBGEMM_DEFAULT_Q
  1548. #define SBGEMM_DEFAULT_UNROLL_N 4
  1549. #define SBGEMM_DEFAULT_UNROLL_M 16
  1550. #define SBGEMM_DEFAULT_P 384
  1551. #define SBGEMM_DEFAULT_Q 768
  1552. #define SBGEMM_DEFAULT_R sbgemm_r
  1553. #ifdef ARCH_X86
  1554. #define SGEMM_DEFAULT_UNROLL_M 4
  1555. #define DGEMM_DEFAULT_UNROLL_M 2
  1556. #define QGEMM_DEFAULT_UNROLL_M 2
  1557. #define CGEMM_DEFAULT_UNROLL_M 2
  1558. #define ZGEMM_DEFAULT_UNROLL_M 1
  1559. #define XGEMM_DEFAULT_UNROLL_M 1
  1560. #define SGEMM_DEFAULT_UNROLL_N 4
  1561. #define DGEMM_DEFAULT_UNROLL_N 4
  1562. #define QGEMM_DEFAULT_UNROLL_N 2
  1563. #define CGEMM_DEFAULT_UNROLL_N 2
  1564. #define ZGEMM_DEFAULT_UNROLL_N 2
  1565. #define XGEMM_DEFAULT_UNROLL_N 1
  1566. #else
  1567. #define SGEMM_DEFAULT_UNROLL_M 16
  1568. #define DGEMM_DEFAULT_UNROLL_M 16
  1569. #define QGEMM_DEFAULT_UNROLL_M 2
  1570. #define CGEMM_DEFAULT_UNROLL_M 8
  1571. #define ZGEMM_DEFAULT_UNROLL_M 4
  1572. #define XGEMM_DEFAULT_UNROLL_M 1
  1573. #define SGEMM_DEFAULT_UNROLL_N 4
  1574. #define DGEMM_DEFAULT_UNROLL_N 2
  1575. #define QGEMM_DEFAULT_UNROLL_N 2
  1576. #define CGEMM_DEFAULT_UNROLL_N 2
  1577. #define ZGEMM_DEFAULT_UNROLL_N 2
  1578. #define XGEMM_DEFAULT_UNROLL_N 1
  1579. #define SGEMM_DEFAULT_UNROLL_MN 32
  1580. #define DGEMM_DEFAULT_UNROLL_MN 32
  1581. #endif
  1582. #ifdef ARCH_X86
  1583. #define SGEMM_DEFAULT_P 512
  1584. #define SGEMM_DEFAULT_R sgemm_r
  1585. #define DGEMM_DEFAULT_P 512
  1586. #define DGEMM_DEFAULT_R dgemm_r
  1587. #define QGEMM_DEFAULT_P 504
  1588. #define QGEMM_DEFAULT_R qgemm_r
  1589. #define CGEMM_DEFAULT_P 128
  1590. #define CGEMM_DEFAULT_R 1024
  1591. #define ZGEMM_DEFAULT_P 512
  1592. #define ZGEMM_DEFAULT_R zgemm_r
  1593. #define XGEMM_DEFAULT_P 252
  1594. #define XGEMM_DEFAULT_R xgemm_r
  1595. #define SGEMM_DEFAULT_Q 256
  1596. #define DGEMM_DEFAULT_Q 256
  1597. #define QGEMM_DEFAULT_Q 128
  1598. #define CGEMM_DEFAULT_Q 256
  1599. #define ZGEMM_DEFAULT_Q 192
  1600. #define XGEMM_DEFAULT_Q 128
  1601. #else
  1602. #define SGEMM_DEFAULT_P 640
  1603. #define DGEMM_DEFAULT_P 192
  1604. #define CGEMM_DEFAULT_P 384
  1605. #define ZGEMM_DEFAULT_P 256
  1606. #define SGEMM_DEFAULT_Q 320
  1607. #define DGEMM_DEFAULT_Q 384
  1608. #define CGEMM_DEFAULT_Q 192
  1609. #define ZGEMM_DEFAULT_Q 128
  1610. #define SGEMM_DEFAULT_R sgemm_r
  1611. #define DGEMM_DEFAULT_R 8640
  1612. #define CGEMM_DEFAULT_R cgemm_r
  1613. #define ZGEMM_DEFAULT_R zgemm_r
  1614. #define QGEMM_DEFAULT_Q 128
  1615. #define QGEMM_DEFAULT_P 504
  1616. #define QGEMM_DEFAULT_R qgemm_r
  1617. #define XGEMM_DEFAULT_P 252
  1618. #define XGEMM_DEFAULT_R xgemm_r
  1619. #define XGEMM_DEFAULT_Q 128
  1620. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1621. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1622. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1623. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1624. #define CGEMM3M_DEFAULT_P 320
  1625. #define ZGEMM3M_DEFAULT_P 256
  1626. #define XGEMM3M_DEFAULT_P 112
  1627. #define CGEMM3M_DEFAULT_Q 320
  1628. #define ZGEMM3M_DEFAULT_Q 256
  1629. #define XGEMM3M_DEFAULT_Q 224
  1630. #define CGEMM3M_DEFAULT_R 12288
  1631. #define ZGEMM3M_DEFAULT_R 12288
  1632. #define XGEMM3M_DEFAULT_R 12288
  1633. #endif
  1634. #endif
  1635. #ifdef ATOM
  1636. #define SNUMOPT 2
  1637. #define DNUMOPT 1
  1638. #define GEMM_DEFAULT_OFFSET_A 64
  1639. #define GEMM_DEFAULT_OFFSET_B 0
  1640. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  1641. #define SYMV_P 8
  1642. #ifdef ARCH_X86
  1643. #define SGEMM_DEFAULT_UNROLL_M 4
  1644. #define DGEMM_DEFAULT_UNROLL_M 2
  1645. #define QGEMM_DEFAULT_UNROLL_M 2
  1646. #define CGEMM_DEFAULT_UNROLL_M 2
  1647. #define ZGEMM_DEFAULT_UNROLL_M 1
  1648. #define XGEMM_DEFAULT_UNROLL_M 1
  1649. #else
  1650. #define SGEMM_DEFAULT_UNROLL_M 8
  1651. #define DGEMM_DEFAULT_UNROLL_M 4
  1652. #define QGEMM_DEFAULT_UNROLL_M 2
  1653. #define CGEMM_DEFAULT_UNROLL_M 4
  1654. #define ZGEMM_DEFAULT_UNROLL_M 2
  1655. #define XGEMM_DEFAULT_UNROLL_M 1
  1656. #endif
  1657. #define SGEMM_DEFAULT_UNROLL_N 4
  1658. #define DGEMM_DEFAULT_UNROLL_N 2
  1659. #define QGEMM_DEFAULT_UNROLL_N 2
  1660. #define CGEMM_DEFAULT_UNROLL_N 2
  1661. #define ZGEMM_DEFAULT_UNROLL_N 1
  1662. #define XGEMM_DEFAULT_UNROLL_N 1
  1663. #define SGEMM_DEFAULT_P sgemm_p
  1664. #define SGEMM_DEFAULT_R sgemm_r
  1665. #define DGEMM_DEFAULT_P dgemm_p
  1666. #define DGEMM_DEFAULT_R dgemm_r
  1667. #define QGEMM_DEFAULT_P qgemm_p
  1668. #define QGEMM_DEFAULT_R qgemm_r
  1669. #define CGEMM_DEFAULT_P cgemm_p
  1670. #define CGEMM_DEFAULT_R cgemm_r
  1671. #define ZGEMM_DEFAULT_P zgemm_p
  1672. #define ZGEMM_DEFAULT_R zgemm_r
  1673. #define XGEMM_DEFAULT_P xgemm_p
  1674. #define XGEMM_DEFAULT_R xgemm_r
  1675. #define SGEMM_DEFAULT_Q 256
  1676. #define DGEMM_DEFAULT_Q 256
  1677. #define QGEMM_DEFAULT_Q 256
  1678. #define CGEMM_DEFAULT_Q 256
  1679. #define ZGEMM_DEFAULT_Q 256
  1680. #define XGEMM_DEFAULT_Q 256
  1681. #endif
  1682. #ifdef ITANIUM2
  1683. #define SNUMOPT 4
  1684. #define DNUMOPT 4
  1685. #define GEMM_DEFAULT_OFFSET_A 0
  1686. #define GEMM_DEFAULT_OFFSET_B 128
  1687. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  1688. #define SGEMM_DEFAULT_UNROLL_M 8
  1689. #define SGEMM_DEFAULT_UNROLL_N 8
  1690. #define DGEMM_DEFAULT_UNROLL_M 8
  1691. #define DGEMM_DEFAULT_UNROLL_N 8
  1692. #define QGEMM_DEFAULT_UNROLL_M 8
  1693. #define QGEMM_DEFAULT_UNROLL_N 8
  1694. #define CGEMM_DEFAULT_UNROLL_M 4
  1695. #define CGEMM_DEFAULT_UNROLL_N 4
  1696. #define ZGEMM_DEFAULT_UNROLL_M 4
  1697. #define ZGEMM_DEFAULT_UNROLL_N 4
  1698. #define XGEMM_DEFAULT_UNROLL_M 4
  1699. #define XGEMM_DEFAULT_UNROLL_N 4
  1700. #define SGEMM_DEFAULT_P sgemm_p
  1701. #define DGEMM_DEFAULT_P dgemm_p
  1702. #define QGEMM_DEFAULT_P qgemm_p
  1703. #define CGEMM_DEFAULT_P cgemm_p
  1704. #define ZGEMM_DEFAULT_P zgemm_p
  1705. #define XGEMM_DEFAULT_P xgemm_p
  1706. #define SGEMM_DEFAULT_Q 1024
  1707. #define DGEMM_DEFAULT_Q 1024
  1708. #define QGEMM_DEFAULT_Q 1024
  1709. #define CGEMM_DEFAULT_Q 1024
  1710. #define ZGEMM_DEFAULT_Q 1024
  1711. #define XGEMM_DEFAULT_Q 1024
  1712. #define SGEMM_DEFAULT_R sgemm_r
  1713. #define DGEMM_DEFAULT_R dgemm_r
  1714. #define QGEMM_DEFAULT_R qgemm_r
  1715. #define CGEMM_DEFAULT_R cgemm_r
  1716. #define ZGEMM_DEFAULT_R zgemm_r
  1717. #define XGEMM_DEFAULT_R xgemm_r
  1718. #define SYMV_P 16
  1719. #define GETRF_FACTOR 0.65
  1720. #endif
  1721. #if defined(EV4) || defined(EV5) || defined(EV6)
  1722. #ifdef EV4
  1723. #define SNUMOPT 1
  1724. #define DNUMOPT 1
  1725. #else
  1726. #define SNUMOPT 2
  1727. #define DNUMOPT 2
  1728. #endif
  1729. #define GEMM_DEFAULT_OFFSET_A 512
  1730. #define GEMM_DEFAULT_OFFSET_B 512
  1731. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  1732. #define SGEMM_DEFAULT_UNROLL_M 4
  1733. #define SGEMM_DEFAULT_UNROLL_N 4
  1734. #define DGEMM_DEFAULT_UNROLL_M 4
  1735. #define DGEMM_DEFAULT_UNROLL_N 4
  1736. #define CGEMM_DEFAULT_UNROLL_M 2
  1737. #define CGEMM_DEFAULT_UNROLL_N 2
  1738. #define ZGEMM_DEFAULT_UNROLL_M 2
  1739. #define ZGEMM_DEFAULT_UNROLL_N 2
  1740. #define SYMV_P 8
  1741. #ifdef EV4
  1742. #define SGEMM_DEFAULT_P 32
  1743. #define SGEMM_DEFAULT_Q 112
  1744. #define SGEMM_DEFAULT_R 256
  1745. #define DGEMM_DEFAULT_P 32
  1746. #define DGEMM_DEFAULT_Q 56
  1747. #define DGEMM_DEFAULT_R 256
  1748. #define CGEMM_DEFAULT_P 32
  1749. #define CGEMM_DEFAULT_Q 64
  1750. #define CGEMM_DEFAULT_R 240
  1751. #define ZGEMM_DEFAULT_P 32
  1752. #define ZGEMM_DEFAULT_Q 32
  1753. #define ZGEMM_DEFAULT_R 240
  1754. #endif
  1755. #ifdef EV5
  1756. #define SGEMM_DEFAULT_P 64
  1757. #define SGEMM_DEFAULT_Q 256
  1758. #define DGEMM_DEFAULT_P 64
  1759. #define DGEMM_DEFAULT_Q 128
  1760. #define CGEMM_DEFAULT_P 64
  1761. #define CGEMM_DEFAULT_Q 128
  1762. #define ZGEMM_DEFAULT_P 64
  1763. #define ZGEMM_DEFAULT_Q 64
  1764. #endif
  1765. #ifdef EV6
  1766. #define SGEMM_DEFAULT_P 256
  1767. #define SGEMM_DEFAULT_Q 512
  1768. #define DGEMM_DEFAULT_P 256
  1769. #define DGEMM_DEFAULT_Q 256
  1770. #define CGEMM_DEFAULT_P 256
  1771. #define CGEMM_DEFAULT_Q 256
  1772. #define ZGEMM_DEFAULT_P 128
  1773. #define ZGEMM_DEFAULT_Q 256
  1774. #endif
  1775. #endif
  1776. #ifdef CELL
  1777. #define SNUMOPT 2
  1778. #define DNUMOPT 2
  1779. #define GEMM_DEFAULT_OFFSET_A 0
  1780. #define GEMM_DEFAULT_OFFSET_B 8192
  1781. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  1782. #define SGEMM_DEFAULT_UNROLL_M 16
  1783. #define SGEMM_DEFAULT_UNROLL_N 4
  1784. #define DGEMM_DEFAULT_UNROLL_M 4
  1785. #define DGEMM_DEFAULT_UNROLL_N 4
  1786. #define CGEMM_DEFAULT_UNROLL_M 8
  1787. #define CGEMM_DEFAULT_UNROLL_N 2
  1788. #define ZGEMM_DEFAULT_UNROLL_M 2
  1789. #define ZGEMM_DEFAULT_UNROLL_N 2
  1790. #define SGEMM_DEFAULT_P 128
  1791. #define DGEMM_DEFAULT_P 128
  1792. #define CGEMM_DEFAULT_P 128
  1793. #define ZGEMM_DEFAULT_P 128
  1794. #define SGEMM_DEFAULT_Q 512
  1795. #define DGEMM_DEFAULT_Q 256
  1796. #define CGEMM_DEFAULT_Q 256
  1797. #define ZGEMM_DEFAULT_Q 128
  1798. #define SYMV_P 4
  1799. #endif
  1800. #ifdef PPCG4
  1801. #define GEMM_DEFAULT_OFFSET_A 0
  1802. #define GEMM_DEFAULT_OFFSET_B 1024
  1803. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1804. #define SGEMM_DEFAULT_UNROLL_M 16
  1805. #define SGEMM_DEFAULT_UNROLL_N 4
  1806. #define DGEMM_DEFAULT_UNROLL_M 4
  1807. #define DGEMM_DEFAULT_UNROLL_N 4
  1808. #define CGEMM_DEFAULT_UNROLL_M 2
  1809. #define CGEMM_DEFAULT_UNROLL_N 2
  1810. #define ZGEMM_DEFAULT_UNROLL_M 2
  1811. #define ZGEMM_DEFAULT_UNROLL_N 2
  1812. #define SGEMM_DEFAULT_P 256
  1813. #define DGEMM_DEFAULT_P 128
  1814. #define CGEMM_DEFAULT_P 128
  1815. #define ZGEMM_DEFAULT_P 64
  1816. #define SGEMM_DEFAULT_Q 256
  1817. #define DGEMM_DEFAULT_Q 256
  1818. #define CGEMM_DEFAULT_Q 256
  1819. #define ZGEMM_DEFAULT_Q 256
  1820. #define SYMV_P 4
  1821. #endif
  1822. #ifdef PPC970
  1823. #define SNUMOPT 4
  1824. #define DNUMOPT 4
  1825. #define GEMM_DEFAULT_OFFSET_A 2688
  1826. #define GEMM_DEFAULT_OFFSET_B 3072
  1827. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1828. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1829. #define SGEMM_DEFAULT_UNROLL_M 4
  1830. #else
  1831. #define SGEMM_DEFAULT_UNROLL_M 16
  1832. #endif
  1833. #define SGEMM_DEFAULT_UNROLL_N 4
  1834. #define DGEMM_DEFAULT_UNROLL_M 4
  1835. #define DGEMM_DEFAULT_UNROLL_N 4
  1836. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1837. #define CGEMM_DEFAULT_UNROLL_M 2
  1838. #else
  1839. #define CGEMM_DEFAULT_UNROLL_M 8
  1840. #endif
  1841. #define CGEMM_DEFAULT_UNROLL_N 2
  1842. #define ZGEMM_DEFAULT_UNROLL_M 2
  1843. #define ZGEMM_DEFAULT_UNROLL_N 2
  1844. #if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD)
  1845. #if L2_SIZE == 1024976
  1846. #define SGEMM_DEFAULT_P 320
  1847. #define DGEMM_DEFAULT_P 256
  1848. #define CGEMM_DEFAULT_P 256
  1849. #define ZGEMM_DEFAULT_P 256
  1850. #else
  1851. #define SGEMM_DEFAULT_P 176
  1852. #define DGEMM_DEFAULT_P 176
  1853. #define CGEMM_DEFAULT_P 176
  1854. #define ZGEMM_DEFAULT_P 176
  1855. #endif
  1856. #endif
  1857. #define SGEMM_DEFAULT_Q 512
  1858. #define DGEMM_DEFAULT_Q 256
  1859. #define CGEMM_DEFAULT_Q 256
  1860. #define ZGEMM_DEFAULT_Q 128
  1861. #define SYMV_P 4
  1862. #endif
  1863. #ifdef PPC440
  1864. #define SNUMOPT 2
  1865. #define DNUMOPT 2
  1866. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1867. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1868. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1869. #define SGEMM_DEFAULT_UNROLL_M 4
  1870. #define SGEMM_DEFAULT_UNROLL_N 4
  1871. #define DGEMM_DEFAULT_UNROLL_M 4
  1872. #define DGEMM_DEFAULT_UNROLL_N 4
  1873. #define CGEMM_DEFAULT_UNROLL_M 2
  1874. #define CGEMM_DEFAULT_UNROLL_N 2
  1875. #define ZGEMM_DEFAULT_UNROLL_M 2
  1876. #define ZGEMM_DEFAULT_UNROLL_N 2
  1877. #define SGEMM_DEFAULT_P 512
  1878. #define DGEMM_DEFAULT_P 512
  1879. #define CGEMM_DEFAULT_P 512
  1880. #define ZGEMM_DEFAULT_P 512
  1881. #define SGEMM_DEFAULT_Q 1024
  1882. #define DGEMM_DEFAULT_Q 512
  1883. #define CGEMM_DEFAULT_Q 512
  1884. #define ZGEMM_DEFAULT_Q 256
  1885. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  1886. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  1887. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  1888. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  1889. #define SYMV_P 4
  1890. #endif
  1891. #ifdef PPC440FP2
  1892. #define SNUMOPT 4
  1893. #define DNUMOPT 4
  1894. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1895. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1896. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1897. #define SGEMM_DEFAULT_UNROLL_M 8
  1898. #define SGEMM_DEFAULT_UNROLL_N 4
  1899. #define DGEMM_DEFAULT_UNROLL_M 8
  1900. #define DGEMM_DEFAULT_UNROLL_N 4
  1901. #define CGEMM_DEFAULT_UNROLL_M 4
  1902. #define CGEMM_DEFAULT_UNROLL_N 2
  1903. #define ZGEMM_DEFAULT_UNROLL_M 4
  1904. #define ZGEMM_DEFAULT_UNROLL_N 2
  1905. #define SGEMM_DEFAULT_P 128
  1906. #define DGEMM_DEFAULT_P 128
  1907. #define CGEMM_DEFAULT_P 128
  1908. #define ZGEMM_DEFAULT_P 128
  1909. #if 1
  1910. #define SGEMM_DEFAULT_Q 4096
  1911. #define DGEMM_DEFAULT_Q 3072
  1912. #define CGEMM_DEFAULT_Q 2048
  1913. #define ZGEMM_DEFAULT_Q 1024
  1914. #else
  1915. #define SGEMM_DEFAULT_Q 512
  1916. #define DGEMM_DEFAULT_Q 256
  1917. #define CGEMM_DEFAULT_Q 256
  1918. #define ZGEMM_DEFAULT_Q 128
  1919. #endif
  1920. #define SYMV_P 4
  1921. #endif
  1922. #if defined(POWER3) || defined(POWER4) || defined(POWER5)
  1923. #define GEMM_DEFAULT_OFFSET_A 0
  1924. #define GEMM_DEFAULT_OFFSET_B 2048
  1925. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1926. #define SGEMM_DEFAULT_UNROLL_M 4
  1927. #define SGEMM_DEFAULT_UNROLL_N 4
  1928. #define DGEMM_DEFAULT_UNROLL_M 4
  1929. #define DGEMM_DEFAULT_UNROLL_N 4
  1930. #define CGEMM_DEFAULT_UNROLL_M 2
  1931. #define CGEMM_DEFAULT_UNROLL_N 2
  1932. #define ZGEMM_DEFAULT_UNROLL_M 2
  1933. #define ZGEMM_DEFAULT_UNROLL_N 2
  1934. #ifdef POWER3
  1935. #define SNUMOPT 4
  1936. #define DNUMOPT 4
  1937. #define SGEMM_DEFAULT_P 256
  1938. #define SGEMM_DEFAULT_Q 432
  1939. #define SGEMM_DEFAULT_R 1012
  1940. #define DGEMM_DEFAULT_P 256
  1941. #define DGEMM_DEFAULT_Q 216
  1942. #define DGEMM_DEFAULT_R 1012
  1943. #define CGEMM_DEFAULT_P 256
  1944. #define CGEMM_DEFAULT_Q 104
  1945. #define CGEMM_DEFAULT_R 1012
  1946. #define ZGEMM_DEFAULT_P 256
  1947. #define ZGEMM_DEFAULT_Q 104
  1948. #define ZGEMM_DEFAULT_R 1012
  1949. #endif
  1950. #if defined(POWER4)
  1951. #ifdef ALLOC_HUGETLB
  1952. #define SGEMM_DEFAULT_P 184
  1953. #define DGEMM_DEFAULT_P 184
  1954. #define CGEMM_DEFAULT_P 184
  1955. #define ZGEMM_DEFAULT_P 184
  1956. #else
  1957. #define SGEMM_DEFAULT_P 144
  1958. #define DGEMM_DEFAULT_P 144
  1959. #define CGEMM_DEFAULT_P 144
  1960. #define ZGEMM_DEFAULT_P 144
  1961. #endif
  1962. #define SGEMM_DEFAULT_Q 256
  1963. #define CGEMM_DEFAULT_Q 256
  1964. #define DGEMM_DEFAULT_Q 256
  1965. #define ZGEMM_DEFAULT_Q 256
  1966. #endif
  1967. #if defined(POWER5)
  1968. #ifdef ALLOC_HUGETLB
  1969. #define SGEMM_DEFAULT_P 512
  1970. #define DGEMM_DEFAULT_P 256
  1971. #define CGEMM_DEFAULT_P 256
  1972. #define ZGEMM_DEFAULT_P 128
  1973. #else
  1974. #define SGEMM_DEFAULT_P 320
  1975. #define DGEMM_DEFAULT_P 160
  1976. #define CGEMM_DEFAULT_P 160
  1977. #define ZGEMM_DEFAULT_P 80
  1978. #endif
  1979. #define SGEMM_DEFAULT_Q 256
  1980. #define CGEMM_DEFAULT_Q 256
  1981. #define DGEMM_DEFAULT_Q 256
  1982. #define ZGEMM_DEFAULT_Q 256
  1983. #endif
  1984. #define SYMV_P 8
  1985. #endif
  1986. #if defined(POWER6)
  1987. #define SNUMOPT 4
  1988. #define DNUMOPT 4
  1989. #define GEMM_DEFAULT_OFFSET_A 384
  1990. #define GEMM_DEFAULT_OFFSET_B 1024
  1991. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1992. #define SGEMM_DEFAULT_UNROLL_M 4
  1993. #define SGEMM_DEFAULT_UNROLL_N 4
  1994. #define DGEMM_DEFAULT_UNROLL_M 4
  1995. #define DGEMM_DEFAULT_UNROLL_N 4
  1996. #define CGEMM_DEFAULT_UNROLL_M 2
  1997. #define CGEMM_DEFAULT_UNROLL_N 4
  1998. #define ZGEMM_DEFAULT_UNROLL_M 2
  1999. #define ZGEMM_DEFAULT_UNROLL_N 4
  2000. #define SGEMM_DEFAULT_P 992
  2001. #define DGEMM_DEFAULT_P 480
  2002. #define CGEMM_DEFAULT_P 488
  2003. #define ZGEMM_DEFAULT_P 248
  2004. #define SGEMM_DEFAULT_Q 504
  2005. #define DGEMM_DEFAULT_Q 504
  2006. #define CGEMM_DEFAULT_Q 400
  2007. #define ZGEMM_DEFAULT_Q 400
  2008. #define SYMV_P 8
  2009. #endif
  2010. #if defined(POWER8)
  2011. #define SNUMOPT 16
  2012. #define DNUMOPT 8
  2013. #define GEMM_DEFAULT_OFFSET_A 0
  2014. #define GEMM_DEFAULT_OFFSET_B 65536
  2015. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2016. #if defined(__32BIT__)
  2017. #warning using BINARY32==POWER6
  2018. #define SGEMM_DEFAULT_UNROLL_M 4
  2019. #define SGEMM_DEFAULT_UNROLL_N 4
  2020. #define DGEMM_DEFAULT_UNROLL_M 4
  2021. #define DGEMM_DEFAULT_UNROLL_N 4
  2022. #define CGEMM_DEFAULT_UNROLL_M 2
  2023. #define CGEMM_DEFAULT_UNROLL_N 4
  2024. #define ZGEMM_DEFAULT_UNROLL_M 2
  2025. #define ZGEMM_DEFAULT_UNROLL_N 4
  2026. #else
  2027. #define SGEMM_DEFAULT_UNROLL_M 16
  2028. #define SGEMM_DEFAULT_UNROLL_N 8
  2029. #define DGEMM_DEFAULT_UNROLL_M 16
  2030. #define DGEMM_DEFAULT_UNROLL_N 4
  2031. #define CGEMM_DEFAULT_UNROLL_M 8
  2032. #define CGEMM_DEFAULT_UNROLL_N 4
  2033. #define ZGEMM_DEFAULT_UNROLL_M 8
  2034. #define ZGEMM_DEFAULT_UNROLL_N 2
  2035. #endif
  2036. #define SGEMM_DEFAULT_P 1280UL
  2037. #define DGEMM_DEFAULT_P 640UL
  2038. #define CGEMM_DEFAULT_P 640UL
  2039. #define ZGEMM_DEFAULT_P 320UL
  2040. #define SGEMM_DEFAULT_Q 640UL
  2041. #define DGEMM_DEFAULT_Q 720UL
  2042. #define CGEMM_DEFAULT_Q 640UL
  2043. #define ZGEMM_DEFAULT_Q 640UL
  2044. #if 0
  2045. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  2046. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  2047. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  2048. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  2049. #endif
  2050. #define SGEMM_DEFAULT_R 4096
  2051. #define DGEMM_DEFAULT_R 4096
  2052. #define CGEMM_DEFAULT_R 4096
  2053. #define ZGEMM_DEFAULT_R 4096
  2054. #define SYMV_P 8
  2055. #endif
  2056. #if defined(POWER9)
  2057. #define SNUMOPT 16
  2058. #define DNUMOPT 8
  2059. #define GEMM_DEFAULT_OFFSET_A 0
  2060. #define GEMM_DEFAULT_OFFSET_B 65536
  2061. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2062. #define SWITCH_RATIO 16
  2063. #define GEMM_PREFERED_SIZE 16
  2064. #define SGEMM_DEFAULT_UNROLL_M 16
  2065. #define SGEMM_DEFAULT_UNROLL_N 8
  2066. #define DGEMM_DEFAULT_UNROLL_M 16
  2067. #define DGEMM_DEFAULT_UNROLL_N 4
  2068. #define CGEMM_DEFAULT_UNROLL_M 8
  2069. #define CGEMM_DEFAULT_UNROLL_N 4
  2070. #define ZGEMM_DEFAULT_UNROLL_M 8
  2071. #define ZGEMM_DEFAULT_UNROLL_N 2
  2072. #define SGEMM_DEFAULT_P 832
  2073. #define DGEMM_DEFAULT_P 128
  2074. #define CGEMM_DEFAULT_P 512
  2075. #define ZGEMM_DEFAULT_P 256
  2076. #define SGEMM_DEFAULT_Q 1026
  2077. #define DGEMM_DEFAULT_Q 384
  2078. #define CGEMM_DEFAULT_Q 1026
  2079. #define ZGEMM_DEFAULT_Q 1026
  2080. #define SGEMM_DEFAULT_R 4096
  2081. #define DGEMM_DEFAULT_R 4096
  2082. #define CGEMM_DEFAULT_R 4096
  2083. #define ZGEMM_DEFAULT_R 4096
  2084. #define SYMV_P 8
  2085. #endif
  2086. #if defined(POWER10)
  2087. #define SNUMOPT 16
  2088. #define DNUMOPT 8
  2089. #define GEMM_DEFAULT_OFFSET_A 0
  2090. #define GEMM_DEFAULT_OFFSET_B 65536
  2091. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2092. #define SWITCH_RATIO 16
  2093. #define GEMM_PREFERED_SIZE 16
  2094. #define SGEMM_DEFAULT_UNROLL_M 16
  2095. #define SGEMM_DEFAULT_UNROLL_N 8
  2096. #define DGEMM_DEFAULT_UNROLL_M 8
  2097. #define DGEMM_DEFAULT_UNROLL_N 8
  2098. #define CGEMM_DEFAULT_UNROLL_M 8
  2099. #define CGEMM_DEFAULT_UNROLL_N 4
  2100. #define ZGEMM_DEFAULT_UNROLL_M 8
  2101. #define ZGEMM_DEFAULT_UNROLL_N 2
  2102. #define SGEMM_DEFAULT_P 512
  2103. #define DGEMM_DEFAULT_P 384
  2104. #define CGEMM_DEFAULT_P 512
  2105. #define ZGEMM_DEFAULT_P 256
  2106. #define SGEMM_DEFAULT_Q 512
  2107. #define DGEMM_DEFAULT_Q 512
  2108. #define CGEMM_DEFAULT_Q 384
  2109. #define ZGEMM_DEFAULT_Q 384
  2110. #define SGEMM_DEFAULT_R 4096
  2111. #define DGEMM_DEFAULT_R 4096
  2112. #define CGEMM_DEFAULT_R 4096
  2113. #define ZGEMM_DEFAULT_R 4096
  2114. #define SYMV_P 8
  2115. #undef SBGEMM_DEFAULT_UNROLL_N
  2116. #undef SBGEMM_DEFAULT_UNROLL_M
  2117. #undef SBGEMM_DEFAULT_P
  2118. #undef SBGEMM_DEFAULT_R
  2119. #undef SBGEMM_DEFAULT_Q
  2120. #define SBGEMM_DEFAULT_UNROLL_M 16
  2121. #define SBGEMM_DEFAULT_UNROLL_N 8
  2122. #define SBGEMM_DEFAULT_P 832
  2123. #define SBGEMM_DEFAULT_Q 1026
  2124. #define SBGEMM_DEFAULT_R 4096
  2125. #endif
  2126. #if defined(SPARC) && defined(V7)
  2127. #define SNUMOPT 4
  2128. #define DNUMOPT 4
  2129. #define GEMM_DEFAULT_OFFSET_A 0
  2130. #define GEMM_DEFAULT_OFFSET_B 2048
  2131. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2132. #define SGEMM_DEFAULT_UNROLL_M 2
  2133. #define SGEMM_DEFAULT_UNROLL_N 8
  2134. #define DGEMM_DEFAULT_UNROLL_M 2
  2135. #define DGEMM_DEFAULT_UNROLL_N 8
  2136. #define CGEMM_DEFAULT_UNROLL_M 1
  2137. #define CGEMM_DEFAULT_UNROLL_N 4
  2138. #define ZGEMM_DEFAULT_UNROLL_M 1
  2139. #define ZGEMM_DEFAULT_UNROLL_N 4
  2140. #define SGEMM_DEFAULT_P 256
  2141. #define DGEMM_DEFAULT_P 256
  2142. #define CGEMM_DEFAULT_P 256
  2143. #define ZGEMM_DEFAULT_P 256
  2144. #define SGEMM_DEFAULT_Q 512
  2145. #define DGEMM_DEFAULT_Q 256
  2146. #define CGEMM_DEFAULT_Q 256
  2147. #define ZGEMM_DEFAULT_Q 128
  2148. #define SYMV_P 8
  2149. #define GEMM_THREAD gemm_thread_mn
  2150. #endif
  2151. #if (defined(SPARC) && defined(V9)) || defined(__sparc_v9__)
  2152. #define SNUMOPT 2
  2153. #define DNUMOPT 2
  2154. #define GEMM_DEFAULT_OFFSET_A 0
  2155. #define GEMM_DEFAULT_OFFSET_B 2048
  2156. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2157. #define SGEMM_DEFAULT_UNROLL_M 4
  2158. #define SGEMM_DEFAULT_UNROLL_N 4
  2159. #define DGEMM_DEFAULT_UNROLL_M 4
  2160. #define DGEMM_DEFAULT_UNROLL_N 4
  2161. #define CGEMM_DEFAULT_UNROLL_M 2
  2162. #define CGEMM_DEFAULT_UNROLL_N 2
  2163. #define ZGEMM_DEFAULT_UNROLL_M 2
  2164. #define ZGEMM_DEFAULT_UNROLL_N 2
  2165. #define SGEMM_DEFAULT_P 512
  2166. #define DGEMM_DEFAULT_P 512
  2167. #define CGEMM_DEFAULT_P 512
  2168. #define ZGEMM_DEFAULT_P 512
  2169. #define SGEMM_DEFAULT_Q 1024
  2170. #define DGEMM_DEFAULT_Q 512
  2171. #define CGEMM_DEFAULT_Q 512
  2172. #define ZGEMM_DEFAULT_Q 256
  2173. #define SYMV_P 8
  2174. #endif
  2175. #ifdef SICORTEX
  2176. #define SNUMOPT 2
  2177. #define DNUMOPT 2
  2178. #define GEMM_DEFAULT_OFFSET_A 0
  2179. #define GEMM_DEFAULT_OFFSET_B 0
  2180. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2181. #define SGEMM_DEFAULT_UNROLL_M 2
  2182. #define SGEMM_DEFAULT_UNROLL_N 8
  2183. #define DGEMM_DEFAULT_UNROLL_M 2
  2184. #define DGEMM_DEFAULT_UNROLL_N 8
  2185. #define CGEMM_DEFAULT_UNROLL_M 1
  2186. #define CGEMM_DEFAULT_UNROLL_N 4
  2187. #define ZGEMM_DEFAULT_UNROLL_M 1
  2188. #define ZGEMM_DEFAULT_UNROLL_N 4
  2189. #define SGEMM_DEFAULT_P 108
  2190. #define DGEMM_DEFAULT_P 112
  2191. #define CGEMM_DEFAULT_P 108
  2192. #define ZGEMM_DEFAULT_P 112
  2193. #define SGEMM_DEFAULT_Q 288
  2194. #define DGEMM_DEFAULT_Q 144
  2195. #define CGEMM_DEFAULT_Q 144
  2196. #define ZGEMM_DEFAULT_Q 72
  2197. #define SGEMM_DEFAULT_R 2000
  2198. #define DGEMM_DEFAULT_R 2000
  2199. #define CGEMM_DEFAULT_R 2000
  2200. #define ZGEMM_DEFAULT_R 2000
  2201. #define SYMV_P 16
  2202. #endif
  2203. #if defined(LOONGSON3R4)
  2204. #define SNUMOPT 2
  2205. #define DNUMOPT 2
  2206. #define GEMM_DEFAULT_OFFSET_A 0
  2207. #define GEMM_DEFAULT_OFFSET_B 0
  2208. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2209. #ifdef HAVE_MSA
  2210. #define SGEMM_DEFAULT_UNROLL_M 8
  2211. #define SGEMM_DEFAULT_UNROLL_N 8
  2212. #define DGEMM_DEFAULT_UNROLL_M 8
  2213. #define DGEMM_DEFAULT_UNROLL_N 4
  2214. #define CGEMM_DEFAULT_UNROLL_M 8
  2215. #define CGEMM_DEFAULT_UNROLL_N 4
  2216. #define ZGEMM_DEFAULT_UNROLL_M 4
  2217. #define ZGEMM_DEFAULT_UNROLL_N 4
  2218. #else
  2219. #define SGEMM_DEFAULT_UNROLL_M 8
  2220. #define SGEMM_DEFAULT_UNROLL_N 4
  2221. #define DGEMM_DEFAULT_UNROLL_M 4
  2222. #define DGEMM_DEFAULT_UNROLL_N 4
  2223. #define CGEMM_DEFAULT_UNROLL_M 4
  2224. #define CGEMM_DEFAULT_UNROLL_N 2
  2225. #define ZGEMM_DEFAULT_UNROLL_M 2
  2226. #define ZGEMM_DEFAULT_UNROLL_N 2
  2227. #endif
  2228. #define SGEMM_DEFAULT_P 64
  2229. #define DGEMM_DEFAULT_P 44
  2230. #define CGEMM_DEFAULT_P 64
  2231. #define ZGEMM_DEFAULT_P 32
  2232. #define SGEMM_DEFAULT_Q 192
  2233. #define DGEMM_DEFAULT_Q 92
  2234. #define CGEMM_DEFAULT_Q 128
  2235. #define ZGEMM_DEFAULT_Q 80
  2236. #define SGEMM_DEFAULT_R 640
  2237. #define DGEMM_DEFAULT_R dgemm_r
  2238. #define CGEMM_DEFAULT_R 640
  2239. #define ZGEMM_DEFAULT_R 640
  2240. #define GEMM_OFFSET_A1 0x10000
  2241. #define GEMM_OFFSET_B1 0x100000
  2242. #define SYMV_P 16
  2243. #endif
  2244. #if defined(LOONGSON3R3)
  2245. ////Copy from SICORTEX
  2246. #define SNUMOPT 2
  2247. #define DNUMOPT 2
  2248. #define GEMM_DEFAULT_OFFSET_A 0
  2249. #define GEMM_DEFAULT_OFFSET_B 0
  2250. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2251. #define SGEMM_DEFAULT_UNROLL_M 8
  2252. #define SGEMM_DEFAULT_UNROLL_N 4
  2253. #define DGEMM_DEFAULT_UNROLL_M 4
  2254. #define DGEMM_DEFAULT_UNROLL_N 4
  2255. #define CGEMM_DEFAULT_UNROLL_M 4
  2256. #define CGEMM_DEFAULT_UNROLL_N 2
  2257. #define ZGEMM_DEFAULT_UNROLL_M 2
  2258. #define ZGEMM_DEFAULT_UNROLL_N 2
  2259. #define SGEMM_DEFAULT_P 64
  2260. #define DGEMM_DEFAULT_P 44
  2261. #define CGEMM_DEFAULT_P 64
  2262. #define ZGEMM_DEFAULT_P 32
  2263. #define SGEMM_DEFAULT_Q 192
  2264. #define DGEMM_DEFAULT_Q 92
  2265. #define CGEMM_DEFAULT_Q 128
  2266. #define ZGEMM_DEFAULT_Q 80
  2267. #define SGEMM_DEFAULT_R 640
  2268. #define DGEMM_DEFAULT_R dgemm_r
  2269. #define CGEMM_DEFAULT_R 640
  2270. #define ZGEMM_DEFAULT_R 640
  2271. #define GEMM_OFFSET_A1 0x10000
  2272. #define GEMM_OFFSET_B1 0x100000
  2273. #define SYMV_P 16
  2274. #endif
  2275. #if defined (LOONGSON3R5)
  2276. #define SNUMOPT 2
  2277. #define DNUMOPT 2
  2278. #define GEMM_DEFAULT_OFFSET_A 0
  2279. #define GEMM_DEFAULT_OFFSET_B 0
  2280. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2281. #define SGEMM_DEFAULT_UNROLL_N 8
  2282. #define DGEMM_DEFAULT_UNROLL_N 8
  2283. #define QGEMM_DEFAULT_UNROLL_N 2
  2284. #define CGEMM_DEFAULT_UNROLL_N 4
  2285. #define ZGEMM_DEFAULT_UNROLL_N 4
  2286. #define XGEMM_DEFAULT_UNROLL_N 1
  2287. #define SGEMM_DEFAULT_UNROLL_M 2
  2288. #define DGEMM_DEFAULT_UNROLL_M 2
  2289. #define QGEMM_DEFAULT_UNROLL_M 2
  2290. #define CGEMM_DEFAULT_UNROLL_M 1
  2291. #define ZGEMM_DEFAULT_UNROLL_M 1
  2292. #define XGEMM_DEFAULT_UNROLL_M 1
  2293. #define SGEMM_DEFAULT_P sgemm_p
  2294. #define DGEMM_DEFAULT_P dgemm_p
  2295. #define QGEMM_DEFAULT_P qgemm_p
  2296. #define CGEMM_DEFAULT_P cgemm_p
  2297. #define ZGEMM_DEFAULT_P zgemm_p
  2298. #define XGEMM_DEFAULT_P xgemm_p
  2299. #define SGEMM_DEFAULT_R sgemm_r
  2300. #define DGEMM_DEFAULT_R dgemm_r
  2301. #define QGEMM_DEFAULT_R qgemm_r
  2302. #define CGEMM_DEFAULT_R cgemm_r
  2303. #define ZGEMM_DEFAULT_R zgemm_r
  2304. #define XGEMM_DEFAULT_R xgemm_r
  2305. #define SGEMM_DEFAULT_Q 128
  2306. #define DGEMM_DEFAULT_Q 128
  2307. #define QGEMM_DEFAULT_Q 128
  2308. #define CGEMM_DEFAULT_Q 128
  2309. #define ZGEMM_DEFAULT_Q 128
  2310. #define XGEMM_DEFAULT_Q 128
  2311. #define SYMV_P 16
  2312. #endif
  2313. #if defined(P5600) || defined(MIPS1004K) || defined(MIPS24K) || defined(I6400) || defined(P6600) || defined(I6500)
  2314. #define SNUMOPT 2
  2315. #define DNUMOPT 2
  2316. #define GEMM_DEFAULT_OFFSET_A 0
  2317. #define GEMM_DEFAULT_OFFSET_B 0
  2318. #define GEMM_DEFAULT_ALIGN (BLASLONG) 0x03fffUL
  2319. #if defined(HAVE_MSA) && !defined(NO_MSA)
  2320. #define SGEMM_DEFAULT_UNROLL_M 8
  2321. #define SGEMM_DEFAULT_UNROLL_N 8
  2322. #define DGEMM_DEFAULT_UNROLL_M 8
  2323. #define DGEMM_DEFAULT_UNROLL_N 4
  2324. #define CGEMM_DEFAULT_UNROLL_M 8
  2325. #define CGEMM_DEFAULT_UNROLL_N 4
  2326. #define ZGEMM_DEFAULT_UNROLL_M 4
  2327. #define ZGEMM_DEFAULT_UNROLL_N 4
  2328. #else
  2329. #define SGEMM_DEFAULT_UNROLL_M 2
  2330. #define SGEMM_DEFAULT_UNROLL_N 2
  2331. #define DGEMM_DEFAULT_UNROLL_M 2
  2332. #define DGEMM_DEFAULT_UNROLL_N 2
  2333. #define CGEMM_DEFAULT_UNROLL_M 2
  2334. #define CGEMM_DEFAULT_UNROLL_N 2
  2335. #define ZGEMM_DEFAULT_UNROLL_M 2
  2336. #define ZGEMM_DEFAULT_UNROLL_N 2
  2337. #endif
  2338. #define SGEMM_DEFAULT_P 128
  2339. #define DGEMM_DEFAULT_P 128
  2340. #define CGEMM_DEFAULT_P 96
  2341. #define ZGEMM_DEFAULT_P 64
  2342. #define SGEMM_DEFAULT_Q 240
  2343. #define DGEMM_DEFAULT_Q 120
  2344. #define CGEMM_DEFAULT_Q 120
  2345. #define ZGEMM_DEFAULT_Q 120
  2346. #define SGEMM_DEFAULT_R 12288
  2347. #define DGEMM_DEFAULT_R 8192
  2348. #define CGEMM_DEFAULT_R 4096
  2349. #define ZGEMM_DEFAULT_R 4096
  2350. #define SYMV_P 16
  2351. #endif
  2352. #ifdef RISCV64_GENERIC
  2353. #define GEMM_DEFAULT_OFFSET_A 0
  2354. #define GEMM_DEFAULT_OFFSET_B 0
  2355. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2356. #define SGEMM_DEFAULT_UNROLL_M 2
  2357. #define SGEMM_DEFAULT_UNROLL_N 2
  2358. #define DGEMM_DEFAULT_UNROLL_M 2
  2359. #define DGEMM_DEFAULT_UNROLL_N 2
  2360. #define CGEMM_DEFAULT_UNROLL_M 2
  2361. #define CGEMM_DEFAULT_UNROLL_N 2
  2362. #define ZGEMM_DEFAULT_UNROLL_M 2
  2363. #define ZGEMM_DEFAULT_UNROLL_N 2
  2364. #define SGEMM_DEFAULT_P 128
  2365. #define DGEMM_DEFAULT_P 128
  2366. #define CGEMM_DEFAULT_P 96
  2367. #define ZGEMM_DEFAULT_P 64
  2368. #define SGEMM_DEFAULT_Q 240
  2369. #define DGEMM_DEFAULT_Q 120
  2370. #define CGEMM_DEFAULT_Q 120
  2371. #define ZGEMM_DEFAULT_Q 120
  2372. #define SGEMM_DEFAULT_R 12288
  2373. #define DGEMM_DEFAULT_R 8192
  2374. #define CGEMM_DEFAULT_R 4096
  2375. #define ZGEMM_DEFAULT_R 4096
  2376. #define SYMV_P 16
  2377. #define GEMM_DEFAULT_OFFSET_A 0
  2378. #define GEMM_DEFAULT_OFFSET_B 0
  2379. #endif
  2380. #ifdef C910V
  2381. #define GEMM_DEFAULT_OFFSET_A 0
  2382. #define GEMM_DEFAULT_OFFSET_B 0
  2383. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2384. #define SGEMM_DEFAULT_UNROLL_M 16
  2385. #define SGEMM_DEFAULT_UNROLL_N 4
  2386. #define DGEMM_DEFAULT_UNROLL_M 8
  2387. #define DGEMM_DEFAULT_UNROLL_N 4
  2388. #define CGEMM_DEFAULT_UNROLL_M 2
  2389. #define CGEMM_DEFAULT_UNROLL_N 2
  2390. #define ZGEMM_DEFAULT_UNROLL_M 2
  2391. #define ZGEMM_DEFAULT_UNROLL_N 2
  2392. #define SGEMM_DEFAULT_P 160
  2393. #define DGEMM_DEFAULT_P 160
  2394. #define CGEMM_DEFAULT_P 96
  2395. #define ZGEMM_DEFAULT_P 64
  2396. #define SGEMM_DEFAULT_Q 240
  2397. #define DGEMM_DEFAULT_Q 128
  2398. #define CGEMM_DEFAULT_Q 120
  2399. #define ZGEMM_DEFAULT_Q 120
  2400. #define SGEMM_DEFAULT_R 12288
  2401. #define DGEMM_DEFAULT_R 8192
  2402. #define CGEMM_DEFAULT_R 4096
  2403. #define ZGEMM_DEFAULT_R 4096
  2404. #define SYMV_P 16
  2405. #define GEMM_DEFAULT_OFFSET_A 0
  2406. #define GEMM_DEFAULT_OFFSET_B 0
  2407. #endif
  2408. #ifdef ARMV7
  2409. #define SNUMOPT 2
  2410. #define DNUMOPT 2
  2411. #define GEMM_DEFAULT_OFFSET_A 0
  2412. #define GEMM_DEFAULT_OFFSET_B 0
  2413. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2414. #define SGEMM_DEFAULT_UNROLL_M 4
  2415. #define SGEMM_DEFAULT_UNROLL_N 4
  2416. #define DGEMM_DEFAULT_UNROLL_M 4
  2417. #define DGEMM_DEFAULT_UNROLL_N 4
  2418. #define CGEMM_DEFAULT_UNROLL_M 2
  2419. #define CGEMM_DEFAULT_UNROLL_N 2
  2420. #define ZGEMM_DEFAULT_UNROLL_M 2
  2421. #define ZGEMM_DEFAULT_UNROLL_N 2
  2422. #define SGEMM_DEFAULT_P 128
  2423. #define DGEMM_DEFAULT_P 128
  2424. #define CGEMM_DEFAULT_P 96
  2425. #define ZGEMM_DEFAULT_P 64
  2426. #define SGEMM_DEFAULT_Q 240
  2427. #define DGEMM_DEFAULT_Q 120
  2428. #define CGEMM_DEFAULT_Q 120
  2429. #define ZGEMM_DEFAULT_Q 120
  2430. #define SGEMM_DEFAULT_R 12288
  2431. #define DGEMM_DEFAULT_R 8192
  2432. #define CGEMM_DEFAULT_R 4096
  2433. #define ZGEMM_DEFAULT_R 4096
  2434. #define SYMV_P 16
  2435. #endif
  2436. #if defined(ARMV6)
  2437. #define SNUMOPT 2
  2438. #define DNUMOPT 2
  2439. #define GEMM_DEFAULT_OFFSET_A 0
  2440. #define GEMM_DEFAULT_OFFSET_B 0
  2441. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2442. #define SGEMM_DEFAULT_UNROLL_M 4
  2443. #define SGEMM_DEFAULT_UNROLL_N 2
  2444. #define DGEMM_DEFAULT_UNROLL_M 4
  2445. #define DGEMM_DEFAULT_UNROLL_N 2
  2446. #define CGEMM_DEFAULT_UNROLL_M 2
  2447. #define CGEMM_DEFAULT_UNROLL_N 2
  2448. #define ZGEMM_DEFAULT_UNROLL_M 2
  2449. #define ZGEMM_DEFAULT_UNROLL_N 2
  2450. #define SGEMM_DEFAULT_P 128
  2451. #define DGEMM_DEFAULT_P 128
  2452. #define CGEMM_DEFAULT_P 96
  2453. #define ZGEMM_DEFAULT_P 64
  2454. #define SGEMM_DEFAULT_Q 240
  2455. #define DGEMM_DEFAULT_Q 120
  2456. #define CGEMM_DEFAULT_Q 120
  2457. #define ZGEMM_DEFAULT_Q 120
  2458. #define SGEMM_DEFAULT_R 12288
  2459. #define DGEMM_DEFAULT_R 8192
  2460. #define CGEMM_DEFAULT_R 4096
  2461. #define ZGEMM_DEFAULT_R 4096
  2462. #define SYMV_P 16
  2463. #endif
  2464. /* Common ARMv8 parameters */
  2465. #if defined(ARMV8)
  2466. #define SNUMOPT 2
  2467. #define DNUMOPT 2
  2468. #define GEMM_DEFAULT_OFFSET_A 0
  2469. #define GEMM_DEFAULT_OFFSET_B 0
  2470. #ifdef _WIN64
  2471. /* Use explicit casting for win64 as LLP64 datamodel is used */
  2472. #define GEMM_DEFAULT_ALIGN (BLASULONG)0x03fffUL
  2473. #else
  2474. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2475. #endif
  2476. #define SYMV_P 16
  2477. #if defined(CORTEXA57) || \
  2478. defined(CORTEXA72) || defined(CORTEXA73) || \
  2479. defined(FALKOR) || defined(TSV110) || defined(EMAG8180) || defined(VORTEX)
  2480. #define SGEMM_DEFAULT_UNROLL_M 16
  2481. #define SGEMM_DEFAULT_UNROLL_N 4
  2482. #define DGEMM_DEFAULT_UNROLL_M 8
  2483. #define DGEMM_DEFAULT_UNROLL_N 4
  2484. #define CGEMM_DEFAULT_UNROLL_M 8
  2485. #define CGEMM_DEFAULT_UNROLL_N 4
  2486. #define ZGEMM_DEFAULT_UNROLL_M 4
  2487. #define ZGEMM_DEFAULT_UNROLL_N 4
  2488. /*FIXME: this should be using the cache size, but there is currently no easy way to
  2489. query that on ARM. So if getarch counted more than 8 cores we simply assume the host
  2490. is a big desktop or server with abundant cache rather than a phone or embedded device */
  2491. #if NUM_CORES > 8 || defined(TSV110) || defined(EMAG8180) || defined(VORTEX)
  2492. #define SGEMM_DEFAULT_P 512
  2493. #define DGEMM_DEFAULT_P 256
  2494. #define CGEMM_DEFAULT_P 256
  2495. #define ZGEMM_DEFAULT_P 128
  2496. #define SGEMM_DEFAULT_Q 1024
  2497. #define DGEMM_DEFAULT_Q 512
  2498. #define CGEMM_DEFAULT_Q 512
  2499. #define ZGEMM_DEFAULT_Q 512
  2500. #else
  2501. #define SGEMM_DEFAULT_P 128
  2502. #define DGEMM_DEFAULT_P 160
  2503. #define CGEMM_DEFAULT_P 128
  2504. #define ZGEMM_DEFAULT_P 128
  2505. #define SGEMM_DEFAULT_Q 352
  2506. #define DGEMM_DEFAULT_Q 128
  2507. #define CGEMM_DEFAULT_Q 224
  2508. #define ZGEMM_DEFAULT_Q 112
  2509. #endif
  2510. #define SGEMM_DEFAULT_R 4096
  2511. #define DGEMM_DEFAULT_R 4096
  2512. #define CGEMM_DEFAULT_R 4096
  2513. #define ZGEMM_DEFAULT_R 2048
  2514. #elif defined(CORTEXA53) || defined(CORTEXA55)
  2515. #define SGEMM_DEFAULT_UNROLL_M 8
  2516. #define SGEMM_DEFAULT_UNROLL_N 8
  2517. #define DGEMM_DEFAULT_UNROLL_M 4
  2518. #define DGEMM_DEFAULT_UNROLL_N 4
  2519. #define CGEMM_DEFAULT_UNROLL_M 8
  2520. #define CGEMM_DEFAULT_UNROLL_N 4
  2521. #define ZGEMM_DEFAULT_UNROLL_M 4
  2522. #define ZGEMM_DEFAULT_UNROLL_N 4
  2523. #define SGEMM_DEFAULT_P 256
  2524. #define DGEMM_DEFAULT_P 160
  2525. #define CGEMM_DEFAULT_P 128
  2526. #define ZGEMM_DEFAULT_P 128
  2527. #define SGEMM_DEFAULT_Q 256
  2528. #define DGEMM_DEFAULT_Q 128
  2529. #define CGEMM_DEFAULT_Q 224
  2530. #define ZGEMM_DEFAULT_Q 112
  2531. #define SGEMM_DEFAULT_R 4096
  2532. #define DGEMM_DEFAULT_R 4096
  2533. #define CGEMM_DEFAULT_R 4096
  2534. #define ZGEMM_DEFAULT_R 2048
  2535. #elif defined(THUNDERX)
  2536. #define SGEMM_DEFAULT_UNROLL_M 4
  2537. #define SGEMM_DEFAULT_UNROLL_N 4
  2538. #define DGEMM_DEFAULT_UNROLL_M 2
  2539. #define DGEMM_DEFAULT_UNROLL_N 2
  2540. #define CGEMM_DEFAULT_UNROLL_M 2
  2541. #define CGEMM_DEFAULT_UNROLL_N 2
  2542. #define ZGEMM_DEFAULT_UNROLL_M 2
  2543. #define ZGEMM_DEFAULT_UNROLL_N 2
  2544. #define SGEMM_DEFAULT_P 128
  2545. #define DGEMM_DEFAULT_P 128
  2546. #define CGEMM_DEFAULT_P 96
  2547. #define ZGEMM_DEFAULT_P 64
  2548. #define SGEMM_DEFAULT_Q 240
  2549. #define DGEMM_DEFAULT_Q 120
  2550. #define CGEMM_DEFAULT_Q 120
  2551. #define ZGEMM_DEFAULT_Q 120
  2552. #define SGEMM_DEFAULT_R 12288
  2553. #define DGEMM_DEFAULT_R 8192
  2554. #define CGEMM_DEFAULT_R 4096
  2555. #define ZGEMM_DEFAULT_R 4096
  2556. #elif defined(THUNDERX2T99)
  2557. #define SGEMM_DEFAULT_UNROLL_M 16
  2558. #define SGEMM_DEFAULT_UNROLL_N 4
  2559. #define DGEMM_DEFAULT_UNROLL_M 8
  2560. #define DGEMM_DEFAULT_UNROLL_N 4
  2561. #define CGEMM_DEFAULT_UNROLL_M 8
  2562. #define CGEMM_DEFAULT_UNROLL_N 4
  2563. #define ZGEMM_DEFAULT_UNROLL_M 4
  2564. #define ZGEMM_DEFAULT_UNROLL_N 4
  2565. #define SGEMM_DEFAULT_P 128
  2566. #define DGEMM_DEFAULT_P 160
  2567. #define CGEMM_DEFAULT_P 128
  2568. #define ZGEMM_DEFAULT_P 128
  2569. #define SGEMM_DEFAULT_Q 352
  2570. #define DGEMM_DEFAULT_Q 128
  2571. #define CGEMM_DEFAULT_Q 224
  2572. #define ZGEMM_DEFAULT_Q 112
  2573. #define SGEMM_DEFAULT_R 4096
  2574. #define DGEMM_DEFAULT_R 4096
  2575. #define CGEMM_DEFAULT_R 4096
  2576. #define ZGEMM_DEFAULT_R 4096
  2577. #elif defined(THUNDERX3T110)
  2578. #define SGEMM_DEFAULT_UNROLL_M 16
  2579. #define SGEMM_DEFAULT_UNROLL_N 4
  2580. #define DGEMM_DEFAULT_UNROLL_M 8
  2581. #define DGEMM_DEFAULT_UNROLL_N 4
  2582. #define CGEMM_DEFAULT_UNROLL_M 8
  2583. #define CGEMM_DEFAULT_UNROLL_N 4
  2584. #define ZGEMM_DEFAULT_UNROLL_M 4
  2585. #define ZGEMM_DEFAULT_UNROLL_N 4
  2586. #define SGEMM_DEFAULT_P 128
  2587. #define DGEMM_DEFAULT_P 320
  2588. #define CGEMM_DEFAULT_P 128
  2589. #define ZGEMM_DEFAULT_P 128
  2590. #define SGEMM_DEFAULT_Q 352
  2591. #define DGEMM_DEFAULT_Q 128
  2592. #define CGEMM_DEFAULT_Q 224
  2593. #define ZGEMM_DEFAULT_Q 112
  2594. #define SGEMM_DEFAULT_R 4096
  2595. #define DGEMM_DEFAULT_R 4096
  2596. #define CGEMM_DEFAULT_R 4096
  2597. #define ZGEMM_DEFAULT_R 4096
  2598. #elif defined(NEOVERSEN1)
  2599. #define SGEMM_DEFAULT_UNROLL_M 16
  2600. #define SGEMM_DEFAULT_UNROLL_N 4
  2601. #define DGEMM_DEFAULT_UNROLL_M 8
  2602. #define DGEMM_DEFAULT_UNROLL_N 4
  2603. #define CGEMM_DEFAULT_UNROLL_M 8
  2604. #define CGEMM_DEFAULT_UNROLL_N 4
  2605. #define ZGEMM_DEFAULT_UNROLL_M 4
  2606. #define ZGEMM_DEFAULT_UNROLL_N 4
  2607. #define SGEMM_DEFAULT_P 128
  2608. #define DGEMM_DEFAULT_P 160
  2609. #define CGEMM_DEFAULT_P 128
  2610. #define ZGEMM_DEFAULT_P 128
  2611. #define SGEMM_DEFAULT_Q 352
  2612. #define DGEMM_DEFAULT_Q 128
  2613. #define CGEMM_DEFAULT_Q 224
  2614. #define ZGEMM_DEFAULT_Q 112
  2615. #define SGEMM_DEFAULT_R 4096
  2616. #define DGEMM_DEFAULT_R 4096
  2617. #define CGEMM_DEFAULT_R 4096
  2618. #define ZGEMM_DEFAULT_R 4096
  2619. #elif defined(ARMV8SVE) || defined(A64FX)
  2620. #define SGEMM_DEFAULT_UNROLL_M 16
  2621. #define SGEMM_DEFAULT_UNROLL_N 4
  2622. /* When all BLAS3 routines are implemeted with SVE, DGEMM_DEFAULT_UNROLL_M should be "sve_vl".
  2623. Until then, just keep it different than DGEMM_DEFAULT_UNROLL_N to keep copy routines in both directions seperated. */
  2624. #define DGEMM_DEFAULT_UNROLL_M 2
  2625. #define DGEMM_DEFAULT_UNROLL_N 8
  2626. #define CGEMM_DEFAULT_UNROLL_M 8
  2627. #define CGEMM_DEFAULT_UNROLL_N 4
  2628. #define ZGEMM_DEFAULT_UNROLL_M 4
  2629. #define ZGEMM_DEFAULT_UNROLL_N 4
  2630. #define SGEMM_DEFAULT_P 128
  2631. #define DGEMM_DEFAULT_P 160
  2632. #define CGEMM_DEFAULT_P 128
  2633. #define ZGEMM_DEFAULT_P 128
  2634. #define SGEMM_DEFAULT_Q 352
  2635. #define DGEMM_DEFAULT_Q 128
  2636. #define CGEMM_DEFAULT_Q 224
  2637. #define ZGEMM_DEFAULT_Q 112
  2638. #define SGEMM_DEFAULT_R 4096
  2639. #define DGEMM_DEFAULT_R 4096
  2640. #define CGEMM_DEFAULT_R 4096
  2641. #define ZGEMM_DEFAULT_R 4096
  2642. #else /* Other/undetected ARMv8 cores */
  2643. #define SGEMM_DEFAULT_UNROLL_M 16
  2644. #define SGEMM_DEFAULT_UNROLL_N 4
  2645. #define DGEMM_DEFAULT_UNROLL_M 4
  2646. #define DGEMM_DEFAULT_UNROLL_N 8
  2647. #define CGEMM_DEFAULT_UNROLL_M 8
  2648. #define CGEMM_DEFAULT_UNROLL_N 4
  2649. #define ZGEMM_DEFAULT_UNROLL_M 4
  2650. #define ZGEMM_DEFAULT_UNROLL_N 4
  2651. #define SGEMM_DEFAULT_P 128
  2652. #define DGEMM_DEFAULT_P 160
  2653. #define CGEMM_DEFAULT_P 128
  2654. #define ZGEMM_DEFAULT_P 128
  2655. #define SGEMM_DEFAULT_Q 352
  2656. #define DGEMM_DEFAULT_Q 128
  2657. #define CGEMM_DEFAULT_Q 224
  2658. #define ZGEMM_DEFAULT_Q 112
  2659. #define SGEMM_DEFAULT_R 4096
  2660. #define DGEMM_DEFAULT_R 4096
  2661. #define CGEMM_DEFAULT_R 4096
  2662. #define ZGEMM_DEFAULT_R 4096
  2663. #endif /* Cores */
  2664. #endif /* ARMv8 */
  2665. #if defined(ARMV5)
  2666. #define SNUMOPT 2
  2667. #define DNUMOPT 2
  2668. #define GEMM_DEFAULT_OFFSET_A 0
  2669. #define GEMM_DEFAULT_OFFSET_B 0
  2670. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2671. #define SGEMM_DEFAULT_UNROLL_M 2
  2672. #define SGEMM_DEFAULT_UNROLL_N 2
  2673. #define DGEMM_DEFAULT_UNROLL_M 2
  2674. #define DGEMM_DEFAULT_UNROLL_N 2
  2675. #define CGEMM_DEFAULT_UNROLL_M 2
  2676. #define CGEMM_DEFAULT_UNROLL_N 2
  2677. #define ZGEMM_DEFAULT_UNROLL_M 2
  2678. #define ZGEMM_DEFAULT_UNROLL_N 2
  2679. #define SGEMM_DEFAULT_P 128
  2680. #define DGEMM_DEFAULT_P 128
  2681. #define CGEMM_DEFAULT_P 96
  2682. #define ZGEMM_DEFAULT_P 64
  2683. #define SGEMM_DEFAULT_Q 240
  2684. #define DGEMM_DEFAULT_Q 120
  2685. #define CGEMM_DEFAULT_Q 120
  2686. #define ZGEMM_DEFAULT_Q 120
  2687. #define SGEMM_DEFAULT_R 12288
  2688. #define DGEMM_DEFAULT_R 8192
  2689. #define CGEMM_DEFAULT_R 4096
  2690. #define ZGEMM_DEFAULT_R 4096
  2691. #define SYMV_P 16
  2692. #endif
  2693. #ifdef CORTEXA9
  2694. #define SNUMOPT 2
  2695. #define DNUMOPT 2
  2696. #define GEMM_DEFAULT_OFFSET_A 0
  2697. #define GEMM_DEFAULT_OFFSET_B 0
  2698. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2699. #define SGEMM_DEFAULT_UNROLL_M 4
  2700. #define SGEMM_DEFAULT_UNROLL_N 4
  2701. #define DGEMM_DEFAULT_UNROLL_M 4
  2702. #define DGEMM_DEFAULT_UNROLL_N 4
  2703. #define CGEMM_DEFAULT_UNROLL_M 2
  2704. #define CGEMM_DEFAULT_UNROLL_N 2
  2705. #define ZGEMM_DEFAULT_UNROLL_M 2
  2706. #define ZGEMM_DEFAULT_UNROLL_N 2
  2707. #define SGEMM_DEFAULT_P 128
  2708. #define DGEMM_DEFAULT_P 128
  2709. #define CGEMM_DEFAULT_P 96
  2710. #define ZGEMM_DEFAULT_P 64
  2711. #define SGEMM_DEFAULT_Q 240
  2712. #define DGEMM_DEFAULT_Q 120
  2713. #define CGEMM_DEFAULT_Q 120
  2714. #define ZGEMM_DEFAULT_Q 120
  2715. #define SGEMM_DEFAULT_R 12288
  2716. #define DGEMM_DEFAULT_R 8192
  2717. #define CGEMM_DEFAULT_R 4096
  2718. #define ZGEMM_DEFAULT_R 4096
  2719. #define SYMV_P 16
  2720. #endif
  2721. #ifdef CORTEXA15
  2722. #define SNUMOPT 2
  2723. #define DNUMOPT 2
  2724. #define GEMM_DEFAULT_OFFSET_A 0
  2725. #define GEMM_DEFAULT_OFFSET_B 0
  2726. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2727. #define SGEMM_DEFAULT_UNROLL_M 4
  2728. #define SGEMM_DEFAULT_UNROLL_N 4
  2729. #define DGEMM_DEFAULT_UNROLL_M 4
  2730. #define DGEMM_DEFAULT_UNROLL_N 4
  2731. #define CGEMM_DEFAULT_UNROLL_M 2
  2732. #define CGEMM_DEFAULT_UNROLL_N 2
  2733. #define ZGEMM_DEFAULT_UNROLL_M 2
  2734. #define ZGEMM_DEFAULT_UNROLL_N 2
  2735. #define SGEMM_DEFAULT_P 128
  2736. #define DGEMM_DEFAULT_P 128
  2737. #define CGEMM_DEFAULT_P 96
  2738. #define ZGEMM_DEFAULT_P 64
  2739. #define SGEMM_DEFAULT_Q 240
  2740. #define DGEMM_DEFAULT_Q 120
  2741. #define CGEMM_DEFAULT_Q 120
  2742. #define ZGEMM_DEFAULT_Q 120
  2743. #define SGEMM_DEFAULT_R 12288
  2744. #define DGEMM_DEFAULT_R 8192
  2745. #define CGEMM_DEFAULT_R 4096
  2746. #define ZGEMM_DEFAULT_R 4096
  2747. #define SYMV_P 16
  2748. #endif
  2749. #if defined(ZARCH_GENERIC)
  2750. #define SNUMOPT 2
  2751. #define DNUMOPT 2
  2752. #define GEMM_DEFAULT_OFFSET_A 0
  2753. #define GEMM_DEFAULT_OFFSET_B 0
  2754. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2755. #define SGEMM_DEFAULT_UNROLL_M 2
  2756. #define SGEMM_DEFAULT_UNROLL_N 2
  2757. #define DGEMM_DEFAULT_UNROLL_M 2
  2758. #define DGEMM_DEFAULT_UNROLL_N 2
  2759. #define CGEMM_DEFAULT_UNROLL_M 2
  2760. #define CGEMM_DEFAULT_UNROLL_N 2
  2761. #define ZGEMM_DEFAULT_UNROLL_M 2
  2762. #define ZGEMM_DEFAULT_UNROLL_N 2
  2763. #define SGEMM_DEFAULT_P 128
  2764. #define DGEMM_DEFAULT_P 128
  2765. #define CGEMM_DEFAULT_P 96
  2766. #define ZGEMM_DEFAULT_P 64
  2767. #define SGEMM_DEFAULT_Q 240
  2768. #define DGEMM_DEFAULT_Q 120
  2769. #define CGEMM_DEFAULT_Q 120
  2770. #define ZGEMM_DEFAULT_Q 120
  2771. #define SGEMM_DEFAULT_R 12288
  2772. #define DGEMM_DEFAULT_R 8192
  2773. #define CGEMM_DEFAULT_R 4096
  2774. #define ZGEMM_DEFAULT_R 4096
  2775. #define SYMV_P 16
  2776. #endif
  2777. #if defined(Z13)
  2778. #define SNUMOPT 2
  2779. #define DNUMOPT 2
  2780. #define GEMM_DEFAULT_OFFSET_A 0
  2781. #define GEMM_DEFAULT_OFFSET_B 0
  2782. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x03fffUL
  2783. #define SGEMM_DEFAULT_UNROLL_M 8
  2784. #define SGEMM_DEFAULT_UNROLL_N 4
  2785. #define DGEMM_DEFAULT_UNROLL_M 8
  2786. #define DGEMM_DEFAULT_UNROLL_N 4
  2787. #define CGEMM_DEFAULT_UNROLL_M 4
  2788. #define CGEMM_DEFAULT_UNROLL_N 4
  2789. #define ZGEMM_DEFAULT_UNROLL_M 4
  2790. #define ZGEMM_DEFAULT_UNROLL_N 4
  2791. #define SGEMM_DEFAULT_P 456
  2792. #define DGEMM_DEFAULT_P 320
  2793. #define CGEMM_DEFAULT_P 480
  2794. #define ZGEMM_DEFAULT_P 224
  2795. #define SGEMM_DEFAULT_Q 488
  2796. #define DGEMM_DEFAULT_Q 384
  2797. #define CGEMM_DEFAULT_Q 128
  2798. #define ZGEMM_DEFAULT_Q 352
  2799. #define SGEMM_DEFAULT_R 8192
  2800. #define DGEMM_DEFAULT_R 4096
  2801. #define CGEMM_DEFAULT_R 4096
  2802. #define ZGEMM_DEFAULT_R 2048
  2803. #define SYMV_P 16
  2804. #endif
  2805. #if defined(Z14)
  2806. #define SNUMOPT 2
  2807. #define DNUMOPT 2
  2808. #define GEMM_DEFAULT_OFFSET_A 0
  2809. #define GEMM_DEFAULT_OFFSET_B 0
  2810. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2811. #define SGEMM_DEFAULT_UNROLL_M 16
  2812. #define SGEMM_DEFAULT_UNROLL_N 4
  2813. #define DGEMM_DEFAULT_UNROLL_M 8
  2814. #define DGEMM_DEFAULT_UNROLL_N 4
  2815. #define CGEMM_DEFAULT_UNROLL_M 4
  2816. #define CGEMM_DEFAULT_UNROLL_N 4
  2817. #define ZGEMM_DEFAULT_UNROLL_M 4
  2818. #define ZGEMM_DEFAULT_UNROLL_N 4
  2819. #define SGEMM_DEFAULT_P 480
  2820. #define DGEMM_DEFAULT_P 320
  2821. #define CGEMM_DEFAULT_P 480
  2822. #define ZGEMM_DEFAULT_P 224
  2823. #define SGEMM_DEFAULT_Q 512
  2824. #define DGEMM_DEFAULT_Q 384
  2825. #define CGEMM_DEFAULT_Q 128
  2826. #define ZGEMM_DEFAULT_Q 352
  2827. #define SGEMM_DEFAULT_R 8192
  2828. #define DGEMM_DEFAULT_R 4096
  2829. #define CGEMM_DEFAULT_R 4096
  2830. #define ZGEMM_DEFAULT_R 2048
  2831. #define SYMV_P 16
  2832. #endif
  2833. #ifdef GENERIC
  2834. #define SNUMOPT 2
  2835. #define DNUMOPT 2
  2836. #define GEMM_DEFAULT_OFFSET_A 0
  2837. #define GEMM_DEFAULT_OFFSET_B 0
  2838. #define GEMM_DEFAULT_ALIGN (BLASLONG)0x0ffffUL
  2839. #define SGEMM_DEFAULT_UNROLL_N 2
  2840. #define DGEMM_DEFAULT_UNROLL_N 2
  2841. #define QGEMM_DEFAULT_UNROLL_N 2
  2842. #define CGEMM_DEFAULT_UNROLL_N 2
  2843. #define ZGEMM_DEFAULT_UNROLL_N 2
  2844. #define XGEMM_DEFAULT_UNROLL_N 1
  2845. #ifdef ARCH_X86
  2846. #define SGEMM_DEFAULT_UNROLL_M 2
  2847. #define DGEMM_DEFAULT_UNROLL_M 2
  2848. #define QGEMM_DEFAULT_UNROLL_M 2
  2849. #define CGEMM_DEFAULT_UNROLL_M 2
  2850. #define ZGEMM_DEFAULT_UNROLL_M 2
  2851. #define XGEMM_DEFAULT_UNROLL_M 1
  2852. #else
  2853. #define SGEMM_DEFAULT_UNROLL_M 2
  2854. #define DGEMM_DEFAULT_UNROLL_M 2
  2855. #define QGEMM_DEFAULT_UNROLL_M 2
  2856. #define CGEMM_DEFAULT_UNROLL_M 2
  2857. #define ZGEMM_DEFAULT_UNROLL_M 2
  2858. #define XGEMM_DEFAULT_UNROLL_M 1
  2859. #endif
  2860. #ifdef ARCH_MIPS
  2861. #define SGEMM_DEFAULT_P 128
  2862. #define DGEMM_DEFAULT_P 128
  2863. #define CGEMM_DEFAULT_P 96
  2864. #define ZGEMM_DEFAULT_P 64
  2865. #define SGEMM_DEFAULT_Q 240
  2866. #define DGEMM_DEFAULT_Q 120
  2867. #define CGEMM_DEFAULT_Q 120
  2868. #define ZGEMM_DEFAULT_Q 120
  2869. #define SGEMM_DEFAULT_R 12288
  2870. #define DGEMM_DEFAULT_R 8192
  2871. #define CGEMM_DEFAULT_R 4096
  2872. #define ZGEMM_DEFAULT_R 4096
  2873. #else
  2874. #define SGEMM_DEFAULT_P sgemm_p
  2875. #define DGEMM_DEFAULT_P dgemm_p
  2876. #define QGEMM_DEFAULT_P qgemm_p
  2877. #define CGEMM_DEFAULT_P cgemm_p
  2878. #define ZGEMM_DEFAULT_P zgemm_p
  2879. #define XGEMM_DEFAULT_P xgemm_p
  2880. #define SGEMM_DEFAULT_R sgemm_r
  2881. #define DGEMM_DEFAULT_R dgemm_r
  2882. #define QGEMM_DEFAULT_R qgemm_r
  2883. #define CGEMM_DEFAULT_R cgemm_r
  2884. #define ZGEMM_DEFAULT_R zgemm_r
  2885. #define XGEMM_DEFAULT_R xgemm_r
  2886. #define SGEMM_DEFAULT_Q 128
  2887. #define DGEMM_DEFAULT_Q 128
  2888. #define QGEMM_DEFAULT_Q 128
  2889. #define CGEMM_DEFAULT_Q 128
  2890. #define ZGEMM_DEFAULT_Q 128
  2891. #define XGEMM_DEFAULT_Q 128
  2892. #endif
  2893. #define SYMV_P 16
  2894. #endif
  2895. #ifndef QGEMM_DEFAULT_UNROLL_M
  2896. #define QGEMM_DEFAULT_UNROLL_M 2
  2897. #endif
  2898. #ifndef QGEMM_DEFAULT_UNROLL_N
  2899. #define QGEMM_DEFAULT_UNROLL_N 2
  2900. #endif
  2901. #ifndef XGEMM_DEFAULT_UNROLL_M
  2902. #define XGEMM_DEFAULT_UNROLL_M 2
  2903. #endif
  2904. #ifndef XGEMM_DEFAULT_UNROLL_N
  2905. #define XGEMM_DEFAULT_UNROLL_N 2
  2906. #endif
  2907. #ifndef HAVE_SSE2
  2908. #define SHUFPD_0 shufps $0x44,
  2909. #define SHUFPD_1 shufps $0x4e,
  2910. #define SHUFPD_2 shufps $0xe4,
  2911. #define SHUFPD_3 shufps $0xee,
  2912. #endif
  2913. #ifndef SHUFPD_0
  2914. #define SHUFPD_0 shufpd $0,
  2915. #endif
  2916. #ifndef SHUFPD_1
  2917. #define SHUFPD_1 shufpd $1,
  2918. #endif
  2919. #ifndef SHUFPD_2
  2920. #define SHUFPD_2 shufpd $2,
  2921. #endif
  2922. #ifndef SHUFPD_3
  2923. #define SHUFPD_3 shufpd $3,
  2924. #endif
  2925. #ifndef SHUFPS_39
  2926. #define SHUFPS_39 shufps $0x39,
  2927. #endif
  2928. #endif