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

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