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 68 kB

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