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

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