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 72 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
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
12 years ago
6 years ago
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
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
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
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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091
  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. #ifdef OPTERON
  68. #define SNUMOPT 4
  69. #define DNUMOPT 2
  70. #define GEMM_DEFAULT_OFFSET_A 64
  71. #define GEMM_DEFAULT_OFFSET_B 256
  72. #define GEMM_DEFAULT_ALIGN 0x01ffffUL
  73. #define SGEMM_DEFAULT_UNROLL_N 4
  74. #define DGEMM_DEFAULT_UNROLL_N 4
  75. #define QGEMM_DEFAULT_UNROLL_N 2
  76. #define CGEMM_DEFAULT_UNROLL_N 2
  77. #define ZGEMM_DEFAULT_UNROLL_N 2
  78. #define XGEMM_DEFAULT_UNROLL_N 1
  79. #ifdef ARCH_X86
  80. #define SGEMM_DEFAULT_UNROLL_M 4
  81. #define DGEMM_DEFAULT_UNROLL_M 2
  82. #define QGEMM_DEFAULT_UNROLL_M 2
  83. #define CGEMM_DEFAULT_UNROLL_M 2
  84. #define ZGEMM_DEFAULT_UNROLL_M 1
  85. #define XGEMM_DEFAULT_UNROLL_M 1
  86. #else
  87. #define SGEMM_DEFAULT_UNROLL_M 8
  88. #define DGEMM_DEFAULT_UNROLL_M 4
  89. #define QGEMM_DEFAULT_UNROLL_M 2
  90. #define CGEMM_DEFAULT_UNROLL_M 4
  91. #define ZGEMM_DEFAULT_UNROLL_M 2
  92. #define XGEMM_DEFAULT_UNROLL_M 1
  93. #endif
  94. #define SGEMM_DEFAULT_P sgemm_p
  95. #define DGEMM_DEFAULT_P dgemm_p
  96. #define QGEMM_DEFAULT_P qgemm_p
  97. #define CGEMM_DEFAULT_P cgemm_p
  98. #define ZGEMM_DEFAULT_P zgemm_p
  99. #define XGEMM_DEFAULT_P xgemm_p
  100. #define SGEMM_DEFAULT_R sgemm_r
  101. #define DGEMM_DEFAULT_R dgemm_r
  102. #define QGEMM_DEFAULT_R qgemm_r
  103. #define CGEMM_DEFAULT_R cgemm_r
  104. #define ZGEMM_DEFAULT_R zgemm_r
  105. #define XGEMM_DEFAULT_R xgemm_r
  106. #ifdef ALLOC_HUGETLB
  107. #define SGEMM_DEFAULT_Q 248
  108. #define DGEMM_DEFAULT_Q 248
  109. #define QGEMM_DEFAULT_Q 248
  110. #define CGEMM_DEFAULT_Q 248
  111. #define ZGEMM_DEFAULT_Q 248
  112. #define XGEMM_DEFAULT_Q 248
  113. #else
  114. #define SGEMM_DEFAULT_Q 240
  115. #define DGEMM_DEFAULT_Q 240
  116. #define QGEMM_DEFAULT_Q 240
  117. #define CGEMM_DEFAULT_Q 240
  118. #define ZGEMM_DEFAULT_Q 240
  119. #define XGEMM_DEFAULT_Q 240
  120. #endif
  121. #define SYMV_P 16
  122. #define HAVE_EXCLUSIVE_CACHE
  123. #endif
  124. #if defined(BARCELONA) || defined(SHANGHAI) || defined(BOBCAT)
  125. #define SNUMOPT 8
  126. #define DNUMOPT 4
  127. #define GEMM_DEFAULT_OFFSET_A 64
  128. #define GEMM_DEFAULT_OFFSET_B 832
  129. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  130. #define SGEMM_DEFAULT_UNROLL_N 4
  131. #define DGEMM_DEFAULT_UNROLL_N 4
  132. #define QGEMM_DEFAULT_UNROLL_N 2
  133. #define CGEMM_DEFAULT_UNROLL_N 2
  134. #define ZGEMM_DEFAULT_UNROLL_N 2
  135. #define XGEMM_DEFAULT_UNROLL_N 1
  136. #ifdef ARCH_X86
  137. #define SGEMM_DEFAULT_UNROLL_M 4
  138. #define DGEMM_DEFAULT_UNROLL_M 2
  139. #define QGEMM_DEFAULT_UNROLL_M 2
  140. #define CGEMM_DEFAULT_UNROLL_M 2
  141. #define ZGEMM_DEFAULT_UNROLL_M 1
  142. #define XGEMM_DEFAULT_UNROLL_M 1
  143. #else
  144. #define SGEMM_DEFAULT_UNROLL_M 8
  145. #define DGEMM_DEFAULT_UNROLL_M 4
  146. #define QGEMM_DEFAULT_UNROLL_M 2
  147. #define CGEMM_DEFAULT_UNROLL_M 4
  148. #define ZGEMM_DEFAULT_UNROLL_M 2
  149. #define XGEMM_DEFAULT_UNROLL_M 1
  150. #endif
  151. #if 0
  152. #define SGEMM_DEFAULT_P 496
  153. #define DGEMM_DEFAULT_P 248
  154. #define QGEMM_DEFAULT_P 124
  155. #define CGEMM_DEFAULT_P 248
  156. #define ZGEMM_DEFAULT_P 124
  157. #define XGEMM_DEFAULT_P 62
  158. #define SGEMM_DEFAULT_Q 248
  159. #define DGEMM_DEFAULT_Q 248
  160. #define QGEMM_DEFAULT_Q 248
  161. #define CGEMM_DEFAULT_Q 248
  162. #define ZGEMM_DEFAULT_Q 248
  163. #define XGEMM_DEFAULT_Q 248
  164. #else
  165. #define SGEMM_DEFAULT_P 448
  166. #define DGEMM_DEFAULT_P 224
  167. #define QGEMM_DEFAULT_P 112
  168. #define CGEMM_DEFAULT_P 224
  169. #define ZGEMM_DEFAULT_P 112
  170. #define XGEMM_DEFAULT_P 56
  171. #define SGEMM_DEFAULT_Q 224
  172. #define DGEMM_DEFAULT_Q 224
  173. #define QGEMM_DEFAULT_Q 224
  174. #define CGEMM_DEFAULT_Q 224
  175. #define ZGEMM_DEFAULT_Q 224
  176. #define XGEMM_DEFAULT_Q 224
  177. #endif
  178. #define SGEMM_DEFAULT_R sgemm_r
  179. #define QGEMM_DEFAULT_R qgemm_r
  180. #define DGEMM_DEFAULT_R dgemm_r
  181. #define CGEMM_DEFAULT_R cgemm_r
  182. #define ZGEMM_DEFAULT_R zgemm_r
  183. #define XGEMM_DEFAULT_R xgemm_r
  184. #define SYMV_P 16
  185. #define HAVE_EXCLUSIVE_CACHE
  186. #define GEMM_THREAD gemm_thread_mn
  187. #endif
  188. #ifdef BULLDOZER
  189. #define SNUMOPT 8
  190. #define DNUMOPT 4
  191. #define GEMM_DEFAULT_OFFSET_A 64
  192. #define GEMM_DEFAULT_OFFSET_B 832
  193. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  194. #define QGEMM_DEFAULT_UNROLL_N 2
  195. #define CGEMM_DEFAULT_UNROLL_N 2
  196. #define ZGEMM_DEFAULT_UNROLL_N 2
  197. #define XGEMM_DEFAULT_UNROLL_N 1
  198. #ifdef ARCH_X86
  199. #define SGEMM_DEFAULT_UNROLL_N 4
  200. #define DGEMM_DEFAULT_UNROLL_N 4
  201. #define SGEMM_DEFAULT_UNROLL_M 4
  202. #define DGEMM_DEFAULT_UNROLL_M 2
  203. #define QGEMM_DEFAULT_UNROLL_M 2
  204. #define CGEMM_DEFAULT_UNROLL_M 2
  205. #define ZGEMM_DEFAULT_UNROLL_M 1
  206. #define XGEMM_DEFAULT_UNROLL_M 1
  207. #else
  208. #define SGEMM_DEFAULT_UNROLL_N 2
  209. #define DGEMM_DEFAULT_UNROLL_N 2
  210. #define SGEMM_DEFAULT_UNROLL_M 16
  211. #define DGEMM_DEFAULT_UNROLL_M 8
  212. #define QGEMM_DEFAULT_UNROLL_M 2
  213. #define CGEMM_DEFAULT_UNROLL_M 4
  214. #define ZGEMM_DEFAULT_UNROLL_M 2
  215. #define XGEMM_DEFAULT_UNROLL_M 1
  216. #define CGEMM3M_DEFAULT_UNROLL_N 4
  217. #define CGEMM3M_DEFAULT_UNROLL_M 8
  218. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  219. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  220. #define DGEMM_DEFAULT_UNROLL_MN 16
  221. #define GEMV_UNROLL 8
  222. #endif
  223. #if defined(ARCH_X86_64)
  224. #define SGEMM_DEFAULT_P 768
  225. #define DGEMM_DEFAULT_P 384
  226. #else
  227. #define SGEMM_DEFAULT_P 448
  228. #define DGEMM_DEFAULT_P 224
  229. #endif
  230. #define QGEMM_DEFAULT_P 112
  231. #define CGEMM_DEFAULT_P 224
  232. #define ZGEMM_DEFAULT_P 112
  233. #define XGEMM_DEFAULT_P 56
  234. #if defined(ARCH_X86_64)
  235. #define SGEMM_DEFAULT_Q 168
  236. #define DGEMM_DEFAULT_Q 168
  237. #else
  238. #define SGEMM_DEFAULT_Q 224
  239. #define DGEMM_DEFAULT_Q 224
  240. #endif
  241. #define QGEMM_DEFAULT_Q 224
  242. #define CGEMM_DEFAULT_Q 224
  243. #define ZGEMM_DEFAULT_Q 224
  244. #define XGEMM_DEFAULT_Q 224
  245. #define CGEMM3M_DEFAULT_P 448
  246. #define ZGEMM3M_DEFAULT_P 224
  247. #define XGEMM3M_DEFAULT_P 112
  248. #define CGEMM3M_DEFAULT_Q 224
  249. #define ZGEMM3M_DEFAULT_Q 224
  250. #define XGEMM3M_DEFAULT_Q 224
  251. #define CGEMM3M_DEFAULT_R 12288
  252. #define ZGEMM3M_DEFAULT_R 12288
  253. #define XGEMM3M_DEFAULT_R 12288
  254. #define SGEMM_DEFAULT_R sgemm_r
  255. #define QGEMM_DEFAULT_R qgemm_r
  256. #define DGEMM_DEFAULT_R dgemm_r
  257. #define CGEMM_DEFAULT_R cgemm_r
  258. #define ZGEMM_DEFAULT_R zgemm_r
  259. #define XGEMM_DEFAULT_R xgemm_r
  260. #define SYMV_P 16
  261. #define HAVE_EXCLUSIVE_CACHE
  262. #define GEMM_THREAD gemm_thread_mn
  263. #endif
  264. #ifdef PILEDRIVER
  265. #define SNUMOPT 8
  266. #define DNUMOPT 4
  267. #define GEMM_DEFAULT_OFFSET_A 64
  268. #define GEMM_DEFAULT_OFFSET_B 832
  269. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  270. #define QGEMM_DEFAULT_UNROLL_N 2
  271. #define CGEMM_DEFAULT_UNROLL_N 2
  272. #define ZGEMM_DEFAULT_UNROLL_N 2
  273. #define XGEMM_DEFAULT_UNROLL_N 1
  274. #ifdef ARCH_X86
  275. #define SGEMM_DEFAULT_UNROLL_N 4
  276. #define DGEMM_DEFAULT_UNROLL_N 4
  277. #define SGEMM_DEFAULT_UNROLL_M 4
  278. #define DGEMM_DEFAULT_UNROLL_M 2
  279. #define QGEMM_DEFAULT_UNROLL_M 2
  280. #define CGEMM_DEFAULT_UNROLL_M 2
  281. #define ZGEMM_DEFAULT_UNROLL_M 1
  282. #define XGEMM_DEFAULT_UNROLL_M 1
  283. #else
  284. #define SGEMM_DEFAULT_UNROLL_N 2
  285. #define DGEMM_DEFAULT_UNROLL_N 2
  286. #define SGEMM_DEFAULT_UNROLL_M 16
  287. #define DGEMM_DEFAULT_UNROLL_M 8
  288. #define QGEMM_DEFAULT_UNROLL_M 2
  289. #define CGEMM_DEFAULT_UNROLL_M 4
  290. #define ZGEMM_DEFAULT_UNROLL_M 2
  291. #define XGEMM_DEFAULT_UNROLL_M 1
  292. #define CGEMM3M_DEFAULT_UNROLL_N 4
  293. #define CGEMM3M_DEFAULT_UNROLL_M 8
  294. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  295. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  296. #define GEMV_UNROLL 8
  297. #endif
  298. #if defined(ARCH_X86_64)
  299. #define SGEMM_DEFAULT_P 768
  300. #define DGEMM_DEFAULT_P 768
  301. #define ZGEMM_DEFAULT_P 384
  302. #define CGEMM_DEFAULT_P 768
  303. #else
  304. #define SGEMM_DEFAULT_P 448
  305. #define DGEMM_DEFAULT_P 480
  306. #define ZGEMM_DEFAULT_P 112
  307. #define CGEMM_DEFAULT_P 224
  308. #endif
  309. #define QGEMM_DEFAULT_P 112
  310. #define XGEMM_DEFAULT_P 56
  311. #if defined(ARCH_X86_64)
  312. #define SGEMM_DEFAULT_Q 192
  313. #define DGEMM_DEFAULT_Q 168
  314. #define ZGEMM_DEFAULT_Q 168
  315. #define CGEMM_DEFAULT_Q 168
  316. #else
  317. #define SGEMM_DEFAULT_Q 224
  318. #define DGEMM_DEFAULT_Q 224
  319. #define ZGEMM_DEFAULT_Q 224
  320. #define CGEMM_DEFAULT_Q 224
  321. #endif
  322. #define QGEMM_DEFAULT_Q 224
  323. #define XGEMM_DEFAULT_Q 224
  324. #define CGEMM3M_DEFAULT_P 448
  325. #define ZGEMM3M_DEFAULT_P 224
  326. #define XGEMM3M_DEFAULT_P 112
  327. #define CGEMM3M_DEFAULT_Q 224
  328. #define ZGEMM3M_DEFAULT_Q 224
  329. #define XGEMM3M_DEFAULT_Q 224
  330. #define CGEMM3M_DEFAULT_R 12288
  331. #define ZGEMM3M_DEFAULT_R 12288
  332. #define XGEMM3M_DEFAULT_R 12288
  333. #define SGEMM_DEFAULT_R 12288
  334. #define QGEMM_DEFAULT_R qgemm_r
  335. #define DGEMM_DEFAULT_R 12288
  336. #define CGEMM_DEFAULT_R cgemm_r
  337. #define ZGEMM_DEFAULT_R zgemm_r
  338. #define XGEMM_DEFAULT_R xgemm_r
  339. #define SYMV_P 16
  340. #define HAVE_EXCLUSIVE_CACHE
  341. #define GEMM_THREAD gemm_thread_mn
  342. #endif
  343. #ifdef STEAMROLLER
  344. #define SNUMOPT 8
  345. #define DNUMOPT 4
  346. #define GEMM_DEFAULT_OFFSET_A 64
  347. #define GEMM_DEFAULT_OFFSET_B 832
  348. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  349. #define QGEMM_DEFAULT_UNROLL_N 2
  350. #define CGEMM_DEFAULT_UNROLL_N 2
  351. #define ZGEMM_DEFAULT_UNROLL_N 2
  352. #define XGEMM_DEFAULT_UNROLL_N 1
  353. #ifdef ARCH_X86
  354. #define SGEMM_DEFAULT_UNROLL_N 4
  355. #define DGEMM_DEFAULT_UNROLL_N 4
  356. #define SGEMM_DEFAULT_UNROLL_M 4
  357. #define DGEMM_DEFAULT_UNROLL_M 2
  358. #define QGEMM_DEFAULT_UNROLL_M 2
  359. #define CGEMM_DEFAULT_UNROLL_M 2
  360. #define ZGEMM_DEFAULT_UNROLL_M 1
  361. #define XGEMM_DEFAULT_UNROLL_M 1
  362. #else
  363. #define SGEMM_DEFAULT_UNROLL_N 2
  364. #define DGEMM_DEFAULT_UNROLL_N 2
  365. #define SGEMM_DEFAULT_UNROLL_M 16
  366. #define DGEMM_DEFAULT_UNROLL_M 8
  367. #define QGEMM_DEFAULT_UNROLL_M 2
  368. #define CGEMM_DEFAULT_UNROLL_M 4
  369. #define ZGEMM_DEFAULT_UNROLL_M 2
  370. #define XGEMM_DEFAULT_UNROLL_M 1
  371. #define CGEMM3M_DEFAULT_UNROLL_N 4
  372. #define CGEMM3M_DEFAULT_UNROLL_M 8
  373. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  374. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  375. #define GEMV_UNROLL 8
  376. #endif
  377. #if defined(ARCH_X86_64)
  378. #define SGEMM_DEFAULT_P 768
  379. #define DGEMM_DEFAULT_P 576
  380. #define ZGEMM_DEFAULT_P 288
  381. #define CGEMM_DEFAULT_P 576
  382. #else
  383. #define SGEMM_DEFAULT_P 448
  384. #define DGEMM_DEFAULT_P 480
  385. #define ZGEMM_DEFAULT_P 112
  386. #define CGEMM_DEFAULT_P 224
  387. #endif
  388. #define QGEMM_DEFAULT_P 112
  389. #define XGEMM_DEFAULT_P 56
  390. #if defined(ARCH_X86_64)
  391. #define SGEMM_DEFAULT_Q 192
  392. #define DGEMM_DEFAULT_Q 160
  393. #define ZGEMM_DEFAULT_Q 160
  394. #define CGEMM_DEFAULT_Q 160
  395. #else
  396. #define SGEMM_DEFAULT_Q 224
  397. #define DGEMM_DEFAULT_Q 224
  398. #define ZGEMM_DEFAULT_Q 224
  399. #define CGEMM_DEFAULT_Q 224
  400. #endif
  401. #define QGEMM_DEFAULT_Q 224
  402. #define XGEMM_DEFAULT_Q 224
  403. #define CGEMM3M_DEFAULT_P 448
  404. #define ZGEMM3M_DEFAULT_P 224
  405. #define XGEMM3M_DEFAULT_P 112
  406. #define CGEMM3M_DEFAULT_Q 224
  407. #define ZGEMM3M_DEFAULT_Q 224
  408. #define XGEMM3M_DEFAULT_Q 224
  409. #define CGEMM3M_DEFAULT_R 12288
  410. #define ZGEMM3M_DEFAULT_R 12288
  411. #define XGEMM3M_DEFAULT_R 12288
  412. #define SGEMM_DEFAULT_R 12288
  413. #define QGEMM_DEFAULT_R qgemm_r
  414. #define DGEMM_DEFAULT_R 12288
  415. #define CGEMM_DEFAULT_R cgemm_r
  416. #define ZGEMM_DEFAULT_R zgemm_r
  417. #define XGEMM_DEFAULT_R xgemm_r
  418. #define SYMV_P 16
  419. #define HAVE_EXCLUSIVE_CACHE
  420. #define GEMM_THREAD gemm_thread_mn
  421. #endif
  422. #ifdef EXCAVATOR
  423. #define SNUMOPT 8
  424. #define DNUMOPT 4
  425. #define GEMM_DEFAULT_OFFSET_A 64
  426. #define GEMM_DEFAULT_OFFSET_B 832
  427. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  428. #define QGEMM_DEFAULT_UNROLL_N 2
  429. #define CGEMM_DEFAULT_UNROLL_N 2
  430. #define ZGEMM_DEFAULT_UNROLL_N 2
  431. #define XGEMM_DEFAULT_UNROLL_N 1
  432. #ifdef ARCH_X86
  433. #define SGEMM_DEFAULT_UNROLL_N 4
  434. #define DGEMM_DEFAULT_UNROLL_N 4
  435. #define SGEMM_DEFAULT_UNROLL_M 4
  436. #define DGEMM_DEFAULT_UNROLL_M 2
  437. #define QGEMM_DEFAULT_UNROLL_M 2
  438. #define CGEMM_DEFAULT_UNROLL_M 2
  439. #define ZGEMM_DEFAULT_UNROLL_M 1
  440. #define XGEMM_DEFAULT_UNROLL_M 1
  441. #else
  442. #define SGEMM_DEFAULT_UNROLL_N 2
  443. #define DGEMM_DEFAULT_UNROLL_N 2
  444. #define SGEMM_DEFAULT_UNROLL_M 16
  445. #define DGEMM_DEFAULT_UNROLL_M 8
  446. #define QGEMM_DEFAULT_UNROLL_M 2
  447. #define CGEMM_DEFAULT_UNROLL_M 4
  448. #define ZGEMM_DEFAULT_UNROLL_M 2
  449. #define XGEMM_DEFAULT_UNROLL_M 1
  450. #define CGEMM3M_DEFAULT_UNROLL_N 4
  451. #define CGEMM3M_DEFAULT_UNROLL_M 8
  452. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  453. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  454. #define GEMV_UNROLL 8
  455. #endif
  456. #if defined(ARCH_X86_64)
  457. #define SGEMM_DEFAULT_P 768
  458. #define DGEMM_DEFAULT_P 576
  459. #define ZGEMM_DEFAULT_P 288
  460. #define CGEMM_DEFAULT_P 576
  461. #else
  462. #define SGEMM_DEFAULT_P 448
  463. #define DGEMM_DEFAULT_P 480
  464. #define ZGEMM_DEFAULT_P 112
  465. #define CGEMM_DEFAULT_P 224
  466. #endif
  467. #define QGEMM_DEFAULT_P 112
  468. #define XGEMM_DEFAULT_P 56
  469. #if defined(ARCH_X86_64)
  470. #define SGEMM_DEFAULT_Q 192
  471. #define DGEMM_DEFAULT_Q 160
  472. #define ZGEMM_DEFAULT_Q 160
  473. #define CGEMM_DEFAULT_Q 160
  474. #else
  475. #define SGEMM_DEFAULT_Q 224
  476. #define DGEMM_DEFAULT_Q 224
  477. #define ZGEMM_DEFAULT_Q 224
  478. #define CGEMM_DEFAULT_Q 224
  479. #endif
  480. #define QGEMM_DEFAULT_Q 224
  481. #define XGEMM_DEFAULT_Q 224
  482. #define CGEMM3M_DEFAULT_P 448
  483. #define ZGEMM3M_DEFAULT_P 224
  484. #define XGEMM3M_DEFAULT_P 112
  485. #define CGEMM3M_DEFAULT_Q 224
  486. #define ZGEMM3M_DEFAULT_Q 224
  487. #define XGEMM3M_DEFAULT_Q 224
  488. #define CGEMM3M_DEFAULT_R 12288
  489. #define ZGEMM3M_DEFAULT_R 12288
  490. #define XGEMM3M_DEFAULT_R 12288
  491. #define SGEMM_DEFAULT_R 12288
  492. #define QGEMM_DEFAULT_R qgemm_r
  493. #define DGEMM_DEFAULT_R 12288
  494. #define CGEMM_DEFAULT_R cgemm_r
  495. #define ZGEMM_DEFAULT_R zgemm_r
  496. #define XGEMM_DEFAULT_R xgemm_r
  497. #define SYMV_P 16
  498. #define HAVE_EXCLUSIVE_CACHE
  499. #define GEMM_THREAD gemm_thread_mn
  500. #endif
  501. #ifdef ZEN
  502. #define SNUMOPT 16
  503. #define DNUMOPT 8
  504. #define GEMM_DEFAULT_OFFSET_A 0
  505. #define GEMM_DEFAULT_OFFSET_B 0
  506. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  507. #define SYMV_P 8
  508. #define SWITCH_RATIO 16
  509. #ifdef ARCH_X86
  510. #define SGEMM_DEFAULT_UNROLL_M 4
  511. #define DGEMM_DEFAULT_UNROLL_M 2
  512. #define QGEMM_DEFAULT_UNROLL_M 2
  513. #define CGEMM_DEFAULT_UNROLL_M 2
  514. #define ZGEMM_DEFAULT_UNROLL_M 1
  515. #define XGEMM_DEFAULT_UNROLL_M 1
  516. #define SGEMM_DEFAULT_UNROLL_N 4
  517. #define DGEMM_DEFAULT_UNROLL_N 4
  518. #define QGEMM_DEFAULT_UNROLL_N 2
  519. #define CGEMM_DEFAULT_UNROLL_N 2
  520. #define ZGEMM_DEFAULT_UNROLL_N 2
  521. #define XGEMM_DEFAULT_UNROLL_N 1
  522. #else
  523. #define SGEMM_DEFAULT_UNROLL_M 16
  524. #define DGEMM_DEFAULT_UNROLL_M 4
  525. #define QGEMM_DEFAULT_UNROLL_M 2
  526. #define CGEMM_DEFAULT_UNROLL_M 8
  527. #define ZGEMM_DEFAULT_UNROLL_M 4
  528. #define XGEMM_DEFAULT_UNROLL_M 1
  529. #define SGEMM_DEFAULT_UNROLL_N 4
  530. #define DGEMM_DEFAULT_UNROLL_N 8
  531. #define QGEMM_DEFAULT_UNROLL_N 2
  532. #define CGEMM_DEFAULT_UNROLL_N 2
  533. #define ZGEMM_DEFAULT_UNROLL_N 2
  534. #define XGEMM_DEFAULT_UNROLL_N 1
  535. #define SGEMM_DEFAULT_UNROLL_MN 32
  536. #define DGEMM_DEFAULT_UNROLL_MN 32
  537. #endif
  538. #ifdef ARCH_X86
  539. #define SGEMM_DEFAULT_P 512
  540. #define SGEMM_DEFAULT_R sgemm_r
  541. #define DGEMM_DEFAULT_P 512
  542. #define DGEMM_DEFAULT_R dgemm_r
  543. #define QGEMM_DEFAULT_P 504
  544. #define QGEMM_DEFAULT_R qgemm_r
  545. #define CGEMM_DEFAULT_P 128
  546. #define CGEMM_DEFAULT_R 1024
  547. #define ZGEMM_DEFAULT_P 512
  548. #define ZGEMM_DEFAULT_R zgemm_r
  549. #define XGEMM_DEFAULT_P 252
  550. #define XGEMM_DEFAULT_R xgemm_r
  551. #define SGEMM_DEFAULT_Q 256
  552. #define DGEMM_DEFAULT_Q 256
  553. #define QGEMM_DEFAULT_Q 128
  554. #define CGEMM_DEFAULT_Q 256
  555. #define ZGEMM_DEFAULT_Q 192
  556. #define XGEMM_DEFAULT_Q 128
  557. #else
  558. #define SGEMM_DEFAULT_P 768
  559. #define DGEMM_DEFAULT_P 512
  560. #define CGEMM_DEFAULT_P 384
  561. #define ZGEMM_DEFAULT_P 256
  562. #ifdef WINDOWS_ABI
  563. #define SGEMM_DEFAULT_Q 320
  564. #define DGEMM_DEFAULT_Q 128
  565. #else
  566. #define SGEMM_DEFAULT_Q 384
  567. #define DGEMM_DEFAULT_Q 256
  568. #endif
  569. #define CGEMM_DEFAULT_Q 192
  570. #define ZGEMM_DEFAULT_Q 128
  571. #define SGEMM_DEFAULT_R sgemm_r
  572. #define DGEMM_DEFAULT_R 13824
  573. #define CGEMM_DEFAULT_R cgemm_r
  574. #define ZGEMM_DEFAULT_R zgemm_r
  575. #define QGEMM_DEFAULT_Q 128
  576. #define QGEMM_DEFAULT_P 504
  577. #define QGEMM_DEFAULT_R qgemm_r
  578. #define XGEMM_DEFAULT_P 252
  579. #define XGEMM_DEFAULT_R xgemm_r
  580. #define XGEMM_DEFAULT_Q 128
  581. #define CGEMM3M_DEFAULT_UNROLL_N 8
  582. #define CGEMM3M_DEFAULT_UNROLL_M 4
  583. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  584. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  585. #define CGEMM3M_DEFAULT_P 448
  586. #define ZGEMM3M_DEFAULT_P 224
  587. #define XGEMM3M_DEFAULT_P 112
  588. #define CGEMM3M_DEFAULT_Q 224
  589. #define ZGEMM3M_DEFAULT_Q 224
  590. #define XGEMM3M_DEFAULT_Q 224
  591. #define CGEMM3M_DEFAULT_R 12288
  592. #define ZGEMM3M_DEFAULT_R 12288
  593. #define XGEMM3M_DEFAULT_R 12288
  594. #endif
  595. #endif
  596. #ifdef ATHLON
  597. #define SNUMOPT 4
  598. #define DNUMOPT 2
  599. #define GEMM_DEFAULT_OFFSET_A 0
  600. #define GEMM_DEFAULT_OFFSET_B 384
  601. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  602. #define SGEMM_DEFAULT_UNROLL_N 4
  603. #define DGEMM_DEFAULT_UNROLL_N 4
  604. #define QGEMM_DEFAULT_UNROLL_N 2
  605. #define CGEMM_DEFAULT_UNROLL_N 2
  606. #define ZGEMM_DEFAULT_UNROLL_N 2
  607. #define XGEMM_DEFAULT_UNROLL_N 1
  608. #define SGEMM_DEFAULT_UNROLL_M 2
  609. #define DGEMM_DEFAULT_UNROLL_M 1
  610. #define QGEMM_DEFAULT_UNROLL_M 2
  611. #define CGEMM_DEFAULT_UNROLL_M 1
  612. #define ZGEMM_DEFAULT_UNROLL_M 1
  613. #define XGEMM_DEFAULT_UNROLL_M 1
  614. #define SGEMM_DEFAULT_R sgemm_r
  615. #define DGEMM_DEFAULT_R dgemm_r
  616. #define QGEMM_DEFAULT_R qgemm_r
  617. #define CGEMM_DEFAULT_R cgemm_r
  618. #define ZGEMM_DEFAULT_R zgemm_r
  619. #define XGEMM_DEFAULT_R xgemm_r
  620. #define SGEMM_DEFAULT_P 208
  621. #define DGEMM_DEFAULT_P 104
  622. #define QGEMM_DEFAULT_P 56
  623. #define CGEMM_DEFAULT_P 104
  624. #define ZGEMM_DEFAULT_P 56
  625. #define XGEMM_DEFAULT_P 28
  626. #define SGEMM_DEFAULT_Q 208
  627. #define DGEMM_DEFAULT_Q 208
  628. #define QGEMM_DEFAULT_Q 208
  629. #define CGEMM_DEFAULT_Q 208
  630. #define ZGEMM_DEFAULT_Q 208
  631. #define XGEMM_DEFAULT_Q 208
  632. #define SYMV_P 16
  633. #define HAVE_EXCLUSIVE_CACHE
  634. #endif
  635. #ifdef VIAC3
  636. #define SNUMOPT 2
  637. #define DNUMOPT 1
  638. #define GEMM_DEFAULT_OFFSET_A 0
  639. #define GEMM_DEFAULT_OFFSET_B 256
  640. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  641. #define SGEMM_DEFAULT_UNROLL_N 4
  642. #define DGEMM_DEFAULT_UNROLL_N 4
  643. #define QGEMM_DEFAULT_UNROLL_N 2
  644. #define CGEMM_DEFAULT_UNROLL_N 2
  645. #define ZGEMM_DEFAULT_UNROLL_N 2
  646. #define XGEMM_DEFAULT_UNROLL_N 1
  647. #define SGEMM_DEFAULT_UNROLL_M 2
  648. #define DGEMM_DEFAULT_UNROLL_M 1
  649. #define QGEMM_DEFAULT_UNROLL_M 2
  650. #define CGEMM_DEFAULT_UNROLL_M 1
  651. #define ZGEMM_DEFAULT_UNROLL_M 1
  652. #define XGEMM_DEFAULT_UNROLL_M 1
  653. #define SGEMM_DEFAULT_R sgemm_r
  654. #define DGEMM_DEFAULT_R dgemm_r
  655. #define QGEMM_DEFAULT_R qgemm_r
  656. #define CGEMM_DEFAULT_R cgemm_r
  657. #define ZGEMM_DEFAULT_R zgemm_r
  658. #define XGEMM_DEFAULT_R xgemm_r
  659. #define SGEMM_DEFAULT_P 128
  660. #define DGEMM_DEFAULT_P 128
  661. #define QGEMM_DEFAULT_P 128
  662. #define CGEMM_DEFAULT_P 128
  663. #define ZGEMM_DEFAULT_P 128
  664. #define XGEMM_DEFAULT_P 128
  665. #define SGEMM_DEFAULT_Q 512
  666. #define DGEMM_DEFAULT_Q 256
  667. #define QGEMM_DEFAULT_Q 256
  668. #define CGEMM_DEFAULT_Q 256
  669. #define ZGEMM_DEFAULT_Q 128
  670. #define XGEMM_DEFAULT_Q 128
  671. #define SYMV_P 16
  672. #endif
  673. #ifdef NANO
  674. #define SNUMOPT 4
  675. #define DNUMOPT 2
  676. #define GEMM_DEFAULT_OFFSET_A 64
  677. #define GEMM_DEFAULT_OFFSET_B 256
  678. #define GEMM_DEFAULT_ALIGN 0x01ffffUL
  679. #ifdef ARCH_X86
  680. #define SGEMM_DEFAULT_UNROLL_N 4
  681. #define DGEMM_DEFAULT_UNROLL_N 4
  682. #define QGEMM_DEFAULT_UNROLL_N 2
  683. #define CGEMM_DEFAULT_UNROLL_N 2
  684. #define ZGEMM_DEFAULT_UNROLL_N 2
  685. #define XGEMM_DEFAULT_UNROLL_N 1
  686. #define SGEMM_DEFAULT_UNROLL_M 4
  687. #define DGEMM_DEFAULT_UNROLL_M 2
  688. #define QGEMM_DEFAULT_UNROLL_M 2
  689. #define CGEMM_DEFAULT_UNROLL_M 2
  690. #define ZGEMM_DEFAULT_UNROLL_M 1
  691. #define XGEMM_DEFAULT_UNROLL_M 1
  692. #else
  693. #define SGEMM_DEFAULT_UNROLL_N 8
  694. #define DGEMM_DEFAULT_UNROLL_N 4
  695. #define QGEMM_DEFAULT_UNROLL_N 2
  696. #define CGEMM_DEFAULT_UNROLL_N 4
  697. #define ZGEMM_DEFAULT_UNROLL_N 2
  698. #define XGEMM_DEFAULT_UNROLL_N 1
  699. #define SGEMM_DEFAULT_UNROLL_M 4
  700. #define DGEMM_DEFAULT_UNROLL_M 4
  701. #define QGEMM_DEFAULT_UNROLL_M 2
  702. #define CGEMM_DEFAULT_UNROLL_M 2
  703. #define ZGEMM_DEFAULT_UNROLL_M 2
  704. #define XGEMM_DEFAULT_UNROLL_M 1
  705. #endif
  706. #define SGEMM_DEFAULT_P 288
  707. #define DGEMM_DEFAULT_P 288
  708. #define QGEMM_DEFAULT_P 288
  709. #define CGEMM_DEFAULT_P 288
  710. #define ZGEMM_DEFAULT_P 288
  711. #define XGEMM_DEFAULT_P 288
  712. #define SGEMM_DEFAULT_R sgemm_r
  713. #define DGEMM_DEFAULT_R dgemm_r
  714. #define QGEMM_DEFAULT_R qgemm_r
  715. #define CGEMM_DEFAULT_R cgemm_r
  716. #define ZGEMM_DEFAULT_R zgemm_r
  717. #define XGEMM_DEFAULT_R xgemm_r
  718. #define SGEMM_DEFAULT_Q 256
  719. #define DGEMM_DEFAULT_Q 128
  720. #define QGEMM_DEFAULT_Q 64
  721. #define CGEMM_DEFAULT_Q 128
  722. #define ZGEMM_DEFAULT_Q 64
  723. #define XGEMM_DEFAULT_Q 32
  724. #define SYMV_P 16
  725. #define HAVE_EXCLUSIVE_CACHE
  726. #endif
  727. #if defined(PENTIUM) || defined(PENTIUM2) || defined(PENTIUM3)
  728. #ifdef HAVE_SSE
  729. #define SNUMOPT 2
  730. #else
  731. #define SNUMOPT 1
  732. #endif
  733. #define DNUMOPT 1
  734. #define GEMM_DEFAULT_OFFSET_A 0
  735. #define GEMM_DEFAULT_OFFSET_B 0
  736. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  737. #ifdef HAVE_SSE
  738. #define SGEMM_DEFAULT_UNROLL_M 8
  739. #define CGEMM_DEFAULT_UNROLL_M 4
  740. #else
  741. #define SGEMM_DEFAULT_UNROLL_M 4
  742. #define CGEMM_DEFAULT_UNROLL_M 2
  743. #endif
  744. #define DGEMM_DEFAULT_UNROLL_M 2
  745. #define SGEMM_DEFAULT_UNROLL_N 2
  746. #define DGEMM_DEFAULT_UNROLL_N 2
  747. #define QGEMM_DEFAULT_UNROLL_M 2
  748. #define QGEMM_DEFAULT_UNROLL_N 2
  749. #define CGEMM_DEFAULT_UNROLL_N 1
  750. #define ZGEMM_DEFAULT_UNROLL_M 1
  751. #define ZGEMM_DEFAULT_UNROLL_N 1
  752. #define XGEMM_DEFAULT_UNROLL_M 1
  753. #define XGEMM_DEFAULT_UNROLL_N 1
  754. #define SGEMM_DEFAULT_P sgemm_p
  755. #define SGEMM_DEFAULT_Q 256
  756. #define SGEMM_DEFAULT_R sgemm_r
  757. #define DGEMM_DEFAULT_P dgemm_p
  758. #define DGEMM_DEFAULT_Q 256
  759. #define DGEMM_DEFAULT_R dgemm_r
  760. #define QGEMM_DEFAULT_P qgemm_p
  761. #define QGEMM_DEFAULT_Q 256
  762. #define QGEMM_DEFAULT_R qgemm_r
  763. #define CGEMM_DEFAULT_P cgemm_p
  764. #define CGEMM_DEFAULT_Q 256
  765. #define CGEMM_DEFAULT_R cgemm_r
  766. #define ZGEMM_DEFAULT_P zgemm_p
  767. #define ZGEMM_DEFAULT_Q 256
  768. #define ZGEMM_DEFAULT_R zgemm_r
  769. #define XGEMM_DEFAULT_P xgemm_p
  770. #define XGEMM_DEFAULT_Q 256
  771. #define XGEMM_DEFAULT_R xgemm_r
  772. #define SYMV_P 4
  773. #endif
  774. #ifdef PENTIUMM
  775. #define SNUMOPT 2
  776. #define DNUMOPT 1
  777. #define GEMM_DEFAULT_OFFSET_A 0
  778. #define GEMM_DEFAULT_OFFSET_B 0
  779. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  780. #ifdef CORE_YONAH
  781. #define SGEMM_DEFAULT_UNROLL_M 4
  782. #define SGEMM_DEFAULT_UNROLL_N 4
  783. #define DGEMM_DEFAULT_UNROLL_M 2
  784. #define DGEMM_DEFAULT_UNROLL_N 4
  785. #define QGEMM_DEFAULT_UNROLL_M 2
  786. #define QGEMM_DEFAULT_UNROLL_N 2
  787. #define CGEMM_DEFAULT_UNROLL_M 2
  788. #define CGEMM_DEFAULT_UNROLL_N 2
  789. #define ZGEMM_DEFAULT_UNROLL_M 1
  790. #define ZGEMM_DEFAULT_UNROLL_N 2
  791. #define XGEMM_DEFAULT_UNROLL_M 1
  792. #define XGEMM_DEFAULT_UNROLL_N 1
  793. #else
  794. #define SGEMM_DEFAULT_UNROLL_M 8
  795. #define SGEMM_DEFAULT_UNROLL_N 2
  796. #define DGEMM_DEFAULT_UNROLL_M 2
  797. #define DGEMM_DEFAULT_UNROLL_N 2
  798. #define QGEMM_DEFAULT_UNROLL_M 2
  799. #define QGEMM_DEFAULT_UNROLL_N 2
  800. #define CGEMM_DEFAULT_UNROLL_M 4
  801. #define CGEMM_DEFAULT_UNROLL_N 1
  802. #define ZGEMM_DEFAULT_UNROLL_M 1
  803. #define ZGEMM_DEFAULT_UNROLL_N 1
  804. #define XGEMM_DEFAULT_UNROLL_M 1
  805. #define XGEMM_DEFAULT_UNROLL_N 1
  806. #endif
  807. #define SGEMM_DEFAULT_P sgemm_p
  808. #define SGEMM_DEFAULT_Q 256
  809. #define SGEMM_DEFAULT_R sgemm_r
  810. #define DGEMM_DEFAULT_P dgemm_p
  811. #define DGEMM_DEFAULT_Q 256
  812. #define DGEMM_DEFAULT_R dgemm_r
  813. #define QGEMM_DEFAULT_P qgemm_p
  814. #define QGEMM_DEFAULT_Q 256
  815. #define QGEMM_DEFAULT_R qgemm_r
  816. #define CGEMM_DEFAULT_P cgemm_p
  817. #define CGEMM_DEFAULT_Q 256
  818. #define CGEMM_DEFAULT_R cgemm_r
  819. #define ZGEMM_DEFAULT_P zgemm_p
  820. #define ZGEMM_DEFAULT_Q 256
  821. #define ZGEMM_DEFAULT_R zgemm_r
  822. #define XGEMM_DEFAULT_P xgemm_p
  823. #define XGEMM_DEFAULT_Q 256
  824. #define XGEMM_DEFAULT_R xgemm_r
  825. #define SYMV_P 4
  826. #endif
  827. #ifdef CORE_NORTHWOOD
  828. #define SNUMOPT 4
  829. #define DNUMOPT 2
  830. #define GEMM_DEFAULT_OFFSET_A 0
  831. #define GEMM_DEFAULT_OFFSET_B 32
  832. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  833. #define SYMV_P 8
  834. #define SGEMM_DEFAULT_UNROLL_M 8
  835. #define DGEMM_DEFAULT_UNROLL_M 4
  836. #define QGEMM_DEFAULT_UNROLL_M 2
  837. #define CGEMM_DEFAULT_UNROLL_M 4
  838. #define ZGEMM_DEFAULT_UNROLL_M 2
  839. #define XGEMM_DEFAULT_UNROLL_M 1
  840. #define SGEMM_DEFAULT_UNROLL_N 2
  841. #define DGEMM_DEFAULT_UNROLL_N 2
  842. #define QGEMM_DEFAULT_UNROLL_N 2
  843. #define CGEMM_DEFAULT_UNROLL_N 1
  844. #define ZGEMM_DEFAULT_UNROLL_N 1
  845. #define XGEMM_DEFAULT_UNROLL_N 1
  846. #define SGEMM_DEFAULT_P sgemm_p
  847. #define SGEMM_DEFAULT_R sgemm_r
  848. #define DGEMM_DEFAULT_P dgemm_p
  849. #define DGEMM_DEFAULT_R dgemm_r
  850. #define QGEMM_DEFAULT_P qgemm_p
  851. #define QGEMM_DEFAULT_R qgemm_r
  852. #define CGEMM_DEFAULT_P cgemm_p
  853. #define CGEMM_DEFAULT_R cgemm_r
  854. #define ZGEMM_DEFAULT_P zgemm_p
  855. #define ZGEMM_DEFAULT_R zgemm_r
  856. #define XGEMM_DEFAULT_P xgemm_p
  857. #define XGEMM_DEFAULT_R xgemm_r
  858. #define SGEMM_DEFAULT_Q 128
  859. #define DGEMM_DEFAULT_Q 128
  860. #define QGEMM_DEFAULT_Q 128
  861. #define CGEMM_DEFAULT_Q 128
  862. #define ZGEMM_DEFAULT_Q 128
  863. #define XGEMM_DEFAULT_Q 128
  864. #endif
  865. #ifdef CORE_PRESCOTT
  866. #define SNUMOPT 4
  867. #define DNUMOPT 2
  868. #ifndef __64BIT__
  869. #define GEMM_DEFAULT_OFFSET_A 128
  870. #define GEMM_DEFAULT_OFFSET_B 192
  871. #else
  872. #define GEMM_DEFAULT_OFFSET_A 0
  873. #define GEMM_DEFAULT_OFFSET_B 256
  874. #endif
  875. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  876. #define SYMV_P 8
  877. #ifdef ARCH_X86
  878. #define SGEMM_DEFAULT_UNROLL_M 4
  879. #define DGEMM_DEFAULT_UNROLL_M 2
  880. #define QGEMM_DEFAULT_UNROLL_M 2
  881. #define CGEMM_DEFAULT_UNROLL_M 2
  882. #define ZGEMM_DEFAULT_UNROLL_M 1
  883. #define XGEMM_DEFAULT_UNROLL_M 1
  884. #else
  885. #define SGEMM_DEFAULT_UNROLL_M 8
  886. #define DGEMM_DEFAULT_UNROLL_M 4
  887. #define QGEMM_DEFAULT_UNROLL_M 2
  888. #define CGEMM_DEFAULT_UNROLL_M 4
  889. #define ZGEMM_DEFAULT_UNROLL_M 2
  890. #define XGEMM_DEFAULT_UNROLL_M 1
  891. #endif
  892. #define SGEMM_DEFAULT_UNROLL_N 4
  893. #define DGEMM_DEFAULT_UNROLL_N 4
  894. #define QGEMM_DEFAULT_UNROLL_N 2
  895. #define CGEMM_DEFAULT_UNROLL_N 2
  896. #define ZGEMM_DEFAULT_UNROLL_N 2
  897. #define XGEMM_DEFAULT_UNROLL_N 1
  898. #define SGEMM_DEFAULT_P sgemm_p
  899. #define SGEMM_DEFAULT_R sgemm_r
  900. #define DGEMM_DEFAULT_P dgemm_p
  901. #define DGEMM_DEFAULT_R dgemm_r
  902. #define QGEMM_DEFAULT_P qgemm_p
  903. #define QGEMM_DEFAULT_R qgemm_r
  904. #define CGEMM_DEFAULT_P cgemm_p
  905. #define CGEMM_DEFAULT_R cgemm_r
  906. #define ZGEMM_DEFAULT_P zgemm_p
  907. #define ZGEMM_DEFAULT_R zgemm_r
  908. #define XGEMM_DEFAULT_P xgemm_p
  909. #define XGEMM_DEFAULT_R xgemm_r
  910. #define SGEMM_DEFAULT_Q 128
  911. #define DGEMM_DEFAULT_Q 128
  912. #define QGEMM_DEFAULT_Q 128
  913. #define CGEMM_DEFAULT_Q 128
  914. #define ZGEMM_DEFAULT_Q 128
  915. #define XGEMM_DEFAULT_Q 128
  916. #endif
  917. #ifdef CORE2
  918. #define SNUMOPT 8
  919. #define DNUMOPT 4
  920. #define GEMM_DEFAULT_OFFSET_A 448
  921. #define GEMM_DEFAULT_OFFSET_B 128
  922. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  923. #define SYMV_P 8
  924. #define SWITCH_RATIO 4
  925. #ifdef ARCH_X86
  926. #define SGEMM_DEFAULT_UNROLL_M 8
  927. #define DGEMM_DEFAULT_UNROLL_M 4
  928. #define QGEMM_DEFAULT_UNROLL_M 2
  929. #define CGEMM_DEFAULT_UNROLL_M 4
  930. #define ZGEMM_DEFAULT_UNROLL_M 2
  931. #define XGEMM_DEFAULT_UNROLL_M 1
  932. #define SGEMM_DEFAULT_UNROLL_N 2
  933. #define DGEMM_DEFAULT_UNROLL_N 2
  934. #define QGEMM_DEFAULT_UNROLL_N 2
  935. #define CGEMM_DEFAULT_UNROLL_N 1
  936. #define ZGEMM_DEFAULT_UNROLL_N 1
  937. #define XGEMM_DEFAULT_UNROLL_N 1
  938. #define MASK(a, b) ((((a) + (b) - 1) / (b)) * (b))
  939. #else
  940. #define SGEMM_DEFAULT_UNROLL_M 8
  941. #define DGEMM_DEFAULT_UNROLL_M 4
  942. #define QGEMM_DEFAULT_UNROLL_M 2
  943. #define CGEMM_DEFAULT_UNROLL_M 4
  944. #define ZGEMM_DEFAULT_UNROLL_M 2
  945. #define XGEMM_DEFAULT_UNROLL_M 1
  946. #define SGEMM_DEFAULT_UNROLL_N 4
  947. #define DGEMM_DEFAULT_UNROLL_N 4
  948. #define QGEMM_DEFAULT_UNROLL_N 2
  949. #define CGEMM_DEFAULT_UNROLL_N 2
  950. #define ZGEMM_DEFAULT_UNROLL_N 2
  951. #define XGEMM_DEFAULT_UNROLL_N 1
  952. #endif
  953. #define SGEMM_DEFAULT_P sgemm_p
  954. #define SGEMM_DEFAULT_R sgemm_r
  955. #define DGEMM_DEFAULT_P dgemm_p
  956. #define DGEMM_DEFAULT_R dgemm_r
  957. #define QGEMM_DEFAULT_P qgemm_p
  958. #define QGEMM_DEFAULT_R qgemm_r
  959. #define CGEMM_DEFAULT_P cgemm_p
  960. #define CGEMM_DEFAULT_R cgemm_r
  961. #define ZGEMM_DEFAULT_P zgemm_p
  962. #define ZGEMM_DEFAULT_R zgemm_r
  963. #define XGEMM_DEFAULT_P xgemm_p
  964. #define XGEMM_DEFAULT_R xgemm_r
  965. #define SGEMM_DEFAULT_Q 256
  966. #define DGEMM_DEFAULT_Q 256
  967. #define QGEMM_DEFAULT_Q 256
  968. #define CGEMM_DEFAULT_Q 256
  969. #define ZGEMM_DEFAULT_Q 256
  970. #define XGEMM_DEFAULT_Q 256
  971. #endif
  972. #ifdef PENRYN
  973. #define SNUMOPT 8
  974. #define DNUMOPT 4
  975. #define GEMM_DEFAULT_OFFSET_A 128
  976. #define GEMM_DEFAULT_OFFSET_B 0
  977. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  978. #define SYMV_P 8
  979. #define SWITCH_RATIO 4
  980. #ifdef ARCH_X86
  981. #define SGEMM_DEFAULT_UNROLL_M 4
  982. #define DGEMM_DEFAULT_UNROLL_M 2
  983. #define QGEMM_DEFAULT_UNROLL_M 2
  984. #define CGEMM_DEFAULT_UNROLL_M 2
  985. #define ZGEMM_DEFAULT_UNROLL_M 1
  986. #define XGEMM_DEFAULT_UNROLL_M 1
  987. #define SGEMM_DEFAULT_UNROLL_N 4
  988. #define DGEMM_DEFAULT_UNROLL_N 4
  989. #define QGEMM_DEFAULT_UNROLL_N 2
  990. #define CGEMM_DEFAULT_UNROLL_N 2
  991. #define ZGEMM_DEFAULT_UNROLL_N 2
  992. #define XGEMM_DEFAULT_UNROLL_N 1
  993. #else
  994. #define SGEMM_DEFAULT_UNROLL_M 8
  995. #define DGEMM_DEFAULT_UNROLL_M 4
  996. #define QGEMM_DEFAULT_UNROLL_M 2
  997. #define CGEMM_DEFAULT_UNROLL_M 4
  998. #define ZGEMM_DEFAULT_UNROLL_M 2
  999. #define XGEMM_DEFAULT_UNROLL_M 1
  1000. #define SGEMM_DEFAULT_UNROLL_N 4
  1001. #define DGEMM_DEFAULT_UNROLL_N 4
  1002. #define QGEMM_DEFAULT_UNROLL_N 2
  1003. #define CGEMM_DEFAULT_UNROLL_N 2
  1004. #define ZGEMM_DEFAULT_UNROLL_N 2
  1005. #define XGEMM_DEFAULT_UNROLL_N 1
  1006. #endif
  1007. #define SGEMM_DEFAULT_P sgemm_p
  1008. #define SGEMM_DEFAULT_R sgemm_r
  1009. #define DGEMM_DEFAULT_P dgemm_p
  1010. #define DGEMM_DEFAULT_R dgemm_r
  1011. #define QGEMM_DEFAULT_P qgemm_p
  1012. #define QGEMM_DEFAULT_R qgemm_r
  1013. #define CGEMM_DEFAULT_P cgemm_p
  1014. #define CGEMM_DEFAULT_R cgemm_r
  1015. #define ZGEMM_DEFAULT_P zgemm_p
  1016. #define ZGEMM_DEFAULT_R zgemm_r
  1017. #define XGEMM_DEFAULT_P xgemm_p
  1018. #define XGEMM_DEFAULT_R xgemm_r
  1019. #define SGEMM_DEFAULT_Q 512
  1020. #define DGEMM_DEFAULT_Q 256
  1021. #define QGEMM_DEFAULT_Q 128
  1022. #define CGEMM_DEFAULT_Q 512
  1023. #define ZGEMM_DEFAULT_Q 256
  1024. #define XGEMM_DEFAULT_Q 128
  1025. #define GETRF_FACTOR 0.75
  1026. #endif
  1027. #ifdef DUNNINGTON
  1028. #define SNUMOPT 8
  1029. #define DNUMOPT 4
  1030. #define GEMM_DEFAULT_OFFSET_A 128
  1031. #define GEMM_DEFAULT_OFFSET_B 0
  1032. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1033. #define SYMV_P 8
  1034. #define SWITCH_RATIO 4
  1035. #ifdef ARCH_X86
  1036. #define SGEMM_DEFAULT_UNROLL_M 4
  1037. #define DGEMM_DEFAULT_UNROLL_M 2
  1038. #define QGEMM_DEFAULT_UNROLL_M 2
  1039. #define CGEMM_DEFAULT_UNROLL_M 2
  1040. #define ZGEMM_DEFAULT_UNROLL_M 1
  1041. #define XGEMM_DEFAULT_UNROLL_M 1
  1042. #define SGEMM_DEFAULT_UNROLL_N 4
  1043. #define DGEMM_DEFAULT_UNROLL_N 4
  1044. #define QGEMM_DEFAULT_UNROLL_N 2
  1045. #define CGEMM_DEFAULT_UNROLL_N 2
  1046. #define ZGEMM_DEFAULT_UNROLL_N 2
  1047. #define XGEMM_DEFAULT_UNROLL_N 1
  1048. #else
  1049. #define SGEMM_DEFAULT_UNROLL_M 8
  1050. #define DGEMM_DEFAULT_UNROLL_M 4
  1051. #define QGEMM_DEFAULT_UNROLL_M 2
  1052. #define CGEMM_DEFAULT_UNROLL_M 4
  1053. #define ZGEMM_DEFAULT_UNROLL_M 2
  1054. #define XGEMM_DEFAULT_UNROLL_M 1
  1055. #define SGEMM_DEFAULT_UNROLL_N 4
  1056. #define DGEMM_DEFAULT_UNROLL_N 4
  1057. #define QGEMM_DEFAULT_UNROLL_N 2
  1058. #define CGEMM_DEFAULT_UNROLL_N 2
  1059. #define ZGEMM_DEFAULT_UNROLL_N 2
  1060. #define XGEMM_DEFAULT_UNROLL_N 1
  1061. #endif
  1062. #define SGEMM_DEFAULT_P sgemm_p
  1063. #define SGEMM_DEFAULT_R sgemm_r
  1064. #define DGEMM_DEFAULT_P dgemm_p
  1065. #define DGEMM_DEFAULT_R dgemm_r
  1066. #define QGEMM_DEFAULT_P qgemm_p
  1067. #define QGEMM_DEFAULT_R qgemm_r
  1068. #define CGEMM_DEFAULT_P cgemm_p
  1069. #define CGEMM_DEFAULT_R cgemm_r
  1070. #define ZGEMM_DEFAULT_P zgemm_p
  1071. #define ZGEMM_DEFAULT_R zgemm_r
  1072. #define XGEMM_DEFAULT_P xgemm_p
  1073. #define XGEMM_DEFAULT_R xgemm_r
  1074. #define SGEMM_DEFAULT_Q 768
  1075. #define DGEMM_DEFAULT_Q 384
  1076. #define QGEMM_DEFAULT_Q 192
  1077. #define CGEMM_DEFAULT_Q 768
  1078. #define ZGEMM_DEFAULT_Q 384
  1079. #define XGEMM_DEFAULT_Q 192
  1080. #define GETRF_FACTOR 0.75
  1081. #define GEMM_THREAD gemm_thread_mn
  1082. #endif
  1083. #ifdef NEHALEM
  1084. #define SNUMOPT 8
  1085. #define DNUMOPT 4
  1086. #define GEMM_DEFAULT_OFFSET_A 32
  1087. #define GEMM_DEFAULT_OFFSET_B 0
  1088. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1089. #define SYMV_P 8
  1090. #define SWITCH_RATIO 4
  1091. #ifdef ARCH_X86
  1092. #define SGEMM_DEFAULT_UNROLL_M 4
  1093. #define DGEMM_DEFAULT_UNROLL_M 2
  1094. #define QGEMM_DEFAULT_UNROLL_M 2
  1095. #define CGEMM_DEFAULT_UNROLL_M 2
  1096. #define ZGEMM_DEFAULT_UNROLL_M 1
  1097. #define XGEMM_DEFAULT_UNROLL_M 1
  1098. #define SGEMM_DEFAULT_UNROLL_N 4
  1099. #define DGEMM_DEFAULT_UNROLL_N 4
  1100. #define QGEMM_DEFAULT_UNROLL_N 2
  1101. #define CGEMM_DEFAULT_UNROLL_N 2
  1102. #define ZGEMM_DEFAULT_UNROLL_N 2
  1103. #define XGEMM_DEFAULT_UNROLL_N 1
  1104. #else
  1105. #define SGEMM_DEFAULT_UNROLL_M 4
  1106. #define DGEMM_DEFAULT_UNROLL_M 2
  1107. #define QGEMM_DEFAULT_UNROLL_M 2
  1108. #define CGEMM_DEFAULT_UNROLL_M 2
  1109. #define ZGEMM_DEFAULT_UNROLL_M 1
  1110. #define XGEMM_DEFAULT_UNROLL_M 1
  1111. #define SGEMM_DEFAULT_UNROLL_N 8
  1112. #define DGEMM_DEFAULT_UNROLL_N 8
  1113. #define QGEMM_DEFAULT_UNROLL_N 2
  1114. #define CGEMM_DEFAULT_UNROLL_N 4
  1115. #define ZGEMM_DEFAULT_UNROLL_N 4
  1116. #define XGEMM_DEFAULT_UNROLL_N 1
  1117. #endif
  1118. #define SGEMM_DEFAULT_P 504
  1119. #define SGEMM_DEFAULT_R sgemm_r
  1120. #define DGEMM_DEFAULT_P 504
  1121. #define DGEMM_DEFAULT_R dgemm_r
  1122. #define QGEMM_DEFAULT_P 504
  1123. #define QGEMM_DEFAULT_R qgemm_r
  1124. #define CGEMM_DEFAULT_P 252
  1125. #define CGEMM_DEFAULT_R cgemm_r
  1126. #define ZGEMM_DEFAULT_P 252
  1127. #define ZGEMM_DEFAULT_R zgemm_r
  1128. #define XGEMM_DEFAULT_P 252
  1129. #define XGEMM_DEFAULT_R xgemm_r
  1130. #define SGEMM_DEFAULT_Q 512
  1131. #define DGEMM_DEFAULT_Q 256
  1132. #define QGEMM_DEFAULT_Q 128
  1133. #define CGEMM_DEFAULT_Q 512
  1134. #define ZGEMM_DEFAULT_Q 256
  1135. #define XGEMM_DEFAULT_Q 128
  1136. #define GETRF_FACTOR 0.72
  1137. #endif
  1138. #ifdef SANDYBRIDGE
  1139. #define SNUMOPT 8
  1140. #define DNUMOPT 4
  1141. #define GEMM_DEFAULT_OFFSET_A 0
  1142. #define GEMM_DEFAULT_OFFSET_B 0
  1143. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1144. #define SYMV_P 8
  1145. #define SWITCH_RATIO 4
  1146. #ifdef ARCH_X86
  1147. #define SGEMM_DEFAULT_UNROLL_M 4
  1148. #define DGEMM_DEFAULT_UNROLL_M 2
  1149. #define QGEMM_DEFAULT_UNROLL_M 2
  1150. #define CGEMM_DEFAULT_UNROLL_M 2
  1151. #define ZGEMM_DEFAULT_UNROLL_M 1
  1152. #define XGEMM_DEFAULT_UNROLL_M 1
  1153. #define SGEMM_DEFAULT_UNROLL_N 4
  1154. #define DGEMM_DEFAULT_UNROLL_N 4
  1155. #define QGEMM_DEFAULT_UNROLL_N 2
  1156. #define CGEMM_DEFAULT_UNROLL_N 2
  1157. #define ZGEMM_DEFAULT_UNROLL_N 2
  1158. #define XGEMM_DEFAULT_UNROLL_N 1
  1159. #else
  1160. #define SGEMM_DEFAULT_UNROLL_M 16
  1161. #define DGEMM_DEFAULT_UNROLL_M 8
  1162. #define QGEMM_DEFAULT_UNROLL_M 2
  1163. #define CGEMM_DEFAULT_UNROLL_M 8
  1164. #define ZGEMM_DEFAULT_UNROLL_M 1
  1165. #define XGEMM_DEFAULT_UNROLL_M 1
  1166. #define SGEMM_DEFAULT_UNROLL_N 4
  1167. #define DGEMM_DEFAULT_UNROLL_N 4
  1168. #define QGEMM_DEFAULT_UNROLL_N 2
  1169. #define CGEMM_DEFAULT_UNROLL_N 2
  1170. #define ZGEMM_DEFAULT_UNROLL_N 4
  1171. #define XGEMM_DEFAULT_UNROLL_N 1
  1172. #endif
  1173. #define SGEMM_DEFAULT_P 768
  1174. #define SGEMM_DEFAULT_R sgemm_r
  1175. //#define SGEMM_DEFAULT_R 1024
  1176. #define DGEMM_DEFAULT_P 512
  1177. #define DGEMM_DEFAULT_R dgemm_r
  1178. //#define DGEMM_DEFAULT_R 1024
  1179. #define QGEMM_DEFAULT_P 504
  1180. #define QGEMM_DEFAULT_R qgemm_r
  1181. #define CGEMM_DEFAULT_P 768
  1182. #define CGEMM_DEFAULT_R cgemm_r
  1183. //#define CGEMM_DEFAULT_R 1024
  1184. #define ZGEMM_DEFAULT_P 512
  1185. #define ZGEMM_DEFAULT_R zgemm_r
  1186. //#define ZGEMM_DEFAULT_R 1024
  1187. #define XGEMM_DEFAULT_P 252
  1188. #define XGEMM_DEFAULT_R xgemm_r
  1189. #define SGEMM_DEFAULT_Q 384
  1190. #define DGEMM_DEFAULT_Q 256
  1191. #define QGEMM_DEFAULT_Q 128
  1192. #define CGEMM_DEFAULT_Q 512
  1193. #define ZGEMM_DEFAULT_Q 192
  1194. #define XGEMM_DEFAULT_Q 128
  1195. #define CGEMM3M_DEFAULT_UNROLL_N 8
  1196. #define CGEMM3M_DEFAULT_UNROLL_M 4
  1197. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  1198. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  1199. #define CGEMM3M_DEFAULT_P 448
  1200. #define ZGEMM3M_DEFAULT_P 224
  1201. #define XGEMM3M_DEFAULT_P 112
  1202. #define CGEMM3M_DEFAULT_Q 224
  1203. #define ZGEMM3M_DEFAULT_Q 224
  1204. #define XGEMM3M_DEFAULT_Q 224
  1205. #define CGEMM3M_DEFAULT_R 12288
  1206. #define ZGEMM3M_DEFAULT_R 12288
  1207. #define XGEMM3M_DEFAULT_R 12288
  1208. #define GETRF_FACTOR 0.72
  1209. #endif
  1210. #ifdef HASWELL
  1211. #define SNUMOPT 16
  1212. #define DNUMOPT 8
  1213. #define GEMM_DEFAULT_OFFSET_A 0
  1214. #define GEMM_DEFAULT_OFFSET_B 0
  1215. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1216. #define SYMV_P 8
  1217. #define SWITCH_RATIO 32
  1218. #define GEMM_PREFERED_SIZE 16
  1219. #ifdef ARCH_X86
  1220. #define SGEMM_DEFAULT_UNROLL_M 4
  1221. #define DGEMM_DEFAULT_UNROLL_M 2
  1222. #define QGEMM_DEFAULT_UNROLL_M 2
  1223. #define CGEMM_DEFAULT_UNROLL_M 2
  1224. #define ZGEMM_DEFAULT_UNROLL_M 1
  1225. #define XGEMM_DEFAULT_UNROLL_M 1
  1226. #define SGEMM_DEFAULT_UNROLL_N 4
  1227. #define DGEMM_DEFAULT_UNROLL_N 4
  1228. #define QGEMM_DEFAULT_UNROLL_N 2
  1229. #define CGEMM_DEFAULT_UNROLL_N 2
  1230. #define ZGEMM_DEFAULT_UNROLL_N 2
  1231. #define XGEMM_DEFAULT_UNROLL_N 1
  1232. #else
  1233. #define SGEMM_DEFAULT_UNROLL_M 16
  1234. #define DGEMM_DEFAULT_UNROLL_M 4
  1235. #define QGEMM_DEFAULT_UNROLL_M 2
  1236. #define CGEMM_DEFAULT_UNROLL_M 8
  1237. #define ZGEMM_DEFAULT_UNROLL_M 4
  1238. #define XGEMM_DEFAULT_UNROLL_M 1
  1239. #define SGEMM_DEFAULT_UNROLL_N 4
  1240. #define DGEMM_DEFAULT_UNROLL_N 8
  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. #define SGEMM_DEFAULT_UNROLL_MN 32
  1246. #define DGEMM_DEFAULT_UNROLL_MN 32
  1247. #endif
  1248. #ifdef ARCH_X86
  1249. #define SGEMM_DEFAULT_P 512
  1250. #define SGEMM_DEFAULT_R sgemm_r
  1251. #define DGEMM_DEFAULT_P 512
  1252. #define DGEMM_DEFAULT_R dgemm_r
  1253. #define QGEMM_DEFAULT_P 504
  1254. #define QGEMM_DEFAULT_R qgemm_r
  1255. #define CGEMM_DEFAULT_P 128
  1256. #define CGEMM_DEFAULT_R 1024
  1257. #define ZGEMM_DEFAULT_P 512
  1258. #define ZGEMM_DEFAULT_R zgemm_r
  1259. #define XGEMM_DEFAULT_P 252
  1260. #define XGEMM_DEFAULT_R xgemm_r
  1261. #define SGEMM_DEFAULT_Q 256
  1262. #define DGEMM_DEFAULT_Q 256
  1263. #define QGEMM_DEFAULT_Q 128
  1264. #define CGEMM_DEFAULT_Q 256
  1265. #define ZGEMM_DEFAULT_Q 192
  1266. #define XGEMM_DEFAULT_Q 128
  1267. #else
  1268. #define SGEMM_DEFAULT_P 768
  1269. #define DGEMM_DEFAULT_P 512
  1270. #define CGEMM_DEFAULT_P 384
  1271. #define ZGEMM_DEFAULT_P 256
  1272. #ifdef WINDOWS_ABI
  1273. #define SGEMM_DEFAULT_Q 320
  1274. #define DGEMM_DEFAULT_Q 128
  1275. #else
  1276. #define SGEMM_DEFAULT_Q 384
  1277. #define DGEMM_DEFAULT_Q 256
  1278. #endif
  1279. #define CGEMM_DEFAULT_Q 192
  1280. #define ZGEMM_DEFAULT_Q 128
  1281. #define SGEMM_DEFAULT_R sgemm_r
  1282. #define DGEMM_DEFAULT_R 13824
  1283. #define CGEMM_DEFAULT_R cgemm_r
  1284. #define ZGEMM_DEFAULT_R zgemm_r
  1285. #define QGEMM_DEFAULT_Q 128
  1286. #define QGEMM_DEFAULT_P 504
  1287. #define QGEMM_DEFAULT_R qgemm_r
  1288. #define XGEMM_DEFAULT_P 252
  1289. #define XGEMM_DEFAULT_R xgemm_r
  1290. #define XGEMM_DEFAULT_Q 128
  1291. #define CGEMM3M_DEFAULT_UNROLL_N 8
  1292. #define CGEMM3M_DEFAULT_UNROLL_M 4
  1293. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  1294. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  1295. #define CGEMM3M_DEFAULT_P 448
  1296. #define ZGEMM3M_DEFAULT_P 224
  1297. #define XGEMM3M_DEFAULT_P 112
  1298. #define CGEMM3M_DEFAULT_Q 224
  1299. #define ZGEMM3M_DEFAULT_Q 224
  1300. #define XGEMM3M_DEFAULT_Q 224
  1301. #define CGEMM3M_DEFAULT_R 12288
  1302. #define ZGEMM3M_DEFAULT_R 12288
  1303. #define XGEMM3M_DEFAULT_R 12288
  1304. #endif
  1305. #endif
  1306. #ifdef SKYLAKEX
  1307. #define SNUMOPT 16
  1308. #define DNUMOPT 8
  1309. #define GEMM_DEFAULT_OFFSET_A 0
  1310. #define GEMM_DEFAULT_OFFSET_B 0
  1311. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1312. #define SYMV_P 8
  1313. #define SWITCH_RATIO 32
  1314. #define GEMM_PREFERED_SIZE 32
  1315. #define USE_SGEMM_KERNEL_DIRECT 1
  1316. #ifdef ARCH_X86
  1317. #define SGEMM_DEFAULT_UNROLL_M 4
  1318. #define DGEMM_DEFAULT_UNROLL_M 2
  1319. #define QGEMM_DEFAULT_UNROLL_M 2
  1320. #define CGEMM_DEFAULT_UNROLL_M 2
  1321. #define ZGEMM_DEFAULT_UNROLL_M 1
  1322. #define XGEMM_DEFAULT_UNROLL_M 1
  1323. #define SGEMM_DEFAULT_UNROLL_N 4
  1324. #define DGEMM_DEFAULT_UNROLL_N 4
  1325. #define QGEMM_DEFAULT_UNROLL_N 2
  1326. #define CGEMM_DEFAULT_UNROLL_N 2
  1327. #define ZGEMM_DEFAULT_UNROLL_N 2
  1328. #define XGEMM_DEFAULT_UNROLL_N 1
  1329. #else
  1330. #define SGEMM_DEFAULT_UNROLL_M 16
  1331. #define DGEMM_DEFAULT_UNROLL_M 4
  1332. #define QGEMM_DEFAULT_UNROLL_M 2
  1333. #define CGEMM_DEFAULT_UNROLL_M 8
  1334. #define ZGEMM_DEFAULT_UNROLL_M 4
  1335. #define XGEMM_DEFAULT_UNROLL_M 1
  1336. #define SGEMM_DEFAULT_UNROLL_N 4
  1337. #define DGEMM_DEFAULT_UNROLL_N 8
  1338. #define QGEMM_DEFAULT_UNROLL_N 2
  1339. #define CGEMM_DEFAULT_UNROLL_N 2
  1340. #define ZGEMM_DEFAULT_UNROLL_N 2
  1341. #define XGEMM_DEFAULT_UNROLL_N 1
  1342. #define SGEMM_DEFAULT_UNROLL_MN 32
  1343. #define DGEMM_DEFAULT_UNROLL_MN 32
  1344. #endif
  1345. #ifdef ARCH_X86
  1346. #define SGEMM_DEFAULT_P 512
  1347. #define SGEMM_DEFAULT_R sgemm_r
  1348. #define DGEMM_DEFAULT_P 512
  1349. #define DGEMM_DEFAULT_R dgemm_r
  1350. #define QGEMM_DEFAULT_P 504
  1351. #define QGEMM_DEFAULT_R qgemm_r
  1352. #define CGEMM_DEFAULT_P 128
  1353. #define CGEMM_DEFAULT_R 1024
  1354. #define ZGEMM_DEFAULT_P 512
  1355. #define ZGEMM_DEFAULT_R zgemm_r
  1356. #define XGEMM_DEFAULT_P 252
  1357. #define XGEMM_DEFAULT_R xgemm_r
  1358. #define SGEMM_DEFAULT_Q 256
  1359. #define DGEMM_DEFAULT_Q 256
  1360. #define QGEMM_DEFAULT_Q 128
  1361. #define CGEMM_DEFAULT_Q 256
  1362. #define ZGEMM_DEFAULT_Q 192
  1363. #define XGEMM_DEFAULT_Q 128
  1364. #else
  1365. #define SGEMM_DEFAULT_P 768
  1366. #define DGEMM_DEFAULT_P 512
  1367. #define CGEMM_DEFAULT_P 384
  1368. #define ZGEMM_DEFAULT_P 256
  1369. #ifdef WINDOWS_ABI
  1370. #define SGEMM_DEFAULT_Q 320
  1371. #define DGEMM_DEFAULT_Q 128
  1372. #else
  1373. #define SGEMM_DEFAULT_Q 384
  1374. #define DGEMM_DEFAULT_Q 256
  1375. #endif
  1376. #define CGEMM_DEFAULT_Q 192
  1377. #define ZGEMM_DEFAULT_Q 128
  1378. #define SGEMM_DEFAULT_R sgemm_r
  1379. #define DGEMM_DEFAULT_R 13824
  1380. #define CGEMM_DEFAULT_R cgemm_r
  1381. #define ZGEMM_DEFAULT_R zgemm_r
  1382. #define QGEMM_DEFAULT_Q 128
  1383. #define QGEMM_DEFAULT_P 504
  1384. #define QGEMM_DEFAULT_R qgemm_r
  1385. #define XGEMM_DEFAULT_P 252
  1386. #define XGEMM_DEFAULT_R xgemm_r
  1387. #define XGEMM_DEFAULT_Q 128
  1388. #define CGEMM3M_DEFAULT_UNROLL_N 8
  1389. #define CGEMM3M_DEFAULT_UNROLL_M 4
  1390. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  1391. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  1392. #define CGEMM3M_DEFAULT_P 448
  1393. #define ZGEMM3M_DEFAULT_P 224
  1394. #define XGEMM3M_DEFAULT_P 112
  1395. #define CGEMM3M_DEFAULT_Q 224
  1396. #define ZGEMM3M_DEFAULT_Q 224
  1397. #define XGEMM3M_DEFAULT_Q 224
  1398. #define CGEMM3M_DEFAULT_R 12288
  1399. #define ZGEMM3M_DEFAULT_R 12288
  1400. #define XGEMM3M_DEFAULT_R 12288
  1401. #endif
  1402. #endif
  1403. #ifdef ATOM
  1404. #define SNUMOPT 2
  1405. #define DNUMOPT 1
  1406. #define GEMM_DEFAULT_OFFSET_A 64
  1407. #define GEMM_DEFAULT_OFFSET_B 0
  1408. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1409. #define SYMV_P 8
  1410. #ifdef ARCH_X86
  1411. #define SGEMM_DEFAULT_UNROLL_M 4
  1412. #define DGEMM_DEFAULT_UNROLL_M 2
  1413. #define QGEMM_DEFAULT_UNROLL_M 2
  1414. #define CGEMM_DEFAULT_UNROLL_M 2
  1415. #define ZGEMM_DEFAULT_UNROLL_M 1
  1416. #define XGEMM_DEFAULT_UNROLL_M 1
  1417. #else
  1418. #define SGEMM_DEFAULT_UNROLL_M 8
  1419. #define DGEMM_DEFAULT_UNROLL_M 4
  1420. #define QGEMM_DEFAULT_UNROLL_M 2
  1421. #define CGEMM_DEFAULT_UNROLL_M 4
  1422. #define ZGEMM_DEFAULT_UNROLL_M 2
  1423. #define XGEMM_DEFAULT_UNROLL_M 1
  1424. #endif
  1425. #define SGEMM_DEFAULT_UNROLL_N 4
  1426. #define DGEMM_DEFAULT_UNROLL_N 2
  1427. #define QGEMM_DEFAULT_UNROLL_N 2
  1428. #define CGEMM_DEFAULT_UNROLL_N 2
  1429. #define ZGEMM_DEFAULT_UNROLL_N 1
  1430. #define XGEMM_DEFAULT_UNROLL_N 1
  1431. #define SGEMM_DEFAULT_P sgemm_p
  1432. #define SGEMM_DEFAULT_R sgemm_r
  1433. #define DGEMM_DEFAULT_P dgemm_p
  1434. #define DGEMM_DEFAULT_R dgemm_r
  1435. #define QGEMM_DEFAULT_P qgemm_p
  1436. #define QGEMM_DEFAULT_R qgemm_r
  1437. #define CGEMM_DEFAULT_P cgemm_p
  1438. #define CGEMM_DEFAULT_R cgemm_r
  1439. #define ZGEMM_DEFAULT_P zgemm_p
  1440. #define ZGEMM_DEFAULT_R zgemm_r
  1441. #define XGEMM_DEFAULT_P xgemm_p
  1442. #define XGEMM_DEFAULT_R xgemm_r
  1443. #define SGEMM_DEFAULT_Q 256
  1444. #define DGEMM_DEFAULT_Q 256
  1445. #define QGEMM_DEFAULT_Q 256
  1446. #define CGEMM_DEFAULT_Q 256
  1447. #define ZGEMM_DEFAULT_Q 256
  1448. #define XGEMM_DEFAULT_Q 256
  1449. #endif
  1450. #ifdef ITANIUM2
  1451. #define SNUMOPT 4
  1452. #define DNUMOPT 4
  1453. #define GEMM_DEFAULT_OFFSET_A 0
  1454. #define GEMM_DEFAULT_OFFSET_B 128
  1455. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1456. #define SGEMM_DEFAULT_UNROLL_M 8
  1457. #define SGEMM_DEFAULT_UNROLL_N 8
  1458. #define DGEMM_DEFAULT_UNROLL_M 8
  1459. #define DGEMM_DEFAULT_UNROLL_N 8
  1460. #define QGEMM_DEFAULT_UNROLL_M 8
  1461. #define QGEMM_DEFAULT_UNROLL_N 8
  1462. #define CGEMM_DEFAULT_UNROLL_M 4
  1463. #define CGEMM_DEFAULT_UNROLL_N 4
  1464. #define ZGEMM_DEFAULT_UNROLL_M 4
  1465. #define ZGEMM_DEFAULT_UNROLL_N 4
  1466. #define XGEMM_DEFAULT_UNROLL_M 4
  1467. #define XGEMM_DEFAULT_UNROLL_N 4
  1468. #define SGEMM_DEFAULT_P sgemm_p
  1469. #define DGEMM_DEFAULT_P dgemm_p
  1470. #define QGEMM_DEFAULT_P qgemm_p
  1471. #define CGEMM_DEFAULT_P cgemm_p
  1472. #define ZGEMM_DEFAULT_P zgemm_p
  1473. #define XGEMM_DEFAULT_P xgemm_p
  1474. #define SGEMM_DEFAULT_Q 1024
  1475. #define DGEMM_DEFAULT_Q 1024
  1476. #define QGEMM_DEFAULT_Q 1024
  1477. #define CGEMM_DEFAULT_Q 1024
  1478. #define ZGEMM_DEFAULT_Q 1024
  1479. #define XGEMM_DEFAULT_Q 1024
  1480. #define SGEMM_DEFAULT_R sgemm_r
  1481. #define DGEMM_DEFAULT_R dgemm_r
  1482. #define QGEMM_DEFAULT_R qgemm_r
  1483. #define CGEMM_DEFAULT_R cgemm_r
  1484. #define ZGEMM_DEFAULT_R zgemm_r
  1485. #define XGEMM_DEFAULT_R xgemm_r
  1486. #define SYMV_P 16
  1487. #define GETRF_FACTOR 0.65
  1488. #endif
  1489. #if defined(EV4) || defined(EV5) || defined(EV6)
  1490. #ifdef EV4
  1491. #define SNUMOPT 1
  1492. #define DNUMOPT 1
  1493. #else
  1494. #define SNUMOPT 2
  1495. #define DNUMOPT 2
  1496. #endif
  1497. #define GEMM_DEFAULT_OFFSET_A 512
  1498. #define GEMM_DEFAULT_OFFSET_B 512
  1499. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1500. #define SGEMM_DEFAULT_UNROLL_M 4
  1501. #define SGEMM_DEFAULT_UNROLL_N 4
  1502. #define DGEMM_DEFAULT_UNROLL_M 4
  1503. #define DGEMM_DEFAULT_UNROLL_N 4
  1504. #define CGEMM_DEFAULT_UNROLL_M 2
  1505. #define CGEMM_DEFAULT_UNROLL_N 2
  1506. #define ZGEMM_DEFAULT_UNROLL_M 2
  1507. #define ZGEMM_DEFAULT_UNROLL_N 2
  1508. #define SYMV_P 8
  1509. #ifdef EV4
  1510. #define SGEMM_DEFAULT_P 32
  1511. #define SGEMM_DEFAULT_Q 112
  1512. #define SGEMM_DEFAULT_R 256
  1513. #define DGEMM_DEFAULT_P 32
  1514. #define DGEMM_DEFAULT_Q 56
  1515. #define DGEMM_DEFAULT_R 256
  1516. #define CGEMM_DEFAULT_P 32
  1517. #define CGEMM_DEFAULT_Q 64
  1518. #define CGEMM_DEFAULT_R 240
  1519. #define ZGEMM_DEFAULT_P 32
  1520. #define ZGEMM_DEFAULT_Q 32
  1521. #define ZGEMM_DEFAULT_R 240
  1522. #endif
  1523. #ifdef EV5
  1524. #define SGEMM_DEFAULT_P 64
  1525. #define SGEMM_DEFAULT_Q 256
  1526. #define DGEMM_DEFAULT_P 64
  1527. #define DGEMM_DEFAULT_Q 128
  1528. #define CGEMM_DEFAULT_P 64
  1529. #define CGEMM_DEFAULT_Q 128
  1530. #define ZGEMM_DEFAULT_P 64
  1531. #define ZGEMM_DEFAULT_Q 64
  1532. #endif
  1533. #ifdef EV6
  1534. #define SGEMM_DEFAULT_P 256
  1535. #define SGEMM_DEFAULT_Q 512
  1536. #define DGEMM_DEFAULT_P 256
  1537. #define DGEMM_DEFAULT_Q 256
  1538. #define CGEMM_DEFAULT_P 256
  1539. #define CGEMM_DEFAULT_Q 256
  1540. #define ZGEMM_DEFAULT_P 128
  1541. #define ZGEMM_DEFAULT_Q 256
  1542. #endif
  1543. #endif
  1544. #ifdef CELL
  1545. #define SNUMOPT 2
  1546. #define DNUMOPT 2
  1547. #define GEMM_DEFAULT_OFFSET_A 0
  1548. #define GEMM_DEFAULT_OFFSET_B 8192
  1549. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1550. #define SGEMM_DEFAULT_UNROLL_M 16
  1551. #define SGEMM_DEFAULT_UNROLL_N 4
  1552. #define DGEMM_DEFAULT_UNROLL_M 4
  1553. #define DGEMM_DEFAULT_UNROLL_N 4
  1554. #define CGEMM_DEFAULT_UNROLL_M 8
  1555. #define CGEMM_DEFAULT_UNROLL_N 2
  1556. #define ZGEMM_DEFAULT_UNROLL_M 2
  1557. #define ZGEMM_DEFAULT_UNROLL_N 2
  1558. #define SGEMM_DEFAULT_P 128
  1559. #define DGEMM_DEFAULT_P 128
  1560. #define CGEMM_DEFAULT_P 128
  1561. #define ZGEMM_DEFAULT_P 128
  1562. #define SGEMM_DEFAULT_Q 512
  1563. #define DGEMM_DEFAULT_Q 256
  1564. #define CGEMM_DEFAULT_Q 256
  1565. #define ZGEMM_DEFAULT_Q 128
  1566. #define SYMV_P 4
  1567. #endif
  1568. #ifdef PPCG4
  1569. #define GEMM_DEFAULT_OFFSET_A 0
  1570. #define GEMM_DEFAULT_OFFSET_B 1024
  1571. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1572. #define SGEMM_DEFAULT_UNROLL_M 16
  1573. #define SGEMM_DEFAULT_UNROLL_N 4
  1574. #define DGEMM_DEFAULT_UNROLL_M 4
  1575. #define DGEMM_DEFAULT_UNROLL_N 4
  1576. #define CGEMM_DEFAULT_UNROLL_M 8
  1577. #define CGEMM_DEFAULT_UNROLL_N 2
  1578. #define ZGEMM_DEFAULT_UNROLL_M 2
  1579. #define ZGEMM_DEFAULT_UNROLL_N 2
  1580. #define SGEMM_DEFAULT_P 256
  1581. #define DGEMM_DEFAULT_P 128
  1582. #define CGEMM_DEFAULT_P 128
  1583. #define ZGEMM_DEFAULT_P 64
  1584. #define SGEMM_DEFAULT_Q 256
  1585. #define DGEMM_DEFAULT_Q 256
  1586. #define CGEMM_DEFAULT_Q 256
  1587. #define ZGEMM_DEFAULT_Q 256
  1588. #define SYMV_P 4
  1589. #endif
  1590. #ifdef PPC970
  1591. #define SNUMOPT 4
  1592. #define DNUMOPT 4
  1593. #define GEMM_DEFAULT_OFFSET_A 2688
  1594. #define GEMM_DEFAULT_OFFSET_B 3072
  1595. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1596. #define SGEMM_DEFAULT_UNROLL_M 16
  1597. #define SGEMM_DEFAULT_UNROLL_N 4
  1598. #define DGEMM_DEFAULT_UNROLL_M 4
  1599. #define DGEMM_DEFAULT_UNROLL_N 4
  1600. #define CGEMM_DEFAULT_UNROLL_M 8
  1601. #define CGEMM_DEFAULT_UNROLL_N 2
  1602. #define ZGEMM_DEFAULT_UNROLL_M 2
  1603. #define ZGEMM_DEFAULT_UNROLL_N 2
  1604. #if defined(OS_LINUX) || defined(OS_DARWIN)
  1605. #if L2_SIZE == 1024976
  1606. #define SGEMM_DEFAULT_P 320
  1607. #define DGEMM_DEFAULT_P 256
  1608. #define CGEMM_DEFAULT_P 256
  1609. #define ZGEMM_DEFAULT_P 256
  1610. #else
  1611. #define SGEMM_DEFAULT_P 176
  1612. #define DGEMM_DEFAULT_P 176
  1613. #define CGEMM_DEFAULT_P 176
  1614. #define ZGEMM_DEFAULT_P 176
  1615. #endif
  1616. #endif
  1617. #define SGEMM_DEFAULT_Q 512
  1618. #define DGEMM_DEFAULT_Q 256
  1619. #define CGEMM_DEFAULT_Q 256
  1620. #define ZGEMM_DEFAULT_Q 128
  1621. #define SYMV_P 4
  1622. #endif
  1623. #ifdef PPC440
  1624. #define SNUMOPT 2
  1625. #define DNUMOPT 2
  1626. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1627. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1628. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1629. #define SGEMM_DEFAULT_UNROLL_M 4
  1630. #define SGEMM_DEFAULT_UNROLL_N 4
  1631. #define DGEMM_DEFAULT_UNROLL_M 4
  1632. #define DGEMM_DEFAULT_UNROLL_N 4
  1633. #define CGEMM_DEFAULT_UNROLL_M 2
  1634. #define CGEMM_DEFAULT_UNROLL_N 2
  1635. #define ZGEMM_DEFAULT_UNROLL_M 2
  1636. #define ZGEMM_DEFAULT_UNROLL_N 2
  1637. #define SGEMM_DEFAULT_P 512
  1638. #define DGEMM_DEFAULT_P 512
  1639. #define CGEMM_DEFAULT_P 512
  1640. #define ZGEMM_DEFAULT_P 512
  1641. #define SGEMM_DEFAULT_Q 1024
  1642. #define DGEMM_DEFAULT_Q 512
  1643. #define CGEMM_DEFAULT_Q 512
  1644. #define ZGEMM_DEFAULT_Q 256
  1645. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  1646. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  1647. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  1648. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  1649. #define SYMV_P 4
  1650. #endif
  1651. #ifdef PPC440FP2
  1652. #define SNUMOPT 4
  1653. #define DNUMOPT 4
  1654. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1655. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1656. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1657. #define SGEMM_DEFAULT_UNROLL_M 8
  1658. #define SGEMM_DEFAULT_UNROLL_N 4
  1659. #define DGEMM_DEFAULT_UNROLL_M 8
  1660. #define DGEMM_DEFAULT_UNROLL_N 4
  1661. #define CGEMM_DEFAULT_UNROLL_M 4
  1662. #define CGEMM_DEFAULT_UNROLL_N 2
  1663. #define ZGEMM_DEFAULT_UNROLL_M 4
  1664. #define ZGEMM_DEFAULT_UNROLL_N 2
  1665. #define SGEMM_DEFAULT_P 128
  1666. #define DGEMM_DEFAULT_P 128
  1667. #define CGEMM_DEFAULT_P 128
  1668. #define ZGEMM_DEFAULT_P 128
  1669. #if 1
  1670. #define SGEMM_DEFAULT_Q 4096
  1671. #define DGEMM_DEFAULT_Q 3072
  1672. #define CGEMM_DEFAULT_Q 2048
  1673. #define ZGEMM_DEFAULT_Q 1024
  1674. #else
  1675. #define SGEMM_DEFAULT_Q 512
  1676. #define DGEMM_DEFAULT_Q 256
  1677. #define CGEMM_DEFAULT_Q 256
  1678. #define ZGEMM_DEFAULT_Q 128
  1679. #endif
  1680. #define SYMV_P 4
  1681. #endif
  1682. #if defined(POWER3) || defined(POWER4) || defined(POWER5)
  1683. #define GEMM_DEFAULT_OFFSET_A 0
  1684. #define GEMM_DEFAULT_OFFSET_B 2048
  1685. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1686. #define SGEMM_DEFAULT_UNROLL_M 4
  1687. #define SGEMM_DEFAULT_UNROLL_N 4
  1688. #define DGEMM_DEFAULT_UNROLL_M 4
  1689. #define DGEMM_DEFAULT_UNROLL_N 4
  1690. #define CGEMM_DEFAULT_UNROLL_M 2
  1691. #define CGEMM_DEFAULT_UNROLL_N 2
  1692. #define ZGEMM_DEFAULT_UNROLL_M 2
  1693. #define ZGEMM_DEFAULT_UNROLL_N 2
  1694. #ifdef POWER3
  1695. #define SNUMOPT 4
  1696. #define DNUMOPT 4
  1697. #define SGEMM_DEFAULT_P 256
  1698. #define SGEMM_DEFAULT_Q 432
  1699. #define SGEMM_DEFAULT_R 1012
  1700. #define DGEMM_DEFAULT_P 256
  1701. #define DGEMM_DEFAULT_Q 216
  1702. #define DGEMM_DEFAULT_R 1012
  1703. #define ZGEMM_DEFAULT_P 256
  1704. #define ZGEMM_DEFAULT_Q 104
  1705. #define ZGEMM_DEFAULT_R 1012
  1706. #endif
  1707. #if defined(POWER4)
  1708. #ifdef ALLOC_HUGETLB
  1709. #define SGEMM_DEFAULT_P 184
  1710. #define DGEMM_DEFAULT_P 184
  1711. #define CGEMM_DEFAULT_P 184
  1712. #define ZGEMM_DEFAULT_P 184
  1713. #else
  1714. #define SGEMM_DEFAULT_P 144
  1715. #define DGEMM_DEFAULT_P 144
  1716. #define CGEMM_DEFAULT_P 144
  1717. #define ZGEMM_DEFAULT_P 144
  1718. #endif
  1719. #endif
  1720. #if defined(POWER5)
  1721. #ifdef ALLOC_HUGETLB
  1722. #define SGEMM_DEFAULT_P 512
  1723. #define DGEMM_DEFAULT_P 256
  1724. #define CGEMM_DEFAULT_P 256
  1725. #define ZGEMM_DEFAULT_P 128
  1726. #else
  1727. #define SGEMM_DEFAULT_P 320
  1728. #define DGEMM_DEFAULT_P 160
  1729. #define CGEMM_DEFAULT_P 160
  1730. #define ZGEMM_DEFAULT_P 80
  1731. #endif
  1732. #define SGEMM_DEFAULT_Q 256
  1733. #define CGEMM_DEFAULT_Q 256
  1734. #define DGEMM_DEFAULT_Q 256
  1735. #define ZGEMM_DEFAULT_Q 256
  1736. #endif
  1737. #define SYMV_P 8
  1738. #endif
  1739. #if defined(POWER6)
  1740. #define SNUMOPT 4
  1741. #define DNUMOPT 4
  1742. #define GEMM_DEFAULT_OFFSET_A 384
  1743. #define GEMM_DEFAULT_OFFSET_B 1024
  1744. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1745. #define SGEMM_DEFAULT_UNROLL_M 4
  1746. #define SGEMM_DEFAULT_UNROLL_N 4
  1747. #define DGEMM_DEFAULT_UNROLL_M 4
  1748. #define DGEMM_DEFAULT_UNROLL_N 4
  1749. #define CGEMM_DEFAULT_UNROLL_M 2
  1750. #define CGEMM_DEFAULT_UNROLL_N 4
  1751. #define ZGEMM_DEFAULT_UNROLL_M 2
  1752. #define ZGEMM_DEFAULT_UNROLL_N 4
  1753. #define SGEMM_DEFAULT_P 992
  1754. #define DGEMM_DEFAULT_P 480
  1755. #define CGEMM_DEFAULT_P 488
  1756. #define ZGEMM_DEFAULT_P 248
  1757. #define SGEMM_DEFAULT_Q 504
  1758. #define DGEMM_DEFAULT_Q 504
  1759. #define CGEMM_DEFAULT_Q 400
  1760. #define ZGEMM_DEFAULT_Q 400
  1761. #define SYMV_P 8
  1762. #endif
  1763. #if defined(POWER8)
  1764. #define SNUMOPT 16
  1765. #define DNUMOPT 8
  1766. #define GEMM_DEFAULT_OFFSET_A 0
  1767. #define GEMM_DEFAULT_OFFSET_B 65536
  1768. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1769. #define SGEMM_DEFAULT_UNROLL_M 16
  1770. #define SGEMM_DEFAULT_UNROLL_N 8
  1771. #define DGEMM_DEFAULT_UNROLL_M 16
  1772. #define DGEMM_DEFAULT_UNROLL_N 4
  1773. #define CGEMM_DEFAULT_UNROLL_M 8
  1774. #define CGEMM_DEFAULT_UNROLL_N 4
  1775. #define ZGEMM_DEFAULT_UNROLL_M 8
  1776. #define ZGEMM_DEFAULT_UNROLL_N 2
  1777. #define SGEMM_DEFAULT_P 1280
  1778. #define DGEMM_DEFAULT_P 640
  1779. #define CGEMM_DEFAULT_P 640
  1780. #define ZGEMM_DEFAULT_P 320
  1781. #define SGEMM_DEFAULT_Q 640
  1782. #define DGEMM_DEFAULT_Q 720
  1783. #define CGEMM_DEFAULT_Q 640
  1784. #define ZGEMM_DEFAULT_Q 640
  1785. #define SYMV_P 8
  1786. #endif
  1787. #if defined(POWER9)
  1788. #define SNUMOPT 16
  1789. #define DNUMOPT 8
  1790. #define GEMM_DEFAULT_OFFSET_A 0
  1791. #define GEMM_DEFAULT_OFFSET_B 65536
  1792. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1793. #define SGEMM_DEFAULT_UNROLL_M 16
  1794. #define SGEMM_DEFAULT_UNROLL_N 8
  1795. #define DGEMM_DEFAULT_UNROLL_M 16
  1796. #define DGEMM_DEFAULT_UNROLL_N 4
  1797. #define CGEMM_DEFAULT_UNROLL_M 8
  1798. #define CGEMM_DEFAULT_UNROLL_N 4
  1799. #define ZGEMM_DEFAULT_UNROLL_M 8
  1800. #define ZGEMM_DEFAULT_UNROLL_N 2
  1801. #define SGEMM_DEFAULT_P 640
  1802. #define DGEMM_DEFAULT_P 128
  1803. #define CGEMM_DEFAULT_P 640
  1804. #define ZGEMM_DEFAULT_P 320
  1805. #define SGEMM_DEFAULT_Q 1408
  1806. #define DGEMM_DEFAULT_Q 384
  1807. #define CGEMM_DEFAULT_Q 640
  1808. #define ZGEMM_DEFAULT_Q 640
  1809. #define SYMV_P 8
  1810. #endif
  1811. #if defined(SPARC) && defined(V7)
  1812. #define SNUMOPT 4
  1813. #define DNUMOPT 4
  1814. #define GEMM_DEFAULT_OFFSET_A 0
  1815. #define GEMM_DEFAULT_OFFSET_B 2048
  1816. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1817. #define SGEMM_DEFAULT_UNROLL_M 2
  1818. #define SGEMM_DEFAULT_UNROLL_N 8
  1819. #define DGEMM_DEFAULT_UNROLL_M 2
  1820. #define DGEMM_DEFAULT_UNROLL_N 8
  1821. #define CGEMM_DEFAULT_UNROLL_M 1
  1822. #define CGEMM_DEFAULT_UNROLL_N 4
  1823. #define ZGEMM_DEFAULT_UNROLL_M 1
  1824. #define ZGEMM_DEFAULT_UNROLL_N 4
  1825. #define SGEMM_DEFAULT_P 256
  1826. #define DGEMM_DEFAULT_P 256
  1827. #define CGEMM_DEFAULT_P 256
  1828. #define ZGEMM_DEFAULT_P 256
  1829. #define SGEMM_DEFAULT_Q 512
  1830. #define DGEMM_DEFAULT_Q 256
  1831. #define CGEMM_DEFAULT_Q 256
  1832. #define ZGEMM_DEFAULT_Q 128
  1833. #define SYMV_P 8
  1834. #define GEMM_THREAD gemm_thread_mn
  1835. #endif
  1836. #if (defined(SPARC) && defined(V9)) || defined(__sparc_v9__)
  1837. #define SNUMOPT 2
  1838. #define DNUMOPT 2
  1839. #define GEMM_DEFAULT_OFFSET_A 0
  1840. #define GEMM_DEFAULT_OFFSET_B 2048
  1841. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1842. #define SGEMM_DEFAULT_UNROLL_M 4
  1843. #define SGEMM_DEFAULT_UNROLL_N 4
  1844. #define DGEMM_DEFAULT_UNROLL_M 4
  1845. #define DGEMM_DEFAULT_UNROLL_N 4
  1846. #define CGEMM_DEFAULT_UNROLL_M 2
  1847. #define CGEMM_DEFAULT_UNROLL_N 2
  1848. #define ZGEMM_DEFAULT_UNROLL_M 2
  1849. #define ZGEMM_DEFAULT_UNROLL_N 2
  1850. #define SGEMM_DEFAULT_P 512
  1851. #define DGEMM_DEFAULT_P 512
  1852. #define CGEMM_DEFAULT_P 512
  1853. #define ZGEMM_DEFAULT_P 512
  1854. #define SGEMM_DEFAULT_Q 1024
  1855. #define DGEMM_DEFAULT_Q 512
  1856. #define CGEMM_DEFAULT_Q 512
  1857. #define ZGEMM_DEFAULT_Q 256
  1858. #define SYMV_P 8
  1859. #endif
  1860. #ifdef SICORTEX
  1861. #define SNUMOPT 2
  1862. #define DNUMOPT 2
  1863. #define GEMM_DEFAULT_OFFSET_A 0
  1864. #define GEMM_DEFAULT_OFFSET_B 0
  1865. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1866. #define SGEMM_DEFAULT_UNROLL_M 2
  1867. #define SGEMM_DEFAULT_UNROLL_N 8
  1868. #define DGEMM_DEFAULT_UNROLL_M 2
  1869. #define DGEMM_DEFAULT_UNROLL_N 8
  1870. #define CGEMM_DEFAULT_UNROLL_M 1
  1871. #define CGEMM_DEFAULT_UNROLL_N 4
  1872. #define ZGEMM_DEFAULT_UNROLL_M 1
  1873. #define ZGEMM_DEFAULT_UNROLL_N 4
  1874. #define SGEMM_DEFAULT_P 108
  1875. #define DGEMM_DEFAULT_P 112
  1876. #define CGEMM_DEFAULT_P 108
  1877. #define ZGEMM_DEFAULT_P 112
  1878. #define SGEMM_DEFAULT_Q 288
  1879. #define DGEMM_DEFAULT_Q 144
  1880. #define CGEMM_DEFAULT_Q 144
  1881. #define ZGEMM_DEFAULT_Q 72
  1882. #define SGEMM_DEFAULT_R 2000
  1883. #define DGEMM_DEFAULT_R 2000
  1884. #define CGEMM_DEFAULT_R 2000
  1885. #define ZGEMM_DEFAULT_R 2000
  1886. #define SYMV_P 16
  1887. #endif
  1888. #ifdef LOONGSON3A
  1889. ////Copy from SICORTEX
  1890. #define SNUMOPT 2
  1891. #define DNUMOPT 2
  1892. #define GEMM_DEFAULT_OFFSET_A 0
  1893. #define GEMM_DEFAULT_OFFSET_B 0
  1894. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1895. #define SGEMM_DEFAULT_UNROLL_M 8
  1896. #define SGEMM_DEFAULT_UNROLL_N 4
  1897. #define DGEMM_DEFAULT_UNROLL_M 4
  1898. #define DGEMM_DEFAULT_UNROLL_N 4
  1899. #define CGEMM_DEFAULT_UNROLL_M 4
  1900. #define CGEMM_DEFAULT_UNROLL_N 2
  1901. #define ZGEMM_DEFAULT_UNROLL_M 2
  1902. #define ZGEMM_DEFAULT_UNROLL_N 2
  1903. #define SGEMM_DEFAULT_P 64
  1904. #define DGEMM_DEFAULT_P 44
  1905. #define CGEMM_DEFAULT_P 64
  1906. #define ZGEMM_DEFAULT_P 32
  1907. #define SGEMM_DEFAULT_Q 192
  1908. #define DGEMM_DEFAULT_Q 92
  1909. #define CGEMM_DEFAULT_Q 128
  1910. #define ZGEMM_DEFAULT_Q 80
  1911. #define SGEMM_DEFAULT_R 640
  1912. #define DGEMM_DEFAULT_R dgemm_r
  1913. #define CGEMM_DEFAULT_R 640
  1914. #define ZGEMM_DEFAULT_R 640
  1915. #define GEMM_OFFSET_A1 0x10000
  1916. #define GEMM_OFFSET_B1 0x100000
  1917. #define SYMV_P 16
  1918. #endif
  1919. #ifdef LOONGSON3B
  1920. #define SNUMOPT 2
  1921. #define DNUMOPT 2
  1922. #define GEMM_DEFAULT_OFFSET_A 0
  1923. #define GEMM_DEFAULT_OFFSET_B 0
  1924. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1925. #define SGEMM_DEFAULT_UNROLL_M 2
  1926. #define SGEMM_DEFAULT_UNROLL_N 2
  1927. #define DGEMM_DEFAULT_UNROLL_M 2
  1928. #define DGEMM_DEFAULT_UNROLL_N 2
  1929. #define CGEMM_DEFAULT_UNROLL_M 2
  1930. #define CGEMM_DEFAULT_UNROLL_N 2
  1931. #define ZGEMM_DEFAULT_UNROLL_M 2
  1932. #define ZGEMM_DEFAULT_UNROLL_N 2
  1933. #define SGEMM_DEFAULT_P 64
  1934. #define DGEMM_DEFAULT_P 24
  1935. #define CGEMM_DEFAULT_P 24
  1936. #define ZGEMM_DEFAULT_P 20
  1937. #define SGEMM_DEFAULT_Q 192
  1938. #define DGEMM_DEFAULT_Q 128
  1939. #define CGEMM_DEFAULT_Q 128
  1940. #define ZGEMM_DEFAULT_Q 64
  1941. #define SGEMM_DEFAULT_R 512
  1942. #define DGEMM_DEFAULT_R 512
  1943. #define CGEMM_DEFAULT_R 512
  1944. #define ZGEMM_DEFAULT_R 512
  1945. #define GEMM_OFFSET_A1 0x10000
  1946. #define GEMM_OFFSET_B1 0x100000
  1947. #define SYMV_P 16
  1948. #endif
  1949. #if defined(P5600) || defined(MIPS1004K) || defined(I6400) || defined(P6600) || defined(I6500)
  1950. #define SNUMOPT 2
  1951. #define DNUMOPT 2
  1952. #define GEMM_DEFAULT_OFFSET_A 0
  1953. #define GEMM_DEFAULT_OFFSET_B 0
  1954. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1955. #ifdef HAVE_MSA
  1956. #define SGEMM_DEFAULT_UNROLL_M 8
  1957. #define SGEMM_DEFAULT_UNROLL_N 8
  1958. #define DGEMM_DEFAULT_UNROLL_M 8
  1959. #define DGEMM_DEFAULT_UNROLL_N 4
  1960. #define CGEMM_DEFAULT_UNROLL_M 8
  1961. #define CGEMM_DEFAULT_UNROLL_N 4
  1962. #define ZGEMM_DEFAULT_UNROLL_M 4
  1963. #define ZGEMM_DEFAULT_UNROLL_N 4
  1964. #else
  1965. #define SGEMM_DEFAULT_UNROLL_M 2
  1966. #define SGEMM_DEFAULT_UNROLL_N 2
  1967. #define DGEMM_DEFAULT_UNROLL_M 2
  1968. #define DGEMM_DEFAULT_UNROLL_N 2
  1969. #define CGEMM_DEFAULT_UNROLL_M 2
  1970. #define CGEMM_DEFAULT_UNROLL_N 2
  1971. #define ZGEMM_DEFAULT_UNROLL_M 2
  1972. #define ZGEMM_DEFAULT_UNROLL_N 2
  1973. #endif
  1974. #define SGEMM_DEFAULT_P 128
  1975. #define DGEMM_DEFAULT_P 128
  1976. #define CGEMM_DEFAULT_P 96
  1977. #define ZGEMM_DEFAULT_P 64
  1978. #define SGEMM_DEFAULT_Q 240
  1979. #define DGEMM_DEFAULT_Q 120
  1980. #define CGEMM_DEFAULT_Q 120
  1981. #define ZGEMM_DEFAULT_Q 120
  1982. #define SGEMM_DEFAULT_R 12288
  1983. #define DGEMM_DEFAULT_R 8192
  1984. #define CGEMM_DEFAULT_R 4096
  1985. #define ZGEMM_DEFAULT_R 4096
  1986. #define SYMV_P 16
  1987. #endif
  1988. #ifdef ARMV7
  1989. #define SNUMOPT 2
  1990. #define DNUMOPT 2
  1991. #define GEMM_DEFAULT_OFFSET_A 0
  1992. #define GEMM_DEFAULT_OFFSET_B 0
  1993. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1994. #define SGEMM_DEFAULT_UNROLL_M 4
  1995. #define SGEMM_DEFAULT_UNROLL_N 4
  1996. #define DGEMM_DEFAULT_UNROLL_M 4
  1997. #define DGEMM_DEFAULT_UNROLL_N 4
  1998. #define CGEMM_DEFAULT_UNROLL_M 2
  1999. #define CGEMM_DEFAULT_UNROLL_N 2
  2000. #define ZGEMM_DEFAULT_UNROLL_M 2
  2001. #define ZGEMM_DEFAULT_UNROLL_N 2
  2002. #define SGEMM_DEFAULT_P 128
  2003. #define DGEMM_DEFAULT_P 128
  2004. #define CGEMM_DEFAULT_P 96
  2005. #define ZGEMM_DEFAULT_P 64
  2006. #define SGEMM_DEFAULT_Q 240
  2007. #define DGEMM_DEFAULT_Q 120
  2008. #define CGEMM_DEFAULT_Q 120
  2009. #define ZGEMM_DEFAULT_Q 120
  2010. #define SGEMM_DEFAULT_R 12288
  2011. #define DGEMM_DEFAULT_R 8192
  2012. #define CGEMM_DEFAULT_R 4096
  2013. #define ZGEMM_DEFAULT_R 4096
  2014. #define SYMV_P 16
  2015. #endif
  2016. #if defined(ARMV6)
  2017. #define SNUMOPT 2
  2018. #define DNUMOPT 2
  2019. #define GEMM_DEFAULT_OFFSET_A 0
  2020. #define GEMM_DEFAULT_OFFSET_B 0
  2021. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2022. #define SGEMM_DEFAULT_UNROLL_M 4
  2023. #define SGEMM_DEFAULT_UNROLL_N 2
  2024. #define DGEMM_DEFAULT_UNROLL_M 4
  2025. #define DGEMM_DEFAULT_UNROLL_N 2
  2026. #define CGEMM_DEFAULT_UNROLL_M 2
  2027. #define CGEMM_DEFAULT_UNROLL_N 2
  2028. #define ZGEMM_DEFAULT_UNROLL_M 2
  2029. #define ZGEMM_DEFAULT_UNROLL_N 2
  2030. #define SGEMM_DEFAULT_P 128
  2031. #define DGEMM_DEFAULT_P 128
  2032. #define CGEMM_DEFAULT_P 96
  2033. #define ZGEMM_DEFAULT_P 64
  2034. #define SGEMM_DEFAULT_Q 240
  2035. #define DGEMM_DEFAULT_Q 120
  2036. #define CGEMM_DEFAULT_Q 120
  2037. #define ZGEMM_DEFAULT_Q 120
  2038. #define SGEMM_DEFAULT_R 12288
  2039. #define DGEMM_DEFAULT_R 8192
  2040. #define CGEMM_DEFAULT_R 4096
  2041. #define ZGEMM_DEFAULT_R 4096
  2042. #define SYMV_P 16
  2043. #endif
  2044. // Common ARMv8 parameters
  2045. #if defined(ARMV8)
  2046. #define SNUMOPT 2
  2047. #define DNUMOPT 2
  2048. #define GEMM_DEFAULT_OFFSET_A 0
  2049. #define GEMM_DEFAULT_OFFSET_B 0
  2050. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2051. #define SYMV_P 16
  2052. // Darwin / Cross
  2053. #if defined(OS_DARWIN) && defined(CROSS)
  2054. #define SGEMM_DEFAULT_UNROLL_M 2
  2055. #define SGEMM_DEFAULT_UNROLL_N 2
  2056. #define DGEMM_DEFAULT_UNROLL_M 2
  2057. #define DGEMM_DEFAULT_UNROLL_N 2
  2058. #define CGEMM_DEFAULT_UNROLL_M 2
  2059. #define CGEMM_DEFAULT_UNROLL_N 2
  2060. #define ZGEMM_DEFAULT_UNROLL_M 2
  2061. #define ZGEMM_DEFAULT_UNROLL_N 2
  2062. #define SGEMM_DEFAULT_P 128
  2063. #define DGEMM_DEFAULT_P 128
  2064. #define CGEMM_DEFAULT_P 96
  2065. #define ZGEMM_DEFAULT_P 64
  2066. #define SGEMM_DEFAULT_Q 240
  2067. #define DGEMM_DEFAULT_Q 120
  2068. #define CGEMM_DEFAULT_Q 120
  2069. #define ZGEMM_DEFAULT_Q 120
  2070. #define SGEMM_DEFAULT_R 12288
  2071. #define DGEMM_DEFAULT_R 8192
  2072. #define CGEMM_DEFAULT_R 4096
  2073. #define ZGEMM_DEFAULT_R 4096
  2074. #else // Linux / Native
  2075. #if defined(CORTEXA53) || defined(CORTEXA57) || \
  2076. defined(CORTEXA72) || defined(CORTEXA73) || \
  2077. defined(FALKOR) || defined(TSV110)
  2078. #define SGEMM_DEFAULT_UNROLL_M 16
  2079. #define SGEMM_DEFAULT_UNROLL_N 4
  2080. #define DGEMM_DEFAULT_UNROLL_M 8
  2081. #define DGEMM_DEFAULT_UNROLL_N 4
  2082. #define CGEMM_DEFAULT_UNROLL_M 8
  2083. #define CGEMM_DEFAULT_UNROLL_N 4
  2084. #define ZGEMM_DEFAULT_UNROLL_M 4
  2085. #define ZGEMM_DEFAULT_UNROLL_N 4
  2086. #define SGEMM_DEFAULT_P 512
  2087. #define DGEMM_DEFAULT_P 256
  2088. #define CGEMM_DEFAULT_P 256
  2089. #define ZGEMM_DEFAULT_P 128
  2090. #define SGEMM_DEFAULT_Q 1024
  2091. #define DGEMM_DEFAULT_Q 512
  2092. #define CGEMM_DEFAULT_Q 512
  2093. #define ZGEMM_DEFAULT_Q 512
  2094. #define SGEMM_DEFAULT_R 4096
  2095. #define DGEMM_DEFAULT_R 4096
  2096. #define CGEMM_DEFAULT_R 4096
  2097. #define ZGEMM_DEFAULT_R 2048
  2098. #elif defined(THUNDERX)
  2099. #define SGEMM_DEFAULT_UNROLL_M 4
  2100. #define SGEMM_DEFAULT_UNROLL_N 4
  2101. #define DGEMM_DEFAULT_UNROLL_M 2
  2102. #define DGEMM_DEFAULT_UNROLL_N 2
  2103. #define CGEMM_DEFAULT_UNROLL_M 2
  2104. #define CGEMM_DEFAULT_UNROLL_N 2
  2105. #define ZGEMM_DEFAULT_UNROLL_M 2
  2106. #define ZGEMM_DEFAULT_UNROLL_N 2
  2107. #define SGEMM_DEFAULT_P 128
  2108. #define DGEMM_DEFAULT_P 128
  2109. #define CGEMM_DEFAULT_P 96
  2110. #define ZGEMM_DEFAULT_P 64
  2111. #define SGEMM_DEFAULT_Q 240
  2112. #define DGEMM_DEFAULT_Q 120
  2113. #define CGEMM_DEFAULT_Q 120
  2114. #define ZGEMM_DEFAULT_Q 120
  2115. #define SGEMM_DEFAULT_R 12288
  2116. #define DGEMM_DEFAULT_R 8192
  2117. #define CGEMM_DEFAULT_R 4096
  2118. #define ZGEMM_DEFAULT_R 4096
  2119. #elif defined(THUNDERX2T99)
  2120. #define SGEMM_DEFAULT_UNROLL_M 16
  2121. #define SGEMM_DEFAULT_UNROLL_N 4
  2122. #define DGEMM_DEFAULT_UNROLL_M 8
  2123. #define DGEMM_DEFAULT_UNROLL_N 4
  2124. #define CGEMM_DEFAULT_UNROLL_M 8
  2125. #define CGEMM_DEFAULT_UNROLL_N 4
  2126. #define ZGEMM_DEFAULT_UNROLL_M 4
  2127. #define ZGEMM_DEFAULT_UNROLL_N 4
  2128. #define SGEMM_DEFAULT_P 128
  2129. #define DGEMM_DEFAULT_P 160
  2130. #define CGEMM_DEFAULT_P 128
  2131. #define ZGEMM_DEFAULT_P 128
  2132. #define SGEMM_DEFAULT_Q 352
  2133. #define DGEMM_DEFAULT_Q 128
  2134. #define CGEMM_DEFAULT_Q 224
  2135. #define ZGEMM_DEFAULT_Q 112
  2136. #define SGEMM_DEFAULT_R 4096
  2137. #define DGEMM_DEFAULT_R 4096
  2138. #define CGEMM_DEFAULT_R 4096
  2139. #define ZGEMM_DEFAULT_R 4096
  2140. #else // Other/undetected ARMv8 cores
  2141. #define SGEMM_DEFAULT_UNROLL_M 16
  2142. #define SGEMM_DEFAULT_UNROLL_N 4
  2143. #define DGEMM_DEFAULT_UNROLL_M 8
  2144. #define DGEMM_DEFAULT_UNROLL_N 4
  2145. #define CGEMM_DEFAULT_UNROLL_M 8
  2146. #define CGEMM_DEFAULT_UNROLL_N 4
  2147. #define ZGEMM_DEFAULT_UNROLL_M 4
  2148. #define ZGEMM_DEFAULT_UNROLL_N 4
  2149. #define SGEMM_DEFAULT_P 128
  2150. #define DGEMM_DEFAULT_P 160
  2151. #define CGEMM_DEFAULT_P 128
  2152. #define ZGEMM_DEFAULT_P 128
  2153. #define SGEMM_DEFAULT_Q 352
  2154. #define DGEMM_DEFAULT_Q 128
  2155. #define CGEMM_DEFAULT_Q 224
  2156. #define ZGEMM_DEFAULT_Q 112
  2157. #define SGEMM_DEFAULT_R 4096
  2158. #define DGEMM_DEFAULT_R 4096
  2159. #define CGEMM_DEFAULT_R 4096
  2160. #define ZGEMM_DEFAULT_R 4096
  2161. #endif // Cores
  2162. #endif // Linux / Darwin
  2163. #endif // ARMv8
  2164. #if defined(ARMV5)
  2165. #define SNUMOPT 2
  2166. #define DNUMOPT 2
  2167. #define GEMM_DEFAULT_OFFSET_A 0
  2168. #define GEMM_DEFAULT_OFFSET_B 0
  2169. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2170. #define SGEMM_DEFAULT_UNROLL_M 2
  2171. #define SGEMM_DEFAULT_UNROLL_N 2
  2172. #define DGEMM_DEFAULT_UNROLL_M 2
  2173. #define DGEMM_DEFAULT_UNROLL_N 2
  2174. #define CGEMM_DEFAULT_UNROLL_M 2
  2175. #define CGEMM_DEFAULT_UNROLL_N 2
  2176. #define ZGEMM_DEFAULT_UNROLL_M 2
  2177. #define ZGEMM_DEFAULT_UNROLL_N 2
  2178. #define SGEMM_DEFAULT_P 128
  2179. #define DGEMM_DEFAULT_P 128
  2180. #define CGEMM_DEFAULT_P 96
  2181. #define ZGEMM_DEFAULT_P 64
  2182. #define SGEMM_DEFAULT_Q 240
  2183. #define DGEMM_DEFAULT_Q 120
  2184. #define CGEMM_DEFAULT_Q 120
  2185. #define ZGEMM_DEFAULT_Q 120
  2186. #define SGEMM_DEFAULT_R 12288
  2187. #define DGEMM_DEFAULT_R 8192
  2188. #define CGEMM_DEFAULT_R 4096
  2189. #define ZGEMM_DEFAULT_R 4096
  2190. #define SYMV_P 16
  2191. #endif
  2192. #ifdef CORTEXA9
  2193. #define SNUMOPT 2
  2194. #define DNUMOPT 2
  2195. #define GEMM_DEFAULT_OFFSET_A 0
  2196. #define GEMM_DEFAULT_OFFSET_B 0
  2197. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2198. #define SGEMM_DEFAULT_UNROLL_M 4
  2199. #define SGEMM_DEFAULT_UNROLL_N 4
  2200. #define DGEMM_DEFAULT_UNROLL_M 4
  2201. #define DGEMM_DEFAULT_UNROLL_N 4
  2202. #define CGEMM_DEFAULT_UNROLL_M 2
  2203. #define CGEMM_DEFAULT_UNROLL_N 2
  2204. #define ZGEMM_DEFAULT_UNROLL_M 2
  2205. #define ZGEMM_DEFAULT_UNROLL_N 2
  2206. #define SGEMM_DEFAULT_P 128
  2207. #define DGEMM_DEFAULT_P 128
  2208. #define CGEMM_DEFAULT_P 96
  2209. #define ZGEMM_DEFAULT_P 64
  2210. #define SGEMM_DEFAULT_Q 240
  2211. #define DGEMM_DEFAULT_Q 120
  2212. #define CGEMM_DEFAULT_Q 120
  2213. #define ZGEMM_DEFAULT_Q 120
  2214. #define SGEMM_DEFAULT_R 12288
  2215. #define DGEMM_DEFAULT_R 8192
  2216. #define CGEMM_DEFAULT_R 4096
  2217. #define ZGEMM_DEFAULT_R 4096
  2218. #define SYMV_P 16
  2219. #endif
  2220. #ifdef CORTEXA15
  2221. #define SNUMOPT 2
  2222. #define DNUMOPT 2
  2223. #define GEMM_DEFAULT_OFFSET_A 0
  2224. #define GEMM_DEFAULT_OFFSET_B 0
  2225. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2226. #define SGEMM_DEFAULT_UNROLL_M 4
  2227. #define SGEMM_DEFAULT_UNROLL_N 4
  2228. #define DGEMM_DEFAULT_UNROLL_M 4
  2229. #define DGEMM_DEFAULT_UNROLL_N 4
  2230. #define CGEMM_DEFAULT_UNROLL_M 2
  2231. #define CGEMM_DEFAULT_UNROLL_N 2
  2232. #define ZGEMM_DEFAULT_UNROLL_M 2
  2233. #define ZGEMM_DEFAULT_UNROLL_N 2
  2234. #define SGEMM_DEFAULT_P 128
  2235. #define DGEMM_DEFAULT_P 128
  2236. #define CGEMM_DEFAULT_P 96
  2237. #define ZGEMM_DEFAULT_P 64
  2238. #define SGEMM_DEFAULT_Q 240
  2239. #define DGEMM_DEFAULT_Q 120
  2240. #define CGEMM_DEFAULT_Q 120
  2241. #define ZGEMM_DEFAULT_Q 120
  2242. #define SGEMM_DEFAULT_R 12288
  2243. #define DGEMM_DEFAULT_R 8192
  2244. #define CGEMM_DEFAULT_R 4096
  2245. #define ZGEMM_DEFAULT_R 4096
  2246. #define SYMV_P 16
  2247. #endif
  2248. #if defined(ZARCH_GENERIC)
  2249. #define SNUMOPT 2
  2250. #define DNUMOPT 2
  2251. #define GEMM_DEFAULT_OFFSET_A 0
  2252. #define GEMM_DEFAULT_OFFSET_B 0
  2253. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2254. #define SGEMM_DEFAULT_UNROLL_M 2
  2255. #define SGEMM_DEFAULT_UNROLL_N 2
  2256. #define DGEMM_DEFAULT_UNROLL_M 2
  2257. #define DGEMM_DEFAULT_UNROLL_N 2
  2258. #define CGEMM_DEFAULT_UNROLL_M 2
  2259. #define CGEMM_DEFAULT_UNROLL_N 2
  2260. #define ZGEMM_DEFAULT_UNROLL_M 2
  2261. #define ZGEMM_DEFAULT_UNROLL_N 2
  2262. #define SGEMM_DEFAULT_P 128
  2263. #define DGEMM_DEFAULT_P 128
  2264. #define CGEMM_DEFAULT_P 96
  2265. #define ZGEMM_DEFAULT_P 64
  2266. #define SGEMM_DEFAULT_Q 240
  2267. #define DGEMM_DEFAULT_Q 120
  2268. #define CGEMM_DEFAULT_Q 120
  2269. #define ZGEMM_DEFAULT_Q 120
  2270. #define SGEMM_DEFAULT_R 12288
  2271. #define DGEMM_DEFAULT_R 8192
  2272. #define CGEMM_DEFAULT_R 4096
  2273. #define ZGEMM_DEFAULT_R 4096
  2274. #define SYMV_P 16
  2275. #endif
  2276. #if defined(Z13)
  2277. #define SNUMOPT 2
  2278. #define DNUMOPT 2
  2279. #define GEMM_DEFAULT_OFFSET_A 0
  2280. #define GEMM_DEFAULT_OFFSET_B 0
  2281. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2282. #define SGEMM_DEFAULT_UNROLL_M 8
  2283. #define SGEMM_DEFAULT_UNROLL_N 4
  2284. #define DGEMM_DEFAULT_UNROLL_M 8
  2285. #define DGEMM_DEFAULT_UNROLL_N 4
  2286. #define CGEMM_DEFAULT_UNROLL_M 4
  2287. #define CGEMM_DEFAULT_UNROLL_N 4
  2288. #define ZGEMM_DEFAULT_UNROLL_M 4
  2289. #define ZGEMM_DEFAULT_UNROLL_N 4
  2290. #define SGEMM_DEFAULT_P 456
  2291. #define DGEMM_DEFAULT_P 320
  2292. #define CGEMM_DEFAULT_P 480
  2293. #define ZGEMM_DEFAULT_P 224
  2294. #define SGEMM_DEFAULT_Q 488
  2295. #define DGEMM_DEFAULT_Q 384
  2296. #define CGEMM_DEFAULT_Q 128
  2297. #define ZGEMM_DEFAULT_Q 352
  2298. #define SGEMM_DEFAULT_R 8192
  2299. #define DGEMM_DEFAULT_R 4096
  2300. #define CGEMM_DEFAULT_R 4096
  2301. #define ZGEMM_DEFAULT_R 2048
  2302. #define SYMV_P 16
  2303. #endif
  2304. #if defined(Z14)
  2305. #define SNUMOPT 2
  2306. #define DNUMOPT 2
  2307. #define GEMM_DEFAULT_OFFSET_A 0
  2308. #define GEMM_DEFAULT_OFFSET_B 0
  2309. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2310. #define SGEMM_DEFAULT_UNROLL_M 8
  2311. #define SGEMM_DEFAULT_UNROLL_N 4
  2312. #define DGEMM_DEFAULT_UNROLL_M 8
  2313. #define DGEMM_DEFAULT_UNROLL_N 4
  2314. #define CGEMM_DEFAULT_UNROLL_M 4
  2315. #define CGEMM_DEFAULT_UNROLL_N 4
  2316. #define ZGEMM_DEFAULT_UNROLL_M 4
  2317. #define ZGEMM_DEFAULT_UNROLL_N 4
  2318. #define SGEMM_DEFAULT_P 456
  2319. #define DGEMM_DEFAULT_P 320
  2320. #define CGEMM_DEFAULT_P 480
  2321. #define ZGEMM_DEFAULT_P 224
  2322. #define SGEMM_DEFAULT_Q 488
  2323. #define DGEMM_DEFAULT_Q 384
  2324. #define CGEMM_DEFAULT_Q 128
  2325. #define ZGEMM_DEFAULT_Q 352
  2326. #define SGEMM_DEFAULT_R 8192
  2327. #define DGEMM_DEFAULT_R 4096
  2328. #define CGEMM_DEFAULT_R 4096
  2329. #define ZGEMM_DEFAULT_R 2048
  2330. #define SYMV_P 16
  2331. #endif
  2332. #ifdef GENERIC
  2333. #define SNUMOPT 2
  2334. #define DNUMOPT 2
  2335. #define GEMM_DEFAULT_OFFSET_A 0
  2336. #define GEMM_DEFAULT_OFFSET_B 0
  2337. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2338. #define SGEMM_DEFAULT_UNROLL_N 2
  2339. #define DGEMM_DEFAULT_UNROLL_N 2
  2340. #define QGEMM_DEFAULT_UNROLL_N 2
  2341. #define CGEMM_DEFAULT_UNROLL_N 2
  2342. #define ZGEMM_DEFAULT_UNROLL_N 2
  2343. #define XGEMM_DEFAULT_UNROLL_N 1
  2344. #ifdef ARCH_X86
  2345. #define SGEMM_DEFAULT_UNROLL_M 2
  2346. #define DGEMM_DEFAULT_UNROLL_M 2
  2347. #define QGEMM_DEFAULT_UNROLL_M 2
  2348. #define CGEMM_DEFAULT_UNROLL_M 2
  2349. #define ZGEMM_DEFAULT_UNROLL_M 2
  2350. #define XGEMM_DEFAULT_UNROLL_M 1
  2351. #else
  2352. #define SGEMM_DEFAULT_UNROLL_M 2
  2353. #define DGEMM_DEFAULT_UNROLL_M 2
  2354. #define QGEMM_DEFAULT_UNROLL_M 2
  2355. #define CGEMM_DEFAULT_UNROLL_M 2
  2356. #define ZGEMM_DEFAULT_UNROLL_M 2
  2357. #define XGEMM_DEFAULT_UNROLL_M 1
  2358. #endif
  2359. #define SGEMM_DEFAULT_P sgemm_p
  2360. #define DGEMM_DEFAULT_P dgemm_p
  2361. #define QGEMM_DEFAULT_P qgemm_p
  2362. #define CGEMM_DEFAULT_P cgemm_p
  2363. #define ZGEMM_DEFAULT_P zgemm_p
  2364. #define XGEMM_DEFAULT_P xgemm_p
  2365. #define SGEMM_DEFAULT_R sgemm_r
  2366. #define DGEMM_DEFAULT_R dgemm_r
  2367. #define QGEMM_DEFAULT_R qgemm_r
  2368. #define CGEMM_DEFAULT_R cgemm_r
  2369. #define ZGEMM_DEFAULT_R zgemm_r
  2370. #define XGEMM_DEFAULT_R xgemm_r
  2371. #define SGEMM_DEFAULT_Q 128
  2372. #define DGEMM_DEFAULT_Q 128
  2373. #define QGEMM_DEFAULT_Q 128
  2374. #define CGEMM_DEFAULT_Q 128
  2375. #define ZGEMM_DEFAULT_Q 128
  2376. #define XGEMM_DEFAULT_Q 128
  2377. #define SYMV_P 16
  2378. #endif
  2379. #ifndef QGEMM_DEFAULT_UNROLL_M
  2380. #define QGEMM_DEFAULT_UNROLL_M 2
  2381. #endif
  2382. #ifndef QGEMM_DEFAULT_UNROLL_N
  2383. #define QGEMM_DEFAULT_UNROLL_N 2
  2384. #endif
  2385. #ifndef XGEMM_DEFAULT_UNROLL_M
  2386. #define XGEMM_DEFAULT_UNROLL_M 2
  2387. #endif
  2388. #ifndef XGEMM_DEFAULT_UNROLL_N
  2389. #define XGEMM_DEFAULT_UNROLL_N 2
  2390. #endif
  2391. #ifndef HAVE_SSE2
  2392. #define SHUFPD_0 shufps $0x44,
  2393. #define SHUFPD_1 shufps $0x4e,
  2394. #define SHUFPD_2 shufps $0xe4,
  2395. #define SHUFPD_3 shufps $0xee,
  2396. #endif
  2397. #ifndef SHUFPD_0
  2398. #define SHUFPD_0 shufpd $0,
  2399. #endif
  2400. #ifndef SHUFPD_1
  2401. #define SHUFPD_1 shufpd $1,
  2402. #endif
  2403. #ifndef SHUFPD_2
  2404. #define SHUFPD_2 shufpd $2,
  2405. #endif
  2406. #ifndef SHUFPD_3
  2407. #define SHUFPD_3 shufpd $3,
  2408. #endif
  2409. #ifndef SHUFPS_39
  2410. #define SHUFPS_39 shufps $0x39,
  2411. #endif
  2412. #endif