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