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