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.

getarch.c 71 kB

6 years ago
3 months ago
14 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
10 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
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
6 years ago
6 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144
  1. /*****************************************************************************
  2. Copyright (c) 2011-2014, 2025 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. #if defined(__WIN32__) || defined(__WIN64__) || defined(__CYGWIN32__) || defined(__CYGWIN64__) || defined(_WIN32) || defined(_WIN64)
  66. #define OS_WINDOWS
  67. #endif
  68. #if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)
  69. #define INTEL_AMD
  70. #endif
  71. #include <stdio.h>
  72. #include <string.h>
  73. #ifdef OS_WINDOWS
  74. #include <windows.h>
  75. #endif
  76. #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
  77. #include <sys/types.h>
  78. #include <sys/sysctl.h>
  79. #endif
  80. #if defined(linux) || defined(__sun__)
  81. #include <sys/sysinfo.h>
  82. #include <unistd.h>
  83. #endif
  84. #if defined(_AIX)
  85. #include <unistd.h>
  86. #include <sys/systemcfg.h>
  87. #include <sys/sysinfo.h>
  88. #endif
  89. /* #define FORCE_P2 */
  90. /* #define FORCE_KATMAI */
  91. /* #define FORCE_COPPERMINE */
  92. /* #define FORCE_NORTHWOOD */
  93. /* #define FORCE_PRESCOTT */
  94. /* #define FORCE_BANIAS */
  95. /* #define FORCE_YONAH */
  96. /* #define FORCE_CORE2 */
  97. /* #define FORCE_PENRYN */
  98. /* #define FORCE_DUNNINGTON */
  99. /* #define FORCE_NEHALEM */
  100. /* #define FORCE_SANDYBRIDGE */
  101. /* #define FORCE_ATOM */
  102. /* #define FORCE_ATHLON */
  103. /* #define FORCE_OPTERON */
  104. /* #define FORCE_OPTERON_SSE3 */
  105. /* #define FORCE_BARCELONA */
  106. /* #define FORCE_SHANGHAI */
  107. /* #define FORCE_ISTANBUL */
  108. /* #define FORCE_BOBCAT */
  109. /* #define FORCE_BULLDOZER */
  110. /* #define FORCE_PILEDRIVER */
  111. /* #define FORCE_SSE_GENERIC */
  112. /* #define FORCE_VIAC3 */
  113. /* #define FORCE_NANO */
  114. /* #define FORCE_POWER3 */
  115. /* #define FORCE_POWER4 */
  116. /* #define FORCE_POWER5 */
  117. /* #define FORCE_POWER6 */
  118. /* #define FORCE_POWER7 */
  119. /* #define FORCE_POWER8 */
  120. /* #define FORCE_PPCG4 */
  121. /* #define FORCE_PPC970 */
  122. /* #define FORCE_PPC970MP */
  123. /* #define FORCE_PPC440 */
  124. /* #define FORCE_PPC440FP2 */
  125. /* #define FORCE_CELL */
  126. /* #define FORCE_MIPS64_GENERIC */
  127. /* #define FORCE_SICORTEX */
  128. /* #define FORCE_LOONGSON3R3 */
  129. /* #define FORCE_LOONGSON3R4 */
  130. /* #define FORCE_LOONGSON3R5 */
  131. /* #define FORCE_LOONGSON2K1000 */
  132. /* #define FORCE_LOONGSONGENERIC */
  133. /* #define FORCE_LA64_GENERIC */
  134. /* #define FORCE_LA264 */
  135. /* #define FORCE_LA464 */
  136. /* #define FORCE_I6400 */
  137. /* #define FORCE_P6600 */
  138. /* #define FORCE_P5600 */
  139. /* #define FORCE_I6500 */
  140. /* #define FORCE_ITANIUM2 */
  141. /* #define FORCE_SPARC */
  142. /* #define FORCE_SPARCV7 */
  143. /* #define FORCE_ZARCH_GENERIC */
  144. /* #define FORCE_Z13 */
  145. /* #define FORCE_EV4 */
  146. /* #define FORCE_EV5 */
  147. /* #define FORCE_EV6 */
  148. /* #define FORCE_CSKY */
  149. /* #define FORCE_CK860FV */
  150. /* #define FORCE_GENERIC */
  151. /* #define FORCE_AMPERE1 */
  152. #ifdef FORCE_P2
  153. #define FORCE
  154. #define FORCE_INTEL
  155. #define ARCHITECTURE "X86"
  156. #define SUBARCHITECTURE "PENTIUM2"
  157. #define ARCHCONFIG "-DPENTIUM2 " \
  158. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  159. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  160. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  161. "-DHAVE_CMOV -DHAVE_MMX"
  162. #define LIBNAME "p2"
  163. #define CORENAME "P5"
  164. #endif
  165. #ifdef FORCE_KATMAI
  166. #define FORCE
  167. #define FORCE_INTEL
  168. #define ARCHITECTURE "X86"
  169. #define SUBARCHITECTURE "PENTIUM3"
  170. #define ARCHCONFIG "-DPENTIUM3 " \
  171. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  172. "-DL2_SIZE=524288 -DL2_LINESIZE=32 " \
  173. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  174. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE "
  175. #define LIBNAME "katmai"
  176. #define CORENAME "KATMAI"
  177. #endif
  178. #ifdef FORCE_COPPERMINE
  179. #define FORCE
  180. #define FORCE_INTEL
  181. #define ARCHITECTURE "X86"
  182. #define SUBARCHITECTURE "PENTIUM3"
  183. #define ARCHCONFIG "-DPENTIUM3 " \
  184. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  185. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  186. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  187. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE "
  188. #define LIBNAME "coppermine"
  189. #define CORENAME "COPPERMINE"
  190. #endif
  191. #ifdef FORCE_NORTHWOOD
  192. #define FORCE
  193. #define FORCE_INTEL
  194. #define ARCHITECTURE "X86"
  195. #define SUBARCHITECTURE "PENTIUM4"
  196. #define ARCHCONFIG "-DPENTIUM4 " \
  197. "-DL1_DATA_SIZE=8192 -DL1_DATA_LINESIZE=64 " \
  198. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  199. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  200. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  201. #define LIBNAME "northwood"
  202. #define CORENAME "NORTHWOOD"
  203. #endif
  204. #ifdef FORCE_PRESCOTT
  205. #define FORCE
  206. #define FORCE_INTEL
  207. #define ARCHITECTURE "X86"
  208. #define SUBARCHITECTURE "PENTIUM4"
  209. #define ARCHCONFIG "-DPENTIUM4 " \
  210. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  211. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  212. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  213. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3"
  214. #define LIBNAME "prescott"
  215. #define CORENAME "PRESCOTT"
  216. #endif
  217. #ifdef FORCE_BANIAS
  218. #define FORCE
  219. #define FORCE_INTEL
  220. #define ARCHITECTURE "X86"
  221. #define SUBARCHITECTURE "BANIAS"
  222. #define ARCHCONFIG "-DPENTIUMM " \
  223. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  224. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  225. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  226. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  227. #define LIBNAME "banias"
  228. #define CORENAME "BANIAS"
  229. #endif
  230. #ifdef FORCE_YONAH
  231. #define FORCE
  232. #define FORCE_INTEL
  233. #define ARCHITECTURE "X86"
  234. #define SUBARCHITECTURE "YONAH"
  235. #define ARCHCONFIG "-DPENTIUMM " \
  236. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  237. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  238. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  239. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  240. #define LIBNAME "yonah"
  241. #define CORENAME "YONAH"
  242. #endif
  243. #ifdef FORCE_CORE2
  244. #define FORCE
  245. #define FORCE_INTEL
  246. #define ARCHITECTURE "X86"
  247. #define SUBARCHITECTURE "CONRORE"
  248. #define ARCHCONFIG "-DCORE2 " \
  249. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  250. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  251. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 " \
  252. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3"
  253. #define LIBNAME "core2"
  254. #define CORENAME "CORE2"
  255. #endif
  256. #ifdef FORCE_PENRYN
  257. #define FORCE
  258. #define FORCE_INTEL
  259. #define ARCHITECTURE "X86"
  260. #define SUBARCHITECTURE "PENRYN"
  261. #define ARCHCONFIG "-DPENRYN " \
  262. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  263. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  264. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 " \
  265. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1"
  266. #define LIBNAME "penryn"
  267. #define CORENAME "PENRYN"
  268. #endif
  269. #ifdef FORCE_DUNNINGTON
  270. #define FORCE
  271. #define FORCE_INTEL
  272. #define ARCHITECTURE "X86"
  273. #define SUBARCHITECTURE "DUNNINGTON"
  274. #define ARCHCONFIG "-DDUNNINGTON " \
  275. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  276. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  277. "-DL3_SIZE=16777216 -DL3_LINESIZE=64 " \
  278. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 " \
  279. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1"
  280. #define LIBNAME "dunnington"
  281. #define CORENAME "DUNNINGTON"
  282. #endif
  283. #ifdef FORCE_NEHALEM
  284. #define FORCE
  285. #define FORCE_INTEL
  286. #define ARCHITECTURE "X86"
  287. #define SUBARCHITECTURE "NEHALEM"
  288. #define ARCHCONFIG "-DNEHALEM " \
  289. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  290. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  291. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  292. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  293. #define LIBNAME "nehalem"
  294. #define CORENAME "NEHALEM"
  295. #endif
  296. #ifdef FORCE_SANDYBRIDGE
  297. #define FORCE
  298. #define FORCE_INTEL
  299. #define ARCHITECTURE "X86"
  300. #ifdef NO_AVX
  301. #define SUBARCHITECTURE "NEHALEM"
  302. #define ARCHCONFIG "-DNEHALEM " \
  303. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  304. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  305. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  306. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  307. #define LIBNAME "nehalem"
  308. #define CORENAME "NEHALEM"
  309. #else
  310. #define SUBARCHITECTURE "SANDYBRIDGE"
  311. #define ARCHCONFIG "-DSANDYBRIDGE " \
  312. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  313. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  314. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  315. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  316. #define LIBNAME "sandybridge"
  317. #define CORENAME "SANDYBRIDGE"
  318. #endif
  319. #endif
  320. #ifdef FORCE_HASWELL
  321. #define FORCE
  322. #define FORCE_INTEL
  323. #define ARCHITECTURE "X86"
  324. #ifdef NO_AVX2
  325. #ifdef NO_AVX
  326. #define SUBARCHITECTURE "NEHALEM"
  327. #define ARCHCONFIG "-DNEHALEM " \
  328. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  329. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  330. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  331. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  332. #define LIBNAME "nehalem"
  333. #define CORENAME "NEHALEM"
  334. #else
  335. #define SUBARCHITECTURE "SANDYBRIDGE"
  336. #define ARCHCONFIG "-DSANDYBRIDGE " \
  337. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  338. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  339. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  340. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  341. #define LIBNAME "sandybridge"
  342. #define CORENAME "SANDYBRIDGE"
  343. #endif
  344. #else
  345. #define SUBARCHITECTURE "HASWELL"
  346. #define ARCHCONFIG "-DHASWELL " \
  347. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  348. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  349. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  350. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  351. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  352. #define LIBNAME "haswell"
  353. #define CORENAME "HASWELL"
  354. #endif
  355. #endif
  356. #ifdef FORCE_SKYLAKEX
  357. #define FORCE
  358. #define FORCE_INTEL
  359. #define ARCHITECTURE "X86"
  360. #ifdef NO_AVX512
  361. #ifdef NO_AVX2
  362. #ifdef NO_AVX
  363. #define SUBARCHITECTURE "NEHALEM"
  364. #define ARCHCONFIG "-DNEHALEM " \
  365. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  366. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  367. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  368. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  369. #define LIBNAME "nehalem"
  370. #define CORENAME "NEHALEM"
  371. #else
  372. #define SUBARCHITECTURE "SANDYBRIDGE"
  373. #define ARCHCONFIG "-DSANDYBRIDGE " \
  374. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  375. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  376. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  377. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  378. #define LIBNAME "sandybridge"
  379. #define CORENAME "SANDYBRIDGE"
  380. #endif
  381. #else
  382. #define SUBARCHITECTURE "HASWELL"
  383. #define ARCHCONFIG "-DHASWELL " \
  384. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  385. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  386. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  387. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  388. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  389. #define LIBNAME "haswell"
  390. #define CORENAME "HASWELL"
  391. #endif
  392. #else
  393. #define SUBARCHITECTURE "SKYLAKEX"
  394. #define ARCHCONFIG "-DSKYLAKEX " \
  395. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  396. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  397. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  398. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  399. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3 -DHAVE_AVX512VL -march=skylake-avx512"
  400. #define LIBNAME "skylakex"
  401. #define CORENAME "SKYLAKEX"
  402. #endif
  403. #endif
  404. #ifdef FORCE_COOPERLAKE
  405. #define FORCE
  406. #define FORCE_INTEL
  407. #define ARCHITECTURE "X86"
  408. #ifdef NO_AVX512
  409. #ifdef NO_AVX2
  410. #ifdef NO_AVX
  411. #define SUBARCHITECTURE "NEHALEM"
  412. #define ARCHCONFIG "-DNEHALEM " \
  413. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  414. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  415. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  416. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  417. #define LIBNAME "nehalem"
  418. #define CORENAME "NEHALEM"
  419. #else
  420. #define SUBARCHITECTURE "SANDYBRIDGE"
  421. #define ARCHCONFIG "-DSANDYBRIDGE " \
  422. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  423. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  424. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  425. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  426. #define LIBNAME "sandybridge"
  427. #define CORENAME "SANDYBRIDGE"
  428. #endif
  429. #else
  430. #define SUBARCHITECTURE "HASWELL"
  431. #define ARCHCONFIG "-DHASWELL " \
  432. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  433. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  434. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  435. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  436. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  437. #define LIBNAME "haswell"
  438. #define CORENAME "HASWELL"
  439. #endif
  440. #else
  441. #define SUBARCHITECTURE "COOPERLAKE"
  442. #define ARCHCONFIG "-DCOOPERLAKE " \
  443. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  444. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  445. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  446. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  447. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3 -DHAVE_AVX512VL -DHAVE_AVX512BF16 -march=cooperlake"
  448. #define LIBNAME "cooperlake"
  449. #define CORENAME "COOPERLAKE"
  450. #endif
  451. #endif
  452. #ifdef FORCE_SAPPHIRERAPIDS
  453. #define FORCE
  454. #define FORCE_INTEL
  455. #define ARCHITECTURE "X86"
  456. #ifdef NO_AVX512
  457. #ifdef NO_AVX2
  458. #ifdef NO_AVX
  459. #define SUBARCHITECTURE "NEHALEM"
  460. #define ARCHCONFIG "-DNEHALEM " \
  461. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  462. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  463. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  464. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  465. #define LIBNAME "nehalem"
  466. #define CORENAME "NEHALEM"
  467. #else
  468. #define SUBARCHITECTURE "SANDYBRIDGE"
  469. #define ARCHCONFIG "-DSANDYBRIDGE " \
  470. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  471. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  472. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  473. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  474. #define LIBNAME "sandybridge"
  475. #define CORENAME "SANDYBRIDGE"
  476. #endif
  477. #else
  478. #define SUBARCHITECTURE "HASWELL"
  479. #define ARCHCONFIG "-DHASWELL " \
  480. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  481. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  482. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  483. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  484. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  485. #define LIBNAME "haswell"
  486. #define CORENAME "HASWELL"
  487. #endif
  488. #else
  489. #define SUBARCHITECTURE "SAPPHIRERAPIDS"
  490. #define ARCHCONFIG "-DSAPPHIRERAPIDS " \
  491. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  492. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  493. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  494. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  495. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3 -DHAVE_AVX512VL -DHAVE_AVX512BF16 -march=sapphirerapids"
  496. #define LIBNAME "sapphirerapids"
  497. #define CORENAME "SAPPHIRERAPIDS"
  498. #endif
  499. #endif
  500. #ifdef FORCE_ATOM
  501. #define FORCE
  502. #define FORCE_INTEL
  503. #define ARCHITECTURE "X86"
  504. #define SUBARCHITECTURE "ATOM"
  505. #define ARCHCONFIG "-DATOM " \
  506. "-DL1_DATA_SIZE=24576 -DL1_DATA_LINESIZE=64 " \
  507. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  508. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  509. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3"
  510. #define LIBNAME "atom"
  511. #define CORENAME "ATOM"
  512. #endif
  513. #ifdef FORCE_ATHLON
  514. #define FORCE
  515. #define FORCE_INTEL
  516. #define ARCHITECTURE "X86"
  517. #define SUBARCHITECTURE "ATHLON"
  518. #define ARCHCONFIG "-DATHLON " \
  519. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  520. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  521. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DHAVE_3DNOW " \
  522. "-DHAVE_3DNOWEX -DHAVE_MMX -DHAVE_SSE "
  523. #define LIBNAME "athlon"
  524. #define CORENAME "ATHLON"
  525. #endif
  526. #ifdef FORCE_OPTERON
  527. #define FORCE
  528. #define FORCE_INTEL
  529. #define ARCHITECTURE "X86"
  530. #define SUBARCHITECTURE "OPTERON"
  531. #define ARCHCONFIG "-DOPTERON " \
  532. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  533. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  534. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DHAVE_3DNOW " \
  535. "-DHAVE_3DNOWEX -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  536. #define LIBNAME "opteron"
  537. #define CORENAME "OPTERON"
  538. #endif
  539. #ifdef FORCE_OPTERON_SSE3
  540. #define FORCE
  541. #define FORCE_INTEL
  542. #define ARCHITECTURE "X86"
  543. #define SUBARCHITECTURE "OPTERON"
  544. #define ARCHCONFIG "-DOPTERON " \
  545. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  546. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  547. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DHAVE_3DNOW " \
  548. "-DHAVE_3DNOWEX -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3"
  549. #define LIBNAME "opteron"
  550. #define CORENAME "OPTERON"
  551. #endif
  552. #if defined(FORCE_BARCELONA) || defined(FORCE_SHANGHAI) || defined(FORCE_ISTANBUL)
  553. #define FORCE
  554. #define FORCE_INTEL
  555. #define ARCHITECTURE "X86"
  556. #define SUBARCHITECTURE "BARCELONA"
  557. #define ARCHCONFIG "-DBARCELONA " \
  558. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  559. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL3_SIZE=2097152 " \
  560. "-DDTB_DEFAULT_ENTRIES=48 -DDTB_SIZE=4096 " \
  561. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 " \
  562. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU"
  563. #define LIBNAME "barcelona"
  564. #define CORENAME "BARCELONA"
  565. #endif
  566. #if defined(FORCE_BOBCAT)
  567. #define FORCE
  568. #define FORCE_INTEL
  569. #define ARCHITECTURE "X86"
  570. #define SUBARCHITECTURE "BOBCAT"
  571. #define ARCHCONFIG "-DBOBCAT " \
  572. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  573. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  574. "-DDTB_DEFAULT_ENTRIES=40 -DDTB_SIZE=4096 " \
  575. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 " \
  576. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_CFLUSH -DHAVE_CMOV"
  577. #define LIBNAME "bobcat"
  578. #define CORENAME "BOBCAT"
  579. #endif
  580. #if defined (FORCE_BULLDOZER)
  581. #define FORCE
  582. #define FORCE_INTEL
  583. #define ARCHITECTURE "X86"
  584. #define SUBARCHITECTURE "BULLDOZER"
  585. #define ARCHCONFIG "-DBULLDOZER " \
  586. "-DL1_DATA_SIZE=49152 -DL1_DATA_LINESIZE=64 " \
  587. "-DL2_SIZE=1024000 -DL2_LINESIZE=64 -DL3_SIZE=16777216 " \
  588. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 " \
  589. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 " \
  590. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU " \
  591. "-DHAVE_AVX"
  592. #define LIBNAME "bulldozer"
  593. #define CORENAME "BULLDOZER"
  594. #endif
  595. #if defined (FORCE_PILEDRIVER)
  596. #define FORCE
  597. #define FORCE_INTEL
  598. #define ARCHITECTURE "X86"
  599. #define SUBARCHITECTURE "PILEDRIVER"
  600. #define ARCHCONFIG "-DPILEDRIVER " \
  601. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  602. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL3_SIZE=12582912 " \
  603. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  604. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  605. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  606. "-DHAVE_AVX -DHAVE_FMA3"
  607. #define LIBNAME "piledriver"
  608. #define CORENAME "PILEDRIVER"
  609. #endif
  610. #if defined (FORCE_STEAMROLLER)
  611. #define FORCE
  612. #define FORCE_INTEL
  613. #define ARCHITECTURE "X86"
  614. #define SUBARCHITECTURE "STEAMROLLER"
  615. #define ARCHCONFIG "-DSTEAMROLLER " \
  616. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  617. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL3_SIZE=12582912 " \
  618. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  619. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  620. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  621. "-DHAVE_AVX -DHAVE_FMA3"
  622. #define LIBNAME "steamroller"
  623. #define CORENAME "STEAMROLLER"
  624. #endif
  625. #if defined (FORCE_EXCAVATOR)
  626. #define FORCE
  627. #define FORCE_INTEL
  628. #define ARCHITECTURE "X86"
  629. #define SUBARCHITECTURE "EXCAVATOR"
  630. #define ARCHCONFIG "-DEXCAVATOR " \
  631. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  632. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL3_SIZE=12582912 " \
  633. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  634. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  635. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  636. "-DHAVE_AVX -DHAVE_FMA3"
  637. #define LIBNAME "excavator"
  638. #define CORENAME "EXCAVATOR"
  639. #endif
  640. #if defined (FORCE_ZEN)
  641. #define FORCE
  642. #define FORCE_INTEL
  643. #define ARCHITECTURE "X86"
  644. #ifdef NO_AVX2
  645. #ifdef NO_AVX
  646. #define SUBARCHITECTURE "NEHALEM"
  647. #define ARCHCONFIG "-DNEHALEM " \
  648. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  649. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  650. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  651. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  652. #define LIBNAME "nehalem"
  653. #define CORENAME "NEHALEM"
  654. #else
  655. #define SUBARCHITECTURE "SANDYBRIDGE"
  656. #define ARCHCONFIG "-DSANDYBRIDGE " \
  657. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  658. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  659. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  660. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  661. #define LIBNAME "sandybridge"
  662. #define CORENAME "SANDYBRIDGE"
  663. #endif
  664. #else
  665. #define SUBARCHITECTURE "ZEN"
  666. #define ARCHCONFIG "-DZEN " \
  667. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  668. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL2_CODE_ASSOCIATIVE=8 " \
  669. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  670. "-DL3_SIZE=16777216 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=8 " \
  671. "-DITB_DEFAULT_ENTRIES=64 -DITB_SIZE=4096 " \
  672. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  673. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  674. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  675. "-DHAVE_AVX -DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  676. #define LIBNAME "zen"
  677. #define CORENAME "ZEN"
  678. #endif
  679. #endif
  680. #ifdef FORCE_SSE_GENERIC
  681. #define FORCE
  682. #define FORCE_INTEL
  683. #define ARCHITECTURE "X86"
  684. #define SUBARCHITECTURE "GENERIC"
  685. #define ARCHCONFIG "-DGENERIC " \
  686. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  687. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  688. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  689. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2"
  690. #define LIBNAME "generic"
  691. #define CORENAME "GENERIC"
  692. #endif
  693. #ifdef FORCE_VIAC3
  694. #define FORCE
  695. #define FORCE_INTEL
  696. #define ARCHITECTURE "X86"
  697. #define SUBARCHITECTURE "VIAC3"
  698. #define ARCHCONFIG "-DVIAC3 " \
  699. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  700. "-DL2_SIZE=65536 -DL2_LINESIZE=32 " \
  701. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 " \
  702. "-DHAVE_MMX -DHAVE_SSE "
  703. #define LIBNAME "viac3"
  704. #define CORENAME "VIAC3"
  705. #endif
  706. #ifdef FORCE_NANO
  707. #define FORCE
  708. #define FORCE_INTEL
  709. #define ARCHITECTURE "X86"
  710. #define SUBARCHITECTURE "NANO"
  711. #define ARCHCONFIG "-DNANO " \
  712. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  713. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  714. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  715. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3"
  716. #define LIBNAME "nano"
  717. #define CORENAME "NANO"
  718. #endif
  719. #ifdef FORCE_POWER3
  720. #define FORCE
  721. #define ARCHITECTURE "POWER"
  722. #define SUBARCHITECTURE "POWER3"
  723. #define SUBDIRNAME "power"
  724. #define ARCHCONFIG "-DPOWER3 " \
  725. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=128 " \
  726. "-DL2_SIZE=2097152 -DL2_LINESIZE=128 " \
  727. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  728. #define LIBNAME "power3"
  729. #define CORENAME "POWER3"
  730. #endif
  731. #ifdef FORCE_POWER4
  732. #define FORCE
  733. #define ARCHITECTURE "POWER"
  734. #define SUBARCHITECTURE "POWER4"
  735. #define SUBDIRNAME "power"
  736. #define ARCHCONFIG "-DPOWER4 " \
  737. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  738. "-DL2_SIZE=1509949 -DL2_LINESIZE=128 " \
  739. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=6 "
  740. #define LIBNAME "power4"
  741. #define CORENAME "POWER4"
  742. #endif
  743. #ifdef FORCE_POWER5
  744. #define FORCE
  745. #define ARCHITECTURE "POWER"
  746. #define SUBARCHITECTURE "POWER5"
  747. #define SUBDIRNAME "power"
  748. #define ARCHCONFIG "-DPOWER5 " \
  749. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  750. "-DL2_SIZE=1509949 -DL2_LINESIZE=128 " \
  751. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=6 "
  752. #define LIBNAME "power5"
  753. #define CORENAME "POWER5"
  754. #endif
  755. #if defined(FORCE_POWER6) || defined(FORCE_POWER7)
  756. #define FORCE
  757. #define ARCHITECTURE "POWER"
  758. #define SUBARCHITECTURE "POWER6"
  759. #define SUBDIRNAME "power"
  760. #define ARCHCONFIG "-DPOWER6 " \
  761. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=128 " \
  762. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  763. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  764. #define LIBNAME "power6"
  765. #define CORENAME "POWER6"
  766. #endif
  767. #if defined(FORCE_POWER8)
  768. #define FORCE
  769. #define ARCHITECTURE "POWER"
  770. #define SUBARCHITECTURE "POWER8"
  771. #define SUBDIRNAME "power"
  772. #define ARCHCONFIG "-DPOWER8 " \
  773. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=128 " \
  774. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  775. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  776. #define LIBNAME "power8"
  777. #define CORENAME "POWER8"
  778. #endif
  779. #if defined(FORCE_POWER9)
  780. #define FORCE
  781. #define ARCHITECTURE "POWER"
  782. #define SUBARCHITECTURE "POWER9"
  783. #define SUBDIRNAME "power"
  784. #define ARCHCONFIG "-DPOWER9 " \
  785. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  786. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  787. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  788. #define LIBNAME "power9"
  789. #define CORENAME "POWER9"
  790. #endif
  791. #if defined(FORCE_POWER10) || (FORCE_POWER11)
  792. #define FORCE
  793. #define ARCHITECTURE "POWER"
  794. #define SUBARCHITECTURE "POWER10"
  795. #define SUBDIRNAME "power"
  796. #define ARCHCONFIG "-DPOWER10 " \
  797. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  798. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  799. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  800. #define LIBNAME "power10"
  801. #define CORENAME "POWER10"
  802. #endif
  803. #ifdef FORCE_PPCG4
  804. #define FORCE
  805. #define ARCHITECTURE "POWER"
  806. #define SUBARCHITECTURE "PPCG4"
  807. #define SUBDIRNAME "power"
  808. #define ARCHCONFIG "-DPPCG4 " \
  809. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  810. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  811. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  812. #define LIBNAME "ppcg4"
  813. #define CORENAME "PPCG4"
  814. #endif
  815. #ifdef FORCE_PPC970
  816. #define FORCE
  817. #define ARCHITECTURE "POWER"
  818. #define SUBARCHITECTURE "PPC970"
  819. #define SUBDIRNAME "power"
  820. #define ARCHCONFIG "-DPPC970 " \
  821. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  822. "-DL2_SIZE=512488 -DL2_LINESIZE=128 " \
  823. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  824. #define LIBNAME "ppc970"
  825. #define CORENAME "PPC970"
  826. #endif
  827. #ifdef FORCE_PPC970MP
  828. #define FORCE
  829. #define ARCHITECTURE "POWER"
  830. #define SUBARCHITECTURE "PPC970"
  831. #define SUBDIRNAME "power"
  832. #define ARCHCONFIG "-DPPC970 " \
  833. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  834. "-DL2_SIZE=1024976 -DL2_LINESIZE=128 " \
  835. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  836. #define LIBNAME "ppc970mp"
  837. #define CORENAME "PPC970"
  838. #endif
  839. #ifdef FORCE_PPC440
  840. #define FORCE
  841. #define ARCHITECTURE "POWER"
  842. #define SUBARCHITECTURE "PPC440"
  843. #define SUBDIRNAME "power"
  844. #define ARCHCONFIG "-DPPC440 " \
  845. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  846. "-DL2_SIZE=16384 -DL2_LINESIZE=128 " \
  847. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=16 "
  848. #define LIBNAME "ppc440"
  849. #define CORENAME "PPC440"
  850. #endif
  851. #ifdef FORCE_PPC440FP2
  852. #define FORCE
  853. #define ARCHITECTURE "POWER"
  854. #define SUBARCHITECTURE "PPC440FP2"
  855. #define SUBDIRNAME "power"
  856. #define ARCHCONFIG "-DPPC440FP2 " \
  857. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  858. "-DL2_SIZE=16384 -DL2_LINESIZE=128 " \
  859. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=16 "
  860. #define LIBNAME "ppc440FP2"
  861. #define CORENAME "PPC440FP2"
  862. #endif
  863. #ifdef FORCE_CELL
  864. #define FORCE
  865. #define ARCHITECTURE "POWER"
  866. #define SUBARCHITECTURE "CELL"
  867. #define SUBDIRNAME "power"
  868. #define ARCHCONFIG "-DCELL " \
  869. "-DL1_DATA_SIZE=262144 -DL1_DATA_LINESIZE=128 " \
  870. "-DL2_SIZE=512488 -DL2_LINESIZE=128 " \
  871. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  872. #define LIBNAME "cell"
  873. #define CORENAME "CELL"
  874. #endif
  875. #ifdef FORCE_MIPS64_GENERIC
  876. #define FORCE
  877. #define ARCHITECTURE "MIPS"
  878. #define SUBARCHITECTURE "MIPS64_GENERIC"
  879. #define SUBDIRNAME "mips64"
  880. #define ARCHCONFIG "-DMIPS64_GENERIC " \
  881. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  882. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  883. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  884. #define LIBNAME "mips64_generic"
  885. #define CORENAME "MIPS64_GENERIC"
  886. #else
  887. #endif
  888. #ifdef FORCE_SICORTEX
  889. #define FORCE
  890. #define ARCHITECTURE "MIPS"
  891. #define SUBARCHITECTURE "SICORTEX"
  892. #define SUBDIRNAME "mips"
  893. #define ARCHCONFIG "-DSICORTEX " \
  894. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  895. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  896. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  897. #define LIBNAME "mips"
  898. #define CORENAME "sicortex"
  899. #endif
  900. #if defined FORCE_LOONGSON3R3 || defined FORCE_LOONGSON3A || defined FORCE_LOONGSON3B
  901. #define FORCE
  902. #define ARCHITECTURE "MIPS"
  903. #define SUBARCHITECTURE "LOONGSON3R3"
  904. #define SUBDIRNAME "mips64"
  905. #define ARCHCONFIG "-DLOONGSON3R3 " \
  906. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  907. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  908. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  909. #define LIBNAME "loongson3r3"
  910. #define CORENAME "LOONGSON3R3"
  911. #else
  912. #endif
  913. #ifdef FORCE_LOONGSON3R4
  914. #define FORCE
  915. #define ARCHITECTURE "MIPS"
  916. #define SUBARCHITECTURE "LOONGSON3R4"
  917. #define SUBDIRNAME "mips64"
  918. #define ARCHCONFIG "-DLOONGSON3R4 " \
  919. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  920. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  921. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 -DHAVE_MSA"
  922. #define LIBNAME "loongson3r4"
  923. #define CORENAME "LOONGSON3R4"
  924. #else
  925. #endif
  926. #if defined(FORCE_LA464) || defined(FORCE_LOONGSON3R5)
  927. #define FORCE
  928. #define ARCHITECTURE "LOONGARCH"
  929. #ifdef NO_LASX
  930. #ifdef NO_LSX
  931. #define SUBARCHITECTURE "LA64_GENERIC"
  932. #define SUBDIRNAME "loongarch64"
  933. #define ARCHCONFIG "-DLA64_GENERIC " \
  934. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  935. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  936. "-DDTB_DEFAULT_ENTRIES=64 "
  937. #define LIBNAME "la64_generic"
  938. #define CORENAME "LA64_GENERIC"
  939. #else
  940. #define SUBARCHITECTURE "LA264"
  941. #define SUBDIRNAME "loongarch64"
  942. #define ARCHCONFIG "-DLA264 " \
  943. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  944. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  945. "-DDTB_DEFAULT_ENTRIES=64 "
  946. #define LIBNAME "la264"
  947. #define CORENAME "LA264"
  948. #endif
  949. #else
  950. #define SUBARCHITECTURE "LA464"
  951. #define SUBDIRNAME "loongarch64"
  952. #define ARCHCONFIG "-DLA464 " \
  953. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  954. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  955. "-DDTB_DEFAULT_ENTRIES=64 "
  956. #define LIBNAME "la464"
  957. #define CORENAME "LA464"
  958. #endif
  959. #endif
  960. #if defined(FORCE_LA264) || defined(FORCE_LOONGSON2K1000)
  961. #define FORCE
  962. #define ARCHITECTURE "LOONGARCH"
  963. #ifdef NO_LSX
  964. #define SUBARCHITECTURE "LA64_GENERIC"
  965. #define SUBDIRNAME "loongarch64"
  966. #define ARCHCONFIG "-DLA64_GENERIC " \
  967. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  968. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  969. "-DDTB_DEFAULT_ENTRIES=64 "
  970. #define LIBNAME "la64_generic"
  971. #define CORENAME "LA64_GENERIC"
  972. #else
  973. #define SUBARCHITECTURE "LA264"
  974. #define SUBDIRNAME "loongarch64"
  975. #define ARCHCONFIG "-DLA264 " \
  976. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  977. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  978. "-DDTB_DEFAULT_ENTRIES=64 "
  979. #define LIBNAME "la264"
  980. #define CORENAME "LA264"
  981. #endif
  982. #endif
  983. #if defined(FORCE_LA64_GENERIC) || defined(FORCE_LOONGSONGENERIC)
  984. #define FORCE
  985. #define ARCHITECTURE "LOONGARCH"
  986. #define SUBARCHITECTURE "LA64_GENERIC"
  987. #define SUBDIRNAME "loongarch64"
  988. #define ARCHCONFIG "-DLA64_GENERIC " \
  989. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  990. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  991. "-DDTB_DEFAULT_ENTRIES=64 "
  992. #define LIBNAME "la64_generic"
  993. #define CORENAME "LA64_GENERIC"
  994. #endif
  995. #ifdef FORCE_I6400
  996. #define FORCE
  997. #define ARCHITECTURE "MIPS"
  998. #define SUBARCHITECTURE "I6400"
  999. #define SUBDIRNAME "mips64"
  1000. #define ARCHCONFIG "-DI6400 " \
  1001. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1002. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1003. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 -DHAVE_MSA "
  1004. #define LIBNAME "i6400"
  1005. #define CORENAME "I6400"
  1006. #else
  1007. #endif
  1008. #ifdef FORCE_P6600
  1009. #define FORCE
  1010. #define ARCHITECTURE "MIPS"
  1011. #define SUBARCHITECTURE "P6600"
  1012. #define SUBDIRNAME "mips64"
  1013. #define ARCHCONFIG "-DP6600 " \
  1014. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1015. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1016. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  1017. #define LIBNAME "p6600"
  1018. #define CORENAME "P6600"
  1019. #else
  1020. #endif
  1021. #ifdef FORCE_P5600
  1022. #define FORCE
  1023. #define ARCHITECTURE "MIPS"
  1024. #define SUBARCHITECTURE "P5600"
  1025. #define SUBDIRNAME "mips"
  1026. #define ARCHCONFIG "-DP5600 " \
  1027. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1028. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1029. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8"
  1030. #define LIBNAME "p5600"
  1031. #define CORENAME "P5600"
  1032. #else
  1033. #endif
  1034. #ifdef FORCE_MIPS1004K
  1035. #define FORCE
  1036. #define ARCHITECTURE "MIPS"
  1037. #define SUBARCHITECTURE "MIPS1004K"
  1038. #define SUBDIRNAME "mips"
  1039. #define ARCHCONFIG "-DMIPS1004K " \
  1040. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1041. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  1042. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8"
  1043. #define LIBNAME "mips1004K"
  1044. #define CORENAME "MIPS1004K"
  1045. #else
  1046. #endif
  1047. #ifdef FORCE_MIPS24K
  1048. #define FORCE
  1049. #define ARCHITECTURE "MIPS"
  1050. #define SUBARCHITECTURE "MIPS24K"
  1051. #define SUBDIRNAME "mips"
  1052. #define ARCHCONFIG "-DMIPS24K " \
  1053. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1054. "-DL2_SIZE=32768 -DL2_LINESIZE=32 " \
  1055. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8"
  1056. #define LIBNAME "mips24K"
  1057. #define CORENAME "MIPS24K"
  1058. #else
  1059. #endif
  1060. #ifdef FORCE_I6500
  1061. #define FORCE
  1062. #define ARCHITECTURE "MIPS"
  1063. #define SUBARCHITECTURE "I6500"
  1064. #define SUBDIRNAME "mips64"
  1065. #define ARCHCONFIG "-DI6500 " \
  1066. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1067. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1068. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 -DHAVE_MSA"
  1069. #define LIBNAME "i6500"
  1070. #define CORENAME "I6500"
  1071. #else
  1072. #endif
  1073. #ifdef FORCE_ITANIUM2
  1074. #define FORCE
  1075. #define ARCHITECTURE "IA64"
  1076. #define SUBARCHITECTURE "ITANIUM2"
  1077. #define SUBDIRNAME "ia64"
  1078. #define ARCHCONFIG "-DITANIUM2 " \
  1079. "-DL1_DATA_SIZE=262144 -DL1_DATA_LINESIZE=128 " \
  1080. "-DL2_SIZE=1572864 -DL2_LINESIZE=128 -DDTB_SIZE=16384 -DDTB_DEFAULT_ENTRIES=128 "
  1081. #define LIBNAME "itanium2"
  1082. #define CORENAME "itanium2"
  1083. #endif
  1084. #ifdef FORCE_SPARC
  1085. #define FORCE
  1086. #define ARCHITECTURE "SPARC"
  1087. #define SUBARCHITECTURE "SPARC"
  1088. #define SUBDIRNAME "sparc"
  1089. #define ARCHCONFIG "-DSPARC -DV9 " \
  1090. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  1091. "-DL2_SIZE=1572864 -DL2_LINESIZE=64 -DDTB_SIZE=8192 -DDTB_DEFAULT_ENTRIES=64 "
  1092. #define LIBNAME "sparc"
  1093. #define CORENAME "sparc"
  1094. #endif
  1095. #ifdef FORCE_SPARCV7
  1096. #define FORCE
  1097. #define ARCHITECTURE "SPARC"
  1098. #define SUBARCHITECTURE "SPARC"
  1099. #define SUBDIRNAME "sparc"
  1100. #define ARCHCONFIG "-DSPARC -DV7 " \
  1101. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  1102. "-DL2_SIZE=1572864 -DL2_LINESIZE=64 -DDTB_SIZE=8192 -DDTB_DEFAULT_ENTRIES=64 "
  1103. #define LIBNAME "sparcv7"
  1104. #define CORENAME "sparcv7"
  1105. #endif
  1106. #ifdef FORCE_GENERIC
  1107. #define FORCE
  1108. #define ARCHITECTURE "GENERIC"
  1109. #define SUBARCHITECTURE "GENERIC"
  1110. #define SUBDIRNAME "generic"
  1111. #define ARCHCONFIG "-DGENERIC " \
  1112. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  1113. "-DL2_SIZE=512488 -DL2_LINESIZE=128 " \
  1114. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  1115. #define LIBNAME "generic"
  1116. #define CORENAME "generic"
  1117. #endif
  1118. #ifdef FORCE_ARMV7
  1119. #define FORCE
  1120. #define ARCHITECTURE "ARM"
  1121. #define SUBARCHITECTURE "ARMV7"
  1122. #define SUBDIRNAME "arm"
  1123. #define ARCHCONFIG "-DARMV7 " \
  1124. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1125. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  1126. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  1127. "-DHAVE_VFPV3 -DHAVE_VFP"
  1128. #define LIBNAME "armv7"
  1129. #define CORENAME "ARMV7"
  1130. #else
  1131. #endif
  1132. #ifdef FORCE_CORTEXA9
  1133. #define FORCE
  1134. #define ARCHITECTURE "ARM"
  1135. #define SUBARCHITECTURE "CORTEXA9"
  1136. #define SUBDIRNAME "arm"
  1137. #define ARCHCONFIG "-DCORTEXA9 -DARMV7 " \
  1138. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1139. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1140. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  1141. "-DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON"
  1142. #define LIBNAME "cortexa9"
  1143. #define CORENAME "CORTEXA9"
  1144. #else
  1145. #endif
  1146. #ifdef FORCE_RISCV64_GENERIC
  1147. #define FORCE
  1148. #define ARCHITECTURE "RISCV64"
  1149. #define SUBARCHITECTURE "RISCV64_GENERIC"
  1150. #define SUBDIRNAME "riscv64"
  1151. #define ARCHCONFIG "-DRISCV64_GENERIC " \
  1152. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1153. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1154. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1155. #define LIBNAME "riscv64_generic"
  1156. #define CORENAME "RISCV64_GENERIC"
  1157. #else
  1158. #endif
  1159. #ifdef FORCE_CORTEXA15
  1160. #define FORCE
  1161. #define ARCHITECTURE "ARM"
  1162. #define SUBARCHITECTURE "CORTEXA15"
  1163. #define SUBDIRNAME "arm"
  1164. #define ARCHCONFIG "-DCORTEXA15 -DARMV7 " \
  1165. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1166. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1167. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  1168. "-DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON"
  1169. #define LIBNAME "cortexa15"
  1170. #define CORENAME "CORTEXA15"
  1171. #else
  1172. #endif
  1173. #ifdef FORCE_ARMV6
  1174. #define FORCE
  1175. #define ARCHITECTURE "ARM"
  1176. #define SUBARCHITECTURE "ARMV6"
  1177. #define SUBDIRNAME "arm"
  1178. #define ARCHCONFIG "-DARMV6 " \
  1179. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1180. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  1181. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  1182. "-DHAVE_VFP"
  1183. #define LIBNAME "armv6"
  1184. #define CORENAME "ARMV6"
  1185. #else
  1186. #endif
  1187. #ifdef FORCE_ARMV5
  1188. #define FORCE
  1189. #define ARCHITECTURE "ARM"
  1190. #define SUBARCHITECTURE "ARMV5"
  1191. #define SUBDIRNAME "arm"
  1192. #define ARCHCONFIG "-DARMV5 " \
  1193. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1194. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  1195. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1196. #define LIBNAME "armv5"
  1197. #define CORENAME "ARMV5"
  1198. #else
  1199. #endif
  1200. #ifdef FORCE_ARMV8SVE
  1201. #define FORCE
  1202. #define ARCHITECTURE "ARM64"
  1203. #define SUBARCHITECTURE "ARMV8SVE"
  1204. #define SUBDIRNAME "arm64"
  1205. #define ARCHCONFIG "-DARMV8SVE " \
  1206. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1207. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1208. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1209. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8"
  1210. #define LIBNAME "armv8sve"
  1211. #define CORENAME "ARMV8SVE"
  1212. #endif
  1213. #ifdef FORCE_ARMV9SME
  1214. #define FORCE
  1215. #define ARCHITECTURE "ARM64"
  1216. #define SUBARCHITECTURE "ARMV9SME"
  1217. #define SUBDIRNAME "arm64"
  1218. #define ARCHCONFIG "-DARMV9SME " \
  1219. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1220. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1221. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1222. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DHAVE_SME -DARMV8 -DARMV9"
  1223. #define LIBNAME "armv9sme"
  1224. #define CORENAME "ARMV9SME"
  1225. #endif
  1226. #ifdef FORCE_ARMV8
  1227. #define FORCE
  1228. #define ARCHITECTURE "ARM64"
  1229. #define SUBARCHITECTURE "ARMV8"
  1230. #define SUBDIRNAME "arm64"
  1231. #define ARCHCONFIG "-DARMV8 " \
  1232. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1233. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1234. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1235. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1236. #define LIBNAME "armv8"
  1237. #define CORENAME "ARMV8"
  1238. #endif
  1239. #ifdef FORCE_CORTEXA53
  1240. #define FORCE
  1241. #define ARCHITECTURE "ARM64"
  1242. #define SUBARCHITECTURE "CORTEXA53"
  1243. #define SUBDIRNAME "arm64"
  1244. #define ARCHCONFIG "-DCORTEXA53 " \
  1245. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1246. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1247. "-DL2_SIZE=262144 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1248. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1249. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1250. #define LIBNAME "cortexa53"
  1251. #define CORENAME "CORTEXA53"
  1252. #endif
  1253. #ifdef FORCE_CORTEXA57
  1254. #define FORCE
  1255. #define ARCHITECTURE "ARM64"
  1256. #define SUBARCHITECTURE "CORTEXA57"
  1257. #define SUBDIRNAME "arm64"
  1258. #define ARCHCONFIG "-DCORTEXA57 " \
  1259. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1260. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1261. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1262. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1263. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1264. #define LIBNAME "cortexa57"
  1265. #define CORENAME "CORTEXA57"
  1266. #endif
  1267. #ifdef FORCE_CORTEXA72
  1268. #define FORCE
  1269. #define ARCHITECTURE "ARM64"
  1270. #define SUBARCHITECTURE "CORTEXA72"
  1271. #define SUBDIRNAME "arm64"
  1272. #define ARCHCONFIG "-DCORTEXA72 " \
  1273. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1274. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1275. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1276. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1277. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1278. #define LIBNAME "cortexa72"
  1279. #define CORENAME "CORTEXA72"
  1280. #endif
  1281. #ifdef FORCE_CORTEXA73
  1282. #define FORCE
  1283. #define ARCHITECTURE "ARM64"
  1284. #define SUBARCHITECTURE "CORTEXA73"
  1285. #define SUBDIRNAME "arm64"
  1286. #define ARCHCONFIG "-DCORTEXA73 " \
  1287. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1288. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1289. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1290. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1291. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1292. #define LIBNAME "cortexa73"
  1293. #define CORENAME "CORTEXA73"
  1294. #endif
  1295. #ifdef FORCE_CORTEXA76
  1296. #define FORCE
  1297. #define ARCHITECTURE "ARM64"
  1298. #define SUBARCHITECTURE "CORTEXA76"
  1299. #define SUBDIRNAME "arm64"
  1300. #define ARCHCONFIG "-DCORTEXA76 " \
  1301. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1302. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1303. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1304. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1305. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1306. #define LIBNAME "cortexa76"
  1307. #define CORENAME "CORTEXA76"
  1308. #endif
  1309. #ifdef FORCE_CORTEXX1
  1310. #define FORCE
  1311. #define ARCHITECTURE "ARM64"
  1312. #define SUBARCHITECTURE "CORTEXX1"
  1313. #define SUBDIRNAME "arm64"
  1314. #define ARCHCONFIG "-DCORTEXX1 " \
  1315. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1316. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1317. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1318. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1319. #define LIBNAME "cortexx1"
  1320. #define CORENAME "CORTEXX1"
  1321. #endif
  1322. #ifdef FORCE_CORTEXX2
  1323. #define FORCE
  1324. #define ARCHITECTURE "ARM64"
  1325. #define SUBARCHITECTURE "CORTEXX2"
  1326. #define SUBDIRNAME "arm64"
  1327. #define ARCHCONFIG "-DCORTEXX2 " \
  1328. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1329. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1330. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1331. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 -DARMV9"
  1332. #define LIBNAME "cortexx2"
  1333. #define CORENAME "CORTEXX2"
  1334. #endif
  1335. #ifdef FORCE_CORTEXA510
  1336. #define FORCE
  1337. #define ARCHITECTURE "ARM64"
  1338. #define SUBARCHITECTURE "CORTEXA510"
  1339. #define SUBDIRNAME "arm64"
  1340. #define ARCHCONFIG "-DCORTEXA510 " \
  1341. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1342. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1343. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1344. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 -DARMV9"
  1345. #define LIBNAME "cortexa510"
  1346. #define CORENAME "CORTEXA510"
  1347. #endif
  1348. #ifdef FORCE_CORTEXA710
  1349. #define FORCE
  1350. #define ARCHITECTURE "ARM64"
  1351. #define SUBARCHITECTURE "CORTEXA710"
  1352. #define SUBDIRNAME "arm64"
  1353. #define ARCHCONFIG "-DCORTEXA710 " \
  1354. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1355. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1356. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1357. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 -DARMV9"
  1358. #define LIBNAME "cortexa710"
  1359. #define CORENAME "CORTEXA710"
  1360. #endif
  1361. #ifdef FORCE_NEOVERSEN1
  1362. #define FORCE
  1363. #define ARCHITECTURE "ARM64"
  1364. #define SUBARCHITECTURE "NEOVERSEN1"
  1365. #define SUBDIRNAME "arm64"
  1366. #define ARCHCONFIG "-DNEOVERSEN1 " \
  1367. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1368. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1369. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1370. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1371. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8 " \
  1372. "-march=armv8.2-a -mtune=neoverse-n1"
  1373. #define LIBNAME "neoversen1"
  1374. #define CORENAME "NEOVERSEN1"
  1375. #endif
  1376. #ifdef FORCE_NEOVERSEV1
  1377. #define FORCE
  1378. #define ARCHITECTURE "ARM64"
  1379. #define SUBARCHITECTURE "NEOVERSEV1"
  1380. #define SUBDIRNAME "arm64"
  1381. #define ARCHCONFIG "-DNEOVERSEV1 " \
  1382. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1383. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1384. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1385. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1386. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 " \
  1387. "-march=armv8.4-a+sve+bf16 -mtune=neoverse-v1"
  1388. #define LIBNAME "neoversev1"
  1389. #define CORENAME "NEOVERSEV1"
  1390. #endif
  1391. #ifdef FORCE_NEOVERSEN2
  1392. #define FORCE
  1393. #define ARCHITECTURE "ARM64"
  1394. #define SUBARCHITECTURE "NEOVERSEN2"
  1395. #define SUBDIRNAME "arm64"
  1396. #define ARCHCONFIG "-DNEOVERSEN2 " \
  1397. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1398. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1399. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1400. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1401. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8 " \
  1402. "-march=armv8.5-a -mtune=neoverse-n2"
  1403. #define LIBNAME "neoversen2"
  1404. #define CORENAME "NEOVERSEN2"
  1405. #endif
  1406. #ifdef FORCE_CORTEXA55
  1407. #define FORCE
  1408. #define ARCHITECTURE "ARM64"
  1409. #define SUBARCHITECTURE "CORTEXA55"
  1410. #define SUBDIRNAME "arm64"
  1411. #define ARCHCONFIG "-DCORTEXA55 " \
  1412. "-DL1_CODE_SIZE=16384 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1413. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1414. "-DL2_SIZE=65536 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1415. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1416. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1417. #define LIBNAME "cortexa55"
  1418. #define CORENAME "CORTEXA55"
  1419. #endif
  1420. #ifdef FORCE_FALKOR
  1421. #define FORCE
  1422. #define ARCHITECTURE "ARM64"
  1423. #define SUBARCHITECTURE "FALKOR"
  1424. #define SUBDIRNAME "arm64"
  1425. #define ARCHCONFIG "-DFALKOR " \
  1426. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1427. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1428. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1429. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1430. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1431. #define LIBNAME "falkor"
  1432. #define CORENAME "FALKOR"
  1433. #endif
  1434. #ifdef FORCE_THUNDERX
  1435. #define FORCE
  1436. #define ARCHITECTURE "ARM64"
  1437. #define SUBARCHITECTURE "THUNDERX"
  1438. #define SUBDIRNAME "arm64"
  1439. #define ARCHCONFIG "-DTHUNDERX " \
  1440. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  1441. "-DL2_SIZE=16777216 -DL2_LINESIZE=128 -DL2_ASSOCIATIVE=16 " \
  1442. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1443. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1444. #define LIBNAME "thunderx"
  1445. #define CORENAME "THUNDERX"
  1446. #endif
  1447. #ifdef FORCE_THUNDERX2T99
  1448. #define ARMV8
  1449. #define FORCE
  1450. #define ARCHITECTURE "ARM64"
  1451. #define SUBARCHITECTURE "THUNDERX2T99"
  1452. #define SUBDIRNAME "arm64"
  1453. #define ARCHCONFIG "-DTHUNDERX2T99 " \
  1454. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1455. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1456. "-DL2_SIZE=262144 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1457. "-DL3_SIZE=33554432 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=32 " \
  1458. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1459. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1460. #define LIBNAME "thunderx2t99"
  1461. #define CORENAME "THUNDERX2T99"
  1462. #endif
  1463. #ifdef FORCE_TSV110
  1464. #define FORCE
  1465. #define ARCHITECTURE "ARM64"
  1466. #define SUBARCHITECTURE "TSV110"
  1467. #define SUBDIRNAME "arm64"
  1468. #define ARCHCONFIG "-DTSV110 " \
  1469. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1470. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1471. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1472. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1473. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1474. #define LIBNAME "tsv110"
  1475. #define CORENAME "TSV110"
  1476. #endif
  1477. #ifdef FORCE_EMAG8180
  1478. #define ARMV8
  1479. #define FORCE
  1480. #define ARCHITECTURE "ARM64"
  1481. #define SUBARCHITECTURE "EMAG8180"
  1482. #define SUBDIRNAME "arm64"
  1483. #define ARCHCONFIG "-DEMAG8180 " \
  1484. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1485. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1486. "-DL2_SIZE=262144 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1487. "-DL3_SIZE=33554432 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=32 " \
  1488. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1489. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1490. #define LIBNAME "emag8180"
  1491. #define CORENAME "EMAG8180"
  1492. #endif
  1493. #ifdef FORCE_AMPERE1
  1494. #define FORCE
  1495. #define ARCHITECTURE "ARM64"
  1496. #define SUBARCHITECTURE "AMPERE1"
  1497. #define SUBDIRNAME "arm64"
  1498. #define ARCHCONFIG "-DAMPERE1 " \
  1499. "-DL1_CODE_SIZE=16384 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1500. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1501. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1502. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1503. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8 " \
  1504. "-march=armv8.6-a+crypto+crc+fp16+sha3+rng"
  1505. #define LIBNAME "ampere1"
  1506. #define CORENAME "AMPERE1"
  1507. #endif
  1508. #ifdef FORCE_THUNDERX3T110
  1509. #define ARMV8
  1510. #define FORCE
  1511. #define ARCHITECTURE "ARM64"
  1512. #define SUBARCHITECTURE "THUNDERX3T110"
  1513. #define SUBDIRNAME "arm64"
  1514. #define ARCHCONFIG "-DTHUNDERX3T110 " \
  1515. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1516. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1517. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1518. "-DL3_SIZE=94371840 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=32 " \
  1519. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1520. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1521. #define LIBNAME "thunderx3t110"
  1522. #define CORENAME "THUNDERX3T110"
  1523. #endif
  1524. #ifdef FORCE_VORTEX
  1525. #define FORCE
  1526. #define ARCHITECTURE "ARM64"
  1527. #define SUBARCHITECTURE "VORTEX"
  1528. #define SUBDIRNAME "arm64"
  1529. #define ARCHCONFIG "-DVORTEX " \
  1530. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1531. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1532. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1533. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1534. #define LIBNAME "vortex"
  1535. #define CORENAME "VORTEX"
  1536. #endif
  1537. #ifdef FORCE_A64FX
  1538. #define ARMV8
  1539. #define FORCE
  1540. #define ARCHITECTURE "ARM64"
  1541. #define SUBARCHITECTURE "A64FX"
  1542. #define SUBDIRNAME "arm64"
  1543. #define ARCHCONFIG "-DA64FX " \
  1544. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=256 -DL1_CODE_ASSOCIATIVE=8 " \
  1545. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=256 -DL1_DATA_ASSOCIATIVE=8 " \
  1546. "-DL2_SIZE=8388608 -DL2_LINESIZE=256 -DL2_ASSOCIATIVE=8 " \
  1547. "-DL3_SIZE=0 -DL3_LINESIZE=0 -DL3_ASSOCIATIVE=0 " \
  1548. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1549. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DHAVE_SVE -DARMV8"
  1550. #define LIBNAME "a64fx"
  1551. #define CORENAME "A64FX"
  1552. #endif
  1553. #ifdef FORCE_FT2000
  1554. #define ARMV8
  1555. #define FORCE
  1556. #define ARCHITECTURE "ARM64"
  1557. #define SUBARCHITECTURE "FT2000"
  1558. #define SUBDIRNAME "arm64"
  1559. #define ARCHCONFIG "-DFT2000 " \
  1560. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1561. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1562. "-DL2_SIZE=33554426-DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1563. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1564. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1565. #define LIBNAME "ft2000"
  1566. #define CORENAME "FT2000"
  1567. #endif
  1568. #ifdef FORCE_ZARCH_GENERIC
  1569. #define FORCE
  1570. #define ARCHITECTURE "ZARCH"
  1571. #define SUBARCHITECTURE "ZARCH_GENERIC"
  1572. #define ARCHCONFIG "-DZARCH_GENERIC " \
  1573. "-DDTB_DEFAULT_ENTRIES=64"
  1574. #define LIBNAME "zarch_generic"
  1575. #define CORENAME "ZARCH_GENERIC"
  1576. #endif
  1577. #ifdef FORCE_Z13
  1578. #define FORCE
  1579. #define ARCHITECTURE "ZARCH"
  1580. #define SUBARCHITECTURE "Z13"
  1581. #define ARCHCONFIG "-DZ13 " \
  1582. "-DDTB_DEFAULT_ENTRIES=64"
  1583. #define LIBNAME "z13"
  1584. #define CORENAME "Z13"
  1585. #endif
  1586. #ifdef FORCE_Z14
  1587. #define FORCE
  1588. #define ARCHITECTURE "ZARCH"
  1589. #define SUBARCHITECTURE "Z14"
  1590. #define ARCHCONFIG "-DZ14 " \
  1591. "-DDTB_DEFAULT_ENTRIES=64"
  1592. #define LIBNAME "z14"
  1593. #define CORENAME "Z14"
  1594. #endif
  1595. #ifdef FORCE_EV4
  1596. #define FORCE
  1597. #define ARCHITECTURE "ALPHA"
  1598. #define SUBARCHITECTURE "ev4"
  1599. #define ARCHCONFIG "-DEV4 " \
  1600. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  1601. "-DL2_SIZE=2097152 -DL2_LINESIZE=32 " \
  1602. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=8192 "
  1603. #define LIBNAME "ev4"
  1604. #define CORENAME "EV4"
  1605. #endif
  1606. #ifdef FORCE_EV5
  1607. #define FORCE
  1608. #define ARCHITECTURE "ALPHA"
  1609. #define SUBARCHITECTURE "ev5"
  1610. #define ARCHCONFIG "-DEV5 " \
  1611. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  1612. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 " \
  1613. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=8192 "
  1614. #define LIBNAME "ev5"
  1615. #define CORENAME "EV5"
  1616. #endif
  1617. #ifdef FORCE_EV6
  1618. #define FORCE
  1619. #define ARCHITECTURE "ALPHA"
  1620. #define SUBARCHITECTURE "ev6"
  1621. #define ARCHCONFIG "-DEV6 " \
  1622. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1623. "-DL2_SIZE=4194304 -DL2_LINESIZE=64 " \
  1624. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=8192 "
  1625. #define LIBNAME "ev6"
  1626. #define CORENAME "EV6"
  1627. #endif
  1628. #ifdef FORCE_C910V
  1629. #define FORCE
  1630. #define ARCHITECTURE "RISCV64"
  1631. #ifdef NO_RV64GV
  1632. #define SUBARCHITECTURE "RISCV64_GENERIC"
  1633. #define SUBDIRNAME "riscv64"
  1634. #define ARCHCONFIG "-DRISCV64_GENERIC " \
  1635. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1636. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1637. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1638. #define LIBNAME "riscv64_generic"
  1639. #define CORENAME "RISCV64_GENERIC"
  1640. #else
  1641. #define SUBARCHITECTURE "C910V"
  1642. #define SUBDIRNAME "riscv64"
  1643. #define ARCHCONFIG "-DC910V " \
  1644. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1645. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1646. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1647. #define LIBNAME "c910v"
  1648. #define CORENAME "C910V"
  1649. #endif
  1650. #endif
  1651. #ifdef FORCE_x280
  1652. #define FORCE
  1653. #define ARCHITECTURE "RISCV64"
  1654. #define SUBARCHITECTURE "x280"
  1655. #define SUBDIRNAME "riscv64"
  1656. #define ARCHCONFIG "-Dx280 " \
  1657. "-DL1_DATA_SIZE=64536 -DL1_DATA_LINESIZE=32 " \
  1658. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  1659. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1660. #define LIBNAME "x280"
  1661. #define CORENAME "x280"
  1662. #else
  1663. #endif
  1664. #ifdef FORCE_RISCV64_ZVL256B
  1665. #define FORCE
  1666. #define ARCHITECTURE "RISCV64"
  1667. #define SUBARCHITECTURE "RISCV64_ZVL256B"
  1668. #define SUBDIRNAME "riscv64"
  1669. #define ARCHCONFIG "-DRISCV64_ZVL256B " \
  1670. "-DL1_DATA_SIZE=64536 -DL1_DATA_LINESIZE=32 " \
  1671. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  1672. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1673. #define LIBNAME "riscv64_zvl256b"
  1674. #define CORENAME "RISCV64_ZVL256B"
  1675. #endif
  1676. #ifdef FORCE_RISCV64_ZVL128B
  1677. #define FORCE
  1678. #define ARCHITECTURE "RISCV64"
  1679. #define SUBARCHITECTURE "RISCV64_ZVL128B"
  1680. #define SUBDIRNAME "riscv64"
  1681. #define ARCHCONFIG "-DRISCV64_ZVL128B " \
  1682. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  1683. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  1684. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  1685. #define LIBNAME "riscv64_zvl128b"
  1686. #define CORENAME "RISCV64_ZVL128B"
  1687. #endif
  1688. #if defined(FORCE_E2K) || defined(__e2k__)
  1689. #define FORCE
  1690. #define ARCHITECTURE "E2K"
  1691. #define ARCHCONFIG "-DGENERIC " \
  1692. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  1693. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  1694. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  1695. #define LIBNAME "generic"
  1696. #define CORENAME "generic"
  1697. #endif
  1698. #ifdef FORCE_CSKY
  1699. #define FORCE
  1700. #define ARCHITECTURE "CSKY"
  1701. #define SUBARCHITECTURE "CSKY"
  1702. #define SUBDIRNAME "csky"
  1703. #define ARCHCONFIG "-DCSKY" \
  1704. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1705. "-DL2_SIZE=524288 -DL2_LINESIZE=32 " \
  1706. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  1707. #define LIBNAME "csky"
  1708. #define CORENAME "CSKY"
  1709. #endif
  1710. #ifdef FORCE_CK860FV
  1711. #define FORCE
  1712. #define ARCHITECTURE "CSKY"
  1713. #define SUBARCHITECTURE "CK860V"
  1714. #define SUBDIRNAME "csky"
  1715. #define ARCHCONFIG "-DCK860FV " \
  1716. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  1717. "-DL2_SIZE=524288 -DL2_LINESIZE=32 " \
  1718. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  1719. #define LIBNAME "ck860fv"
  1720. #define CORENAME "CK860FV"
  1721. #endif
  1722. #ifndef FORCE
  1723. #ifdef USER_TARGET
  1724. #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
  1725. #endif
  1726. #if defined(__powerpc__) || defined(__powerpc) || defined(powerpc) || \
  1727. defined(__PPC__) || defined(PPC) || defined(_POWER) || defined(__POWERPC__)
  1728. #ifndef POWER
  1729. #define POWER
  1730. #endif
  1731. #define OPENBLAS_SUPPORTED
  1732. #endif
  1733. #if defined(__zarch__) || defined(__s390x__)
  1734. #define ZARCH
  1735. #include "cpuid_zarch.c"
  1736. #define OPENBLAS_SUPPORTED
  1737. #endif
  1738. #ifdef INTEL_AMD
  1739. #include "cpuid_x86.c"
  1740. #define OPENBLAS_SUPPORTED
  1741. #endif
  1742. #ifdef __ia64__
  1743. #include "cpuid_ia64.c"
  1744. #define OPENBLAS_SUPPORTED
  1745. #endif
  1746. #ifdef __alpha
  1747. #include "cpuid_alpha.c"
  1748. #define OPENBLAS_SUPPORTED
  1749. #endif
  1750. #ifdef POWER
  1751. #include "cpuid_power.c"
  1752. #define OPENBLAS_SUPPORTED
  1753. #endif
  1754. #ifdef sparc
  1755. #include "cpuid_sparc.c"
  1756. #define OPENBLAS_SUPPORTED
  1757. #endif
  1758. #ifdef __mips__
  1759. #ifdef __mips64
  1760. #include "cpuid_mips64.c"
  1761. #else
  1762. #include "cpuid_mips.c"
  1763. #endif
  1764. #define OPENBLAS_SUPPORTED
  1765. #endif
  1766. #ifdef __loongarch64
  1767. #include "cpuid_loongarch64.c"
  1768. #define OPENBLAS_SUPPORTED
  1769. #endif
  1770. #ifdef __riscv
  1771. #include "cpuid_riscv64.c"
  1772. #define OPENBLAS_SUPPORTED
  1773. #endif
  1774. #ifdef __arm__
  1775. #include "cpuid_arm.c"
  1776. #define OPENBLAS_SUPPORTED
  1777. #endif
  1778. #ifdef __aarch64__
  1779. #include "cpuid_arm64.c"
  1780. #define OPENBLAS_SUPPORTED
  1781. #endif
  1782. #ifndef OPENBLAS_SUPPORTED
  1783. #error "This arch/CPU is not supported by OpenBLAS."
  1784. #endif
  1785. #else
  1786. #endif
  1787. static int get_num_cores(void) {
  1788. int count;
  1789. #ifdef OS_WINDOWS
  1790. SYSTEM_INFO sysinfo;
  1791. #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
  1792. int m[2];
  1793. size_t len;
  1794. #endif
  1795. #if defined(linux) || defined(__sun__)
  1796. //returns the number of processors which are currently online
  1797. count = sysconf(_SC_NPROCESSORS_CONF);
  1798. if (count <= 0) count = 2;
  1799. return count;
  1800. #elif defined(OS_WINDOWS)
  1801. GetSystemInfo(&sysinfo);
  1802. return sysinfo.dwNumberOfProcessors;
  1803. #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
  1804. m[0] = CTL_HW;
  1805. m[1] = HW_NCPU;
  1806. len = sizeof(int);
  1807. sysctl(m, 2, &count, &len, NULL, 0);
  1808. if (count <= 0) count = 2;
  1809. return count;
  1810. #elif defined(_AIX)
  1811. //returns the number of processors which are currently online
  1812. count = sysconf(_SC_NPROCESSORS_ONLN);
  1813. if (count <= 0) count = 2;
  1814. return count;
  1815. #else
  1816. return 2;
  1817. #endif
  1818. }
  1819. int main(int argc, char *argv[]){
  1820. #ifdef FORCE
  1821. char buffer[8192], *p, *q;
  1822. int length;
  1823. #endif
  1824. if (argc == 1) return 0;
  1825. switch (argv[1][0]) {
  1826. case '0' : /* for Makefile */
  1827. #ifdef FORCE
  1828. printf("CORE=%s\n", CORENAME);
  1829. #else
  1830. #if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv) || defined(__alpha__) || defined(__csky__)
  1831. printf("CORE=%s\n", get_corename());
  1832. #endif
  1833. #endif
  1834. #ifdef FORCE
  1835. printf("LIBCORE=%s\n", LIBNAME);
  1836. #else
  1837. printf("LIBCORE=");
  1838. get_libname();
  1839. printf("\n");
  1840. #endif
  1841. printf("NUM_CORES=%d\n", get_num_cores());
  1842. #if defined(__arm__)
  1843. #if !defined(FORCE)
  1844. fprintf(stderr,"get features!\n");
  1845. get_features();
  1846. #else
  1847. fprintf(stderr,"split archconfig!\n");
  1848. sprintf(buffer, "%s", ARCHCONFIG);
  1849. p = &buffer[0];
  1850. while (*p) {
  1851. if ((*p == '-') && (*(p + 1) == 'D')) {
  1852. p += 2;
  1853. if (*p != 'H') {
  1854. while( (*p != ' ') && (*p != '-') && (*p != '\0') && (*p != '\n')) {p++; }
  1855. if (*p == '-') continue;
  1856. }
  1857. while ((*p != ' ') && (*p != '\0')) {
  1858. if (*p == '=') {
  1859. printf("=");
  1860. p ++;
  1861. while ((*p != ' ') && (*p != '\0')) {
  1862. printf("%c", *p);
  1863. p ++;
  1864. }
  1865. } else {
  1866. printf("%c", *p);
  1867. p ++;
  1868. if ((*p == ' ') || (*p =='\0')) printf("=1\n");
  1869. }
  1870. }
  1871. } else p ++;
  1872. }
  1873. #endif
  1874. #endif
  1875. #ifdef INTEL_AMD
  1876. #ifndef FORCE
  1877. get_sse();
  1878. #else
  1879. sprintf(buffer, "%s", ARCHCONFIG);
  1880. p = &buffer[0];
  1881. while (*p) {
  1882. if ((*p == '-') && (*(p + 1) == 'D')) {
  1883. p += 2;
  1884. while ((*p != ' ') && (*p != '\0')) {
  1885. if (*p == '=') {
  1886. printf("=");
  1887. p ++;
  1888. while ((*p != ' ') && (*p != '\0')) {
  1889. printf("%c", *p);
  1890. p ++;
  1891. }
  1892. } else {
  1893. printf("%c", *p);
  1894. p ++;
  1895. if ((*p == ' ') || (*p =='\0')) printf("=1");
  1896. }
  1897. }
  1898. printf("\n");
  1899. } else p ++;
  1900. }
  1901. #endif
  1902. #endif
  1903. #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  1904. printf("__BYTE_ORDER__=__ORDER_BIG_ENDIAN__\n");
  1905. #elif defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ > 0
  1906. printf("__BYTE_ORDER__=__ORDER_BIG_ENDIAN__\n");
  1907. #endif
  1908. #if defined(_CALL_ELF) && (_CALL_ELF == 2)
  1909. printf("ELF_VERSION=2\n");
  1910. #endif
  1911. #ifdef MAKE_NB_JOBS
  1912. #if MAKE_NB_JOBS > 0
  1913. printf("MAKEFLAGS += -j %d\n", MAKE_NB_JOBS);
  1914. #else
  1915. // Let make use parent -j argument or -j1 if there
  1916. // is no make parent
  1917. #endif
  1918. #elif NO_PARALLEL_MAKE==1
  1919. printf("MAKEFLAGS += -j 1\n");
  1920. #else
  1921. printf("MAKEFLAGS += -j %d\n", get_num_cores());
  1922. #endif
  1923. break;
  1924. case '1' : /* For config.h */
  1925. #ifdef FORCE
  1926. sprintf(buffer, "%s -DCORE_%s\n", ARCHCONFIG, CORENAME);
  1927. p = &buffer[0];
  1928. while (*p) {
  1929. if ((*p == '-') && (*(p + 1) == 'D')) {
  1930. p += 2;
  1931. printf("#define ");
  1932. while ((*p != ' ') && (*p != '\0')) {
  1933. if (*p == '=') {
  1934. printf(" ");
  1935. p ++;
  1936. while ((*p != ' ') && (*p != '\0')) {
  1937. printf("%c", *p);
  1938. p ++;
  1939. }
  1940. } else {
  1941. if (*p != '\n')
  1942. printf("%c", *p);
  1943. p ++;
  1944. }
  1945. }
  1946. printf("\n");
  1947. } else p ++;
  1948. }
  1949. #else
  1950. get_cpuconfig();
  1951. #endif
  1952. #ifdef FORCE
  1953. printf("#define CHAR_CORENAME \"%s\"\n", CORENAME);
  1954. #else
  1955. #if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv) || defined(__csky__)
  1956. printf("#define CHAR_CORENAME \"%s\"\n", get_corename());
  1957. #endif
  1958. #endif
  1959. break;
  1960. case '2' : /* SMP */
  1961. if (get_num_cores() > 1) printf("SMP=1\n");
  1962. break;
  1963. }
  1964. fflush(stdout);
  1965. return 0;
  1966. }