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

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