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

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