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