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.

param.h 72 kB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12 years ago
12 years ago
12 years ago
6 years ago
12 years ago
6 years ago
12 years ago
12 years ago
6 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
7 years ago
12 years ago
12 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075
  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. #ifndef PARAM_H
  66. #define PARAM_H
  67. #ifdef OPTERON
  68. #define SNUMOPT 4
  69. #define DNUMOPT 2
  70. #define GEMM_DEFAULT_OFFSET_A 64
  71. #define GEMM_DEFAULT_OFFSET_B 256
  72. #define GEMM_DEFAULT_ALIGN 0x01ffffUL
  73. #define SGEMM_DEFAULT_UNROLL_N 4
  74. #define DGEMM_DEFAULT_UNROLL_N 4
  75. #define QGEMM_DEFAULT_UNROLL_N 2
  76. #define CGEMM_DEFAULT_UNROLL_N 2
  77. #define ZGEMM_DEFAULT_UNROLL_N 2
  78. #define XGEMM_DEFAULT_UNROLL_N 1
  79. #ifdef ARCH_X86
  80. #define SGEMM_DEFAULT_UNROLL_M 4
  81. #define DGEMM_DEFAULT_UNROLL_M 2
  82. #define QGEMM_DEFAULT_UNROLL_M 2
  83. #define CGEMM_DEFAULT_UNROLL_M 2
  84. #define ZGEMM_DEFAULT_UNROLL_M 1
  85. #define XGEMM_DEFAULT_UNROLL_M 1
  86. #else
  87. #define SGEMM_DEFAULT_UNROLL_M 8
  88. #define DGEMM_DEFAULT_UNROLL_M 4
  89. #define QGEMM_DEFAULT_UNROLL_M 2
  90. #define CGEMM_DEFAULT_UNROLL_M 4
  91. #define ZGEMM_DEFAULT_UNROLL_M 2
  92. #define XGEMM_DEFAULT_UNROLL_M 1
  93. #endif
  94. #define SGEMM_DEFAULT_P sgemm_p
  95. #define DGEMM_DEFAULT_P dgemm_p
  96. #define QGEMM_DEFAULT_P qgemm_p
  97. #define CGEMM_DEFAULT_P cgemm_p
  98. #define ZGEMM_DEFAULT_P zgemm_p
  99. #define XGEMM_DEFAULT_P xgemm_p
  100. #define SGEMM_DEFAULT_R sgemm_r
  101. #define DGEMM_DEFAULT_R dgemm_r
  102. #define QGEMM_DEFAULT_R qgemm_r
  103. #define CGEMM_DEFAULT_R cgemm_r
  104. #define ZGEMM_DEFAULT_R zgemm_r
  105. #define XGEMM_DEFAULT_R xgemm_r
  106. #ifdef ALLOC_HUGETLB
  107. #define SGEMM_DEFAULT_Q 248
  108. #define DGEMM_DEFAULT_Q 248
  109. #define QGEMM_DEFAULT_Q 248
  110. #define CGEMM_DEFAULT_Q 248
  111. #define ZGEMM_DEFAULT_Q 248
  112. #define XGEMM_DEFAULT_Q 248
  113. #else
  114. #define SGEMM_DEFAULT_Q 240
  115. #define DGEMM_DEFAULT_Q 240
  116. #define QGEMM_DEFAULT_Q 240
  117. #define CGEMM_DEFAULT_Q 240
  118. #define ZGEMM_DEFAULT_Q 240
  119. #define XGEMM_DEFAULT_Q 240
  120. #endif
  121. #define SYMV_P 16
  122. #define HAVE_EXCLUSIVE_CACHE
  123. #endif
  124. #if defined(BARCELONA) || defined(SHANGHAI) || defined(BOBCAT)
  125. #define SNUMOPT 8
  126. #define DNUMOPT 4
  127. #define GEMM_DEFAULT_OFFSET_A 64
  128. #define GEMM_DEFAULT_OFFSET_B 832
  129. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  130. #define SGEMM_DEFAULT_UNROLL_N 4
  131. #define DGEMM_DEFAULT_UNROLL_N 4
  132. #define QGEMM_DEFAULT_UNROLL_N 2
  133. #define CGEMM_DEFAULT_UNROLL_N 2
  134. #define ZGEMM_DEFAULT_UNROLL_N 2
  135. #define XGEMM_DEFAULT_UNROLL_N 1
  136. #ifdef ARCH_X86
  137. #define SGEMM_DEFAULT_UNROLL_M 4
  138. #define DGEMM_DEFAULT_UNROLL_M 2
  139. #define QGEMM_DEFAULT_UNROLL_M 2
  140. #define CGEMM_DEFAULT_UNROLL_M 2
  141. #define ZGEMM_DEFAULT_UNROLL_M 1
  142. #define XGEMM_DEFAULT_UNROLL_M 1
  143. #else
  144. #define SGEMM_DEFAULT_UNROLL_M 8
  145. #define DGEMM_DEFAULT_UNROLL_M 4
  146. #define QGEMM_DEFAULT_UNROLL_M 2
  147. #define CGEMM_DEFAULT_UNROLL_M 4
  148. #define ZGEMM_DEFAULT_UNROLL_M 2
  149. #define XGEMM_DEFAULT_UNROLL_M 1
  150. #endif
  151. #if 0
  152. #define SGEMM_DEFAULT_P 496
  153. #define DGEMM_DEFAULT_P 248
  154. #define QGEMM_DEFAULT_P 124
  155. #define CGEMM_DEFAULT_P 248
  156. #define ZGEMM_DEFAULT_P 124
  157. #define XGEMM_DEFAULT_P 62
  158. #define SGEMM_DEFAULT_Q 248
  159. #define DGEMM_DEFAULT_Q 248
  160. #define QGEMM_DEFAULT_Q 248
  161. #define CGEMM_DEFAULT_Q 248
  162. #define ZGEMM_DEFAULT_Q 248
  163. #define XGEMM_DEFAULT_Q 248
  164. #else
  165. #define SGEMM_DEFAULT_P 448
  166. #define DGEMM_DEFAULT_P 224
  167. #define QGEMM_DEFAULT_P 112
  168. #define CGEMM_DEFAULT_P 224
  169. #define ZGEMM_DEFAULT_P 112
  170. #define XGEMM_DEFAULT_P 56
  171. #define SGEMM_DEFAULT_Q 224
  172. #define DGEMM_DEFAULT_Q 224
  173. #define QGEMM_DEFAULT_Q 224
  174. #define CGEMM_DEFAULT_Q 224
  175. #define ZGEMM_DEFAULT_Q 224
  176. #define XGEMM_DEFAULT_Q 224
  177. #endif
  178. #define SGEMM_DEFAULT_R sgemm_r
  179. #define QGEMM_DEFAULT_R qgemm_r
  180. #define DGEMM_DEFAULT_R dgemm_r
  181. #define CGEMM_DEFAULT_R cgemm_r
  182. #define ZGEMM_DEFAULT_R zgemm_r
  183. #define XGEMM_DEFAULT_R xgemm_r
  184. #define SYMV_P 16
  185. #define HAVE_EXCLUSIVE_CACHE
  186. #define GEMM_THREAD gemm_thread_mn
  187. #endif
  188. #ifdef BULLDOZER
  189. #define SNUMOPT 8
  190. #define DNUMOPT 4
  191. #define GEMM_DEFAULT_OFFSET_A 64
  192. #define GEMM_DEFAULT_OFFSET_B 832
  193. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  194. #define QGEMM_DEFAULT_UNROLL_N 2
  195. #define CGEMM_DEFAULT_UNROLL_N 2
  196. #define ZGEMM_DEFAULT_UNROLL_N 2
  197. #define XGEMM_DEFAULT_UNROLL_N 1
  198. #ifdef ARCH_X86
  199. #define SGEMM_DEFAULT_UNROLL_N 4
  200. #define DGEMM_DEFAULT_UNROLL_N 4
  201. #define SGEMM_DEFAULT_UNROLL_M 4
  202. #define DGEMM_DEFAULT_UNROLL_M 2
  203. #define QGEMM_DEFAULT_UNROLL_M 2
  204. #define CGEMM_DEFAULT_UNROLL_M 2
  205. #define ZGEMM_DEFAULT_UNROLL_M 1
  206. #define XGEMM_DEFAULT_UNROLL_M 1
  207. #else
  208. #define SGEMM_DEFAULT_UNROLL_N 2
  209. #define DGEMM_DEFAULT_UNROLL_N 2
  210. #define SGEMM_DEFAULT_UNROLL_M 16
  211. #define DGEMM_DEFAULT_UNROLL_M 8
  212. #define QGEMM_DEFAULT_UNROLL_M 2
  213. #define CGEMM_DEFAULT_UNROLL_M 4
  214. #define ZGEMM_DEFAULT_UNROLL_M 2
  215. #define XGEMM_DEFAULT_UNROLL_M 1
  216. #define CGEMM3M_DEFAULT_UNROLL_N 4
  217. #define CGEMM3M_DEFAULT_UNROLL_M 8
  218. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  219. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  220. #define DGEMM_DEFAULT_UNROLL_MN 16
  221. #define GEMV_UNROLL 8
  222. #endif
  223. #if defined(ARCH_X86_64)
  224. #define SGEMM_DEFAULT_P 768
  225. #define DGEMM_DEFAULT_P 384
  226. #else
  227. #define SGEMM_DEFAULT_P 448
  228. #define DGEMM_DEFAULT_P 224
  229. #endif
  230. #define QGEMM_DEFAULT_P 112
  231. #define CGEMM_DEFAULT_P 224
  232. #define ZGEMM_DEFAULT_P 112
  233. #define XGEMM_DEFAULT_P 56
  234. #if defined(ARCH_X86_64)
  235. #define SGEMM_DEFAULT_Q 168
  236. #define DGEMM_DEFAULT_Q 168
  237. #else
  238. #define SGEMM_DEFAULT_Q 224
  239. #define DGEMM_DEFAULT_Q 224
  240. #endif
  241. #define QGEMM_DEFAULT_Q 224
  242. #define CGEMM_DEFAULT_Q 224
  243. #define ZGEMM_DEFAULT_Q 224
  244. #define XGEMM_DEFAULT_Q 224
  245. #define CGEMM3M_DEFAULT_P 448
  246. #define ZGEMM3M_DEFAULT_P 224
  247. #define XGEMM3M_DEFAULT_P 112
  248. #define CGEMM3M_DEFAULT_Q 224
  249. #define ZGEMM3M_DEFAULT_Q 224
  250. #define XGEMM3M_DEFAULT_Q 224
  251. #define CGEMM3M_DEFAULT_R 12288
  252. #define ZGEMM3M_DEFAULT_R 12288
  253. #define XGEMM3M_DEFAULT_R 12288
  254. #define SGEMM_DEFAULT_R sgemm_r
  255. #define QGEMM_DEFAULT_R qgemm_r
  256. #define DGEMM_DEFAULT_R dgemm_r
  257. #define CGEMM_DEFAULT_R cgemm_r
  258. #define ZGEMM_DEFAULT_R zgemm_r
  259. #define XGEMM_DEFAULT_R xgemm_r
  260. #define SYMV_P 16
  261. #define HAVE_EXCLUSIVE_CACHE
  262. #define GEMM_THREAD gemm_thread_mn
  263. #endif
  264. #ifdef PILEDRIVER
  265. #define SNUMOPT 8
  266. #define DNUMOPT 4
  267. #define GEMM_DEFAULT_OFFSET_A 64
  268. #define GEMM_DEFAULT_OFFSET_B 832
  269. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  270. #define QGEMM_DEFAULT_UNROLL_N 2
  271. #define CGEMM_DEFAULT_UNROLL_N 2
  272. #define ZGEMM_DEFAULT_UNROLL_N 2
  273. #define XGEMM_DEFAULT_UNROLL_N 1
  274. #ifdef ARCH_X86
  275. #define SGEMM_DEFAULT_UNROLL_N 4
  276. #define DGEMM_DEFAULT_UNROLL_N 4
  277. #define SGEMM_DEFAULT_UNROLL_M 4
  278. #define DGEMM_DEFAULT_UNROLL_M 2
  279. #define QGEMM_DEFAULT_UNROLL_M 2
  280. #define CGEMM_DEFAULT_UNROLL_M 2
  281. #define ZGEMM_DEFAULT_UNROLL_M 1
  282. #define XGEMM_DEFAULT_UNROLL_M 1
  283. #else
  284. #define SGEMM_DEFAULT_UNROLL_N 2
  285. #define DGEMM_DEFAULT_UNROLL_N 2
  286. #define SGEMM_DEFAULT_UNROLL_M 16
  287. #define DGEMM_DEFAULT_UNROLL_M 8
  288. #define QGEMM_DEFAULT_UNROLL_M 2
  289. #define CGEMM_DEFAULT_UNROLL_M 4
  290. #define ZGEMM_DEFAULT_UNROLL_M 2
  291. #define XGEMM_DEFAULT_UNROLL_M 1
  292. #define CGEMM3M_DEFAULT_UNROLL_N 4
  293. #define CGEMM3M_DEFAULT_UNROLL_M 8
  294. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  295. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  296. #define GEMV_UNROLL 8
  297. #endif
  298. #if defined(ARCH_X86_64)
  299. #define SGEMM_DEFAULT_P 768
  300. #define DGEMM_DEFAULT_P 768
  301. #define ZGEMM_DEFAULT_P 384
  302. #define CGEMM_DEFAULT_P 768
  303. #else
  304. #define SGEMM_DEFAULT_P 448
  305. #define DGEMM_DEFAULT_P 480
  306. #define ZGEMM_DEFAULT_P 112
  307. #define CGEMM_DEFAULT_P 224
  308. #endif
  309. #define QGEMM_DEFAULT_P 112
  310. #define XGEMM_DEFAULT_P 56
  311. #if defined(ARCH_X86_64)
  312. #define SGEMM_DEFAULT_Q 192
  313. #define DGEMM_DEFAULT_Q 168
  314. #define ZGEMM_DEFAULT_Q 168
  315. #define CGEMM_DEFAULT_Q 168
  316. #else
  317. #define SGEMM_DEFAULT_Q 224
  318. #define DGEMM_DEFAULT_Q 224
  319. #define ZGEMM_DEFAULT_Q 224
  320. #define CGEMM_DEFAULT_Q 224
  321. #endif
  322. #define QGEMM_DEFAULT_Q 224
  323. #define XGEMM_DEFAULT_Q 224
  324. #define CGEMM3M_DEFAULT_P 448
  325. #define ZGEMM3M_DEFAULT_P 224
  326. #define XGEMM3M_DEFAULT_P 112
  327. #define CGEMM3M_DEFAULT_Q 224
  328. #define ZGEMM3M_DEFAULT_Q 224
  329. #define XGEMM3M_DEFAULT_Q 224
  330. #define CGEMM3M_DEFAULT_R 12288
  331. #define ZGEMM3M_DEFAULT_R 12288
  332. #define XGEMM3M_DEFAULT_R 12288
  333. #define SGEMM_DEFAULT_R 12288
  334. #define QGEMM_DEFAULT_R qgemm_r
  335. #define DGEMM_DEFAULT_R 12288
  336. #define CGEMM_DEFAULT_R cgemm_r
  337. #define ZGEMM_DEFAULT_R zgemm_r
  338. #define XGEMM_DEFAULT_R xgemm_r
  339. #define SYMV_P 16
  340. #define HAVE_EXCLUSIVE_CACHE
  341. #define GEMM_THREAD gemm_thread_mn
  342. #endif
  343. #ifdef STEAMROLLER
  344. #define SNUMOPT 8
  345. #define DNUMOPT 4
  346. #define GEMM_DEFAULT_OFFSET_A 64
  347. #define GEMM_DEFAULT_OFFSET_B 832
  348. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  349. #define QGEMM_DEFAULT_UNROLL_N 2
  350. #define CGEMM_DEFAULT_UNROLL_N 2
  351. #define ZGEMM_DEFAULT_UNROLL_N 2
  352. #define XGEMM_DEFAULT_UNROLL_N 1
  353. #ifdef ARCH_X86
  354. #define SGEMM_DEFAULT_UNROLL_N 4
  355. #define DGEMM_DEFAULT_UNROLL_N 4
  356. #define SGEMM_DEFAULT_UNROLL_M 4
  357. #define DGEMM_DEFAULT_UNROLL_M 2
  358. #define QGEMM_DEFAULT_UNROLL_M 2
  359. #define CGEMM_DEFAULT_UNROLL_M 2
  360. #define ZGEMM_DEFAULT_UNROLL_M 1
  361. #define XGEMM_DEFAULT_UNROLL_M 1
  362. #else
  363. #define SGEMM_DEFAULT_UNROLL_N 2
  364. #define DGEMM_DEFAULT_UNROLL_N 2
  365. #define SGEMM_DEFAULT_UNROLL_M 16
  366. #define DGEMM_DEFAULT_UNROLL_M 8
  367. #define QGEMM_DEFAULT_UNROLL_M 2
  368. #define CGEMM_DEFAULT_UNROLL_M 4
  369. #define ZGEMM_DEFAULT_UNROLL_M 2
  370. #define XGEMM_DEFAULT_UNROLL_M 1
  371. #define CGEMM3M_DEFAULT_UNROLL_N 4
  372. #define CGEMM3M_DEFAULT_UNROLL_M 8
  373. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  374. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  375. #define GEMV_UNROLL 8
  376. #endif
  377. #if defined(ARCH_X86_64)
  378. #define SGEMM_DEFAULT_P 768
  379. #define DGEMM_DEFAULT_P 576
  380. #define ZGEMM_DEFAULT_P 288
  381. #define CGEMM_DEFAULT_P 576
  382. #else
  383. #define SGEMM_DEFAULT_P 448
  384. #define DGEMM_DEFAULT_P 480
  385. #define ZGEMM_DEFAULT_P 112
  386. #define CGEMM_DEFAULT_P 224
  387. #endif
  388. #define QGEMM_DEFAULT_P 112
  389. #define XGEMM_DEFAULT_P 56
  390. #if defined(ARCH_X86_64)
  391. #define SGEMM_DEFAULT_Q 192
  392. #define DGEMM_DEFAULT_Q 160
  393. #define ZGEMM_DEFAULT_Q 160
  394. #define CGEMM_DEFAULT_Q 160
  395. #else
  396. #define SGEMM_DEFAULT_Q 224
  397. #define DGEMM_DEFAULT_Q 224
  398. #define ZGEMM_DEFAULT_Q 224
  399. #define CGEMM_DEFAULT_Q 224
  400. #endif
  401. #define QGEMM_DEFAULT_Q 224
  402. #define XGEMM_DEFAULT_Q 224
  403. #define CGEMM3M_DEFAULT_P 448
  404. #define ZGEMM3M_DEFAULT_P 224
  405. #define XGEMM3M_DEFAULT_P 112
  406. #define CGEMM3M_DEFAULT_Q 224
  407. #define ZGEMM3M_DEFAULT_Q 224
  408. #define XGEMM3M_DEFAULT_Q 224
  409. #define CGEMM3M_DEFAULT_R 12288
  410. #define ZGEMM3M_DEFAULT_R 12288
  411. #define XGEMM3M_DEFAULT_R 12288
  412. #define SGEMM_DEFAULT_R 12288
  413. #define QGEMM_DEFAULT_R qgemm_r
  414. #define DGEMM_DEFAULT_R 12288
  415. #define CGEMM_DEFAULT_R cgemm_r
  416. #define ZGEMM_DEFAULT_R zgemm_r
  417. #define XGEMM_DEFAULT_R xgemm_r
  418. #define SYMV_P 16
  419. #define HAVE_EXCLUSIVE_CACHE
  420. #define GEMM_THREAD gemm_thread_mn
  421. #endif
  422. #ifdef EXCAVATOR
  423. #define SNUMOPT 8
  424. #define DNUMOPT 4
  425. #define GEMM_DEFAULT_OFFSET_A 64
  426. #define GEMM_DEFAULT_OFFSET_B 832
  427. #define GEMM_DEFAULT_ALIGN 0x0fffUL
  428. #define QGEMM_DEFAULT_UNROLL_N 2
  429. #define CGEMM_DEFAULT_UNROLL_N 2
  430. #define ZGEMM_DEFAULT_UNROLL_N 2
  431. #define XGEMM_DEFAULT_UNROLL_N 1
  432. #ifdef ARCH_X86
  433. #define SGEMM_DEFAULT_UNROLL_N 4
  434. #define DGEMM_DEFAULT_UNROLL_N 4
  435. #define SGEMM_DEFAULT_UNROLL_M 4
  436. #define DGEMM_DEFAULT_UNROLL_M 2
  437. #define QGEMM_DEFAULT_UNROLL_M 2
  438. #define CGEMM_DEFAULT_UNROLL_M 2
  439. #define ZGEMM_DEFAULT_UNROLL_M 1
  440. #define XGEMM_DEFAULT_UNROLL_M 1
  441. #else
  442. #define SGEMM_DEFAULT_UNROLL_N 2
  443. #define DGEMM_DEFAULT_UNROLL_N 2
  444. #define SGEMM_DEFAULT_UNROLL_M 16
  445. #define DGEMM_DEFAULT_UNROLL_M 8
  446. #define QGEMM_DEFAULT_UNROLL_M 2
  447. #define CGEMM_DEFAULT_UNROLL_M 4
  448. #define ZGEMM_DEFAULT_UNROLL_M 2
  449. #define XGEMM_DEFAULT_UNROLL_M 1
  450. #define CGEMM3M_DEFAULT_UNROLL_N 4
  451. #define CGEMM3M_DEFAULT_UNROLL_M 8
  452. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  453. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  454. #define GEMV_UNROLL 8
  455. #endif
  456. #if defined(ARCH_X86_64)
  457. #define SGEMM_DEFAULT_P 768
  458. #define DGEMM_DEFAULT_P 576
  459. #define ZGEMM_DEFAULT_P 288
  460. #define CGEMM_DEFAULT_P 576
  461. #else
  462. #define SGEMM_DEFAULT_P 448
  463. #define DGEMM_DEFAULT_P 480
  464. #define ZGEMM_DEFAULT_P 112
  465. #define CGEMM_DEFAULT_P 224
  466. #endif
  467. #define QGEMM_DEFAULT_P 112
  468. #define XGEMM_DEFAULT_P 56
  469. #if defined(ARCH_X86_64)
  470. #define SGEMM_DEFAULT_Q 192
  471. #define DGEMM_DEFAULT_Q 160
  472. #define ZGEMM_DEFAULT_Q 160
  473. #define CGEMM_DEFAULT_Q 160
  474. #else
  475. #define SGEMM_DEFAULT_Q 224
  476. #define DGEMM_DEFAULT_Q 224
  477. #define ZGEMM_DEFAULT_Q 224
  478. #define CGEMM_DEFAULT_Q 224
  479. #endif
  480. #define QGEMM_DEFAULT_Q 224
  481. #define XGEMM_DEFAULT_Q 224
  482. #define CGEMM3M_DEFAULT_P 448
  483. #define ZGEMM3M_DEFAULT_P 224
  484. #define XGEMM3M_DEFAULT_P 112
  485. #define CGEMM3M_DEFAULT_Q 224
  486. #define ZGEMM3M_DEFAULT_Q 224
  487. #define XGEMM3M_DEFAULT_Q 224
  488. #define CGEMM3M_DEFAULT_R 12288
  489. #define ZGEMM3M_DEFAULT_R 12288
  490. #define XGEMM3M_DEFAULT_R 12288
  491. #define SGEMM_DEFAULT_R 12288
  492. #define QGEMM_DEFAULT_R qgemm_r
  493. #define DGEMM_DEFAULT_R 12288
  494. #define CGEMM_DEFAULT_R cgemm_r
  495. #define ZGEMM_DEFAULT_R zgemm_r
  496. #define XGEMM_DEFAULT_R xgemm_r
  497. #define SYMV_P 16
  498. #define HAVE_EXCLUSIVE_CACHE
  499. #define GEMM_THREAD gemm_thread_mn
  500. #endif
  501. #ifdef ZEN
  502. #define SNUMOPT 16
  503. #define DNUMOPT 8
  504. #define GEMM_DEFAULT_OFFSET_A 0
  505. #define GEMM_DEFAULT_OFFSET_B 0
  506. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  507. #define SYMV_P 8
  508. #define SWITCH_RATIO 16
  509. #ifdef ARCH_X86
  510. #define SGEMM_DEFAULT_UNROLL_M 4
  511. #define DGEMM_DEFAULT_UNROLL_M 2
  512. #define QGEMM_DEFAULT_UNROLL_M 2
  513. #define CGEMM_DEFAULT_UNROLL_M 2
  514. #define ZGEMM_DEFAULT_UNROLL_M 1
  515. #define XGEMM_DEFAULT_UNROLL_M 1
  516. #define SGEMM_DEFAULT_UNROLL_N 4
  517. #define DGEMM_DEFAULT_UNROLL_N 4
  518. #define QGEMM_DEFAULT_UNROLL_N 2
  519. #define CGEMM_DEFAULT_UNROLL_N 2
  520. #define ZGEMM_DEFAULT_UNROLL_N 2
  521. #define XGEMM_DEFAULT_UNROLL_N 1
  522. #else
  523. #define SGEMM_DEFAULT_UNROLL_M 8
  524. #define DGEMM_DEFAULT_UNROLL_M 4
  525. #define QGEMM_DEFAULT_UNROLL_M 2
  526. #define CGEMM_DEFAULT_UNROLL_M 8
  527. #define ZGEMM_DEFAULT_UNROLL_M 4
  528. #define XGEMM_DEFAULT_UNROLL_M 1
  529. #define SGEMM_DEFAULT_UNROLL_N 4
  530. #define DGEMM_DEFAULT_UNROLL_N 8
  531. #define QGEMM_DEFAULT_UNROLL_N 2
  532. #define CGEMM_DEFAULT_UNROLL_N 2
  533. #define ZGEMM_DEFAULT_UNROLL_N 2
  534. #define XGEMM_DEFAULT_UNROLL_N 1
  535. #define SGEMM_DEFAULT_UNROLL_MN 32
  536. #define DGEMM_DEFAULT_UNROLL_MN 32
  537. #endif
  538. #ifdef ARCH_X86
  539. #define SGEMM_DEFAULT_P 512
  540. #define SGEMM_DEFAULT_R sgemm_r
  541. #define DGEMM_DEFAULT_P 512
  542. #define DGEMM_DEFAULT_R dgemm_r
  543. #define QGEMM_DEFAULT_P 504
  544. #define QGEMM_DEFAULT_R qgemm_r
  545. #define CGEMM_DEFAULT_P 128
  546. #define CGEMM_DEFAULT_R 1024
  547. #define ZGEMM_DEFAULT_P 512
  548. #define ZGEMM_DEFAULT_R zgemm_r
  549. #define XGEMM_DEFAULT_P 252
  550. #define XGEMM_DEFAULT_R xgemm_r
  551. #define SGEMM_DEFAULT_Q 256
  552. #define DGEMM_DEFAULT_Q 256
  553. #define QGEMM_DEFAULT_Q 128
  554. #define CGEMM_DEFAULT_Q 256
  555. #define ZGEMM_DEFAULT_Q 192
  556. #define XGEMM_DEFAULT_Q 128
  557. #else
  558. #define SGEMM_DEFAULT_P 320
  559. #define DGEMM_DEFAULT_P 512
  560. #define CGEMM_DEFAULT_P 256
  561. #define ZGEMM_DEFAULT_P 192
  562. #ifdef WINDOWS_ABI
  563. #define SGEMM_DEFAULT_Q 320
  564. #define DGEMM_DEFAULT_Q 128
  565. #else
  566. #define SGEMM_DEFAULT_Q 320
  567. #define DGEMM_DEFAULT_Q 256
  568. #endif
  569. #define CGEMM_DEFAULT_Q 256
  570. #define ZGEMM_DEFAULT_Q 192
  571. #define SGEMM_DEFAULT_R sgemm_r
  572. #define DGEMM_DEFAULT_R 13824
  573. #define CGEMM_DEFAULT_R cgemm_r
  574. #define ZGEMM_DEFAULT_R zgemm_r
  575. #define QGEMM_DEFAULT_Q 128
  576. #define QGEMM_DEFAULT_P 504
  577. #define QGEMM_DEFAULT_R qgemm_r
  578. #define XGEMM_DEFAULT_P 252
  579. #define XGEMM_DEFAULT_R xgemm_r
  580. #define XGEMM_DEFAULT_Q 128
  581. #define CGEMM3M_DEFAULT_UNROLL_N 4
  582. #define CGEMM3M_DEFAULT_UNROLL_M 8
  583. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  584. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  585. #define CGEMM3M_DEFAULT_P 320
  586. #define ZGEMM3M_DEFAULT_P 256
  587. #define XGEMM3M_DEFAULT_P 112
  588. #define CGEMM3M_DEFAULT_Q 320
  589. #define ZGEMM3M_DEFAULT_Q 256
  590. #define XGEMM3M_DEFAULT_Q 224
  591. #define CGEMM3M_DEFAULT_R 12288
  592. #define ZGEMM3M_DEFAULT_R 12288
  593. #define XGEMM3M_DEFAULT_R 12288
  594. #endif
  595. #endif
  596. #ifdef ATHLON
  597. #define SNUMOPT 4
  598. #define DNUMOPT 2
  599. #define GEMM_DEFAULT_OFFSET_A 0
  600. #define GEMM_DEFAULT_OFFSET_B 384
  601. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  602. #define SGEMM_DEFAULT_UNROLL_N 4
  603. #define DGEMM_DEFAULT_UNROLL_N 4
  604. #define QGEMM_DEFAULT_UNROLL_N 2
  605. #define CGEMM_DEFAULT_UNROLL_N 2
  606. #define ZGEMM_DEFAULT_UNROLL_N 2
  607. #define XGEMM_DEFAULT_UNROLL_N 1
  608. #define SGEMM_DEFAULT_UNROLL_M 2
  609. #define DGEMM_DEFAULT_UNROLL_M 1
  610. #define QGEMM_DEFAULT_UNROLL_M 2
  611. #define CGEMM_DEFAULT_UNROLL_M 1
  612. #define ZGEMM_DEFAULT_UNROLL_M 1
  613. #define XGEMM_DEFAULT_UNROLL_M 1
  614. #define SGEMM_DEFAULT_R sgemm_r
  615. #define DGEMM_DEFAULT_R dgemm_r
  616. #define QGEMM_DEFAULT_R qgemm_r
  617. #define CGEMM_DEFAULT_R cgemm_r
  618. #define ZGEMM_DEFAULT_R zgemm_r
  619. #define XGEMM_DEFAULT_R xgemm_r
  620. #define SGEMM_DEFAULT_P 208
  621. #define DGEMM_DEFAULT_P 104
  622. #define QGEMM_DEFAULT_P 56
  623. #define CGEMM_DEFAULT_P 104
  624. #define ZGEMM_DEFAULT_P 56
  625. #define XGEMM_DEFAULT_P 28
  626. #define SGEMM_DEFAULT_Q 208
  627. #define DGEMM_DEFAULT_Q 208
  628. #define QGEMM_DEFAULT_Q 208
  629. #define CGEMM_DEFAULT_Q 208
  630. #define ZGEMM_DEFAULT_Q 208
  631. #define XGEMM_DEFAULT_Q 208
  632. #define SYMV_P 16
  633. #define HAVE_EXCLUSIVE_CACHE
  634. #endif
  635. #ifdef VIAC3
  636. #define SNUMOPT 2
  637. #define DNUMOPT 1
  638. #define GEMM_DEFAULT_OFFSET_A 0
  639. #define GEMM_DEFAULT_OFFSET_B 256
  640. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  641. #define SGEMM_DEFAULT_UNROLL_N 4
  642. #define DGEMM_DEFAULT_UNROLL_N 4
  643. #define QGEMM_DEFAULT_UNROLL_N 2
  644. #define CGEMM_DEFAULT_UNROLL_N 2
  645. #define ZGEMM_DEFAULT_UNROLL_N 2
  646. #define XGEMM_DEFAULT_UNROLL_N 1
  647. #define SGEMM_DEFAULT_UNROLL_M 2
  648. #define DGEMM_DEFAULT_UNROLL_M 1
  649. #define QGEMM_DEFAULT_UNROLL_M 2
  650. #define CGEMM_DEFAULT_UNROLL_M 1
  651. #define ZGEMM_DEFAULT_UNROLL_M 1
  652. #define XGEMM_DEFAULT_UNROLL_M 1
  653. #define SGEMM_DEFAULT_R sgemm_r
  654. #define DGEMM_DEFAULT_R dgemm_r
  655. #define QGEMM_DEFAULT_R qgemm_r
  656. #define CGEMM_DEFAULT_R cgemm_r
  657. #define ZGEMM_DEFAULT_R zgemm_r
  658. #define XGEMM_DEFAULT_R xgemm_r
  659. #define SGEMM_DEFAULT_P 128
  660. #define DGEMM_DEFAULT_P 128
  661. #define QGEMM_DEFAULT_P 128
  662. #define CGEMM_DEFAULT_P 128
  663. #define ZGEMM_DEFAULT_P 128
  664. #define XGEMM_DEFAULT_P 128
  665. #define SGEMM_DEFAULT_Q 512
  666. #define DGEMM_DEFAULT_Q 256
  667. #define QGEMM_DEFAULT_Q 256
  668. #define CGEMM_DEFAULT_Q 256
  669. #define ZGEMM_DEFAULT_Q 128
  670. #define XGEMM_DEFAULT_Q 128
  671. #define SYMV_P 16
  672. #endif
  673. #ifdef NANO
  674. #define SNUMOPT 4
  675. #define DNUMOPT 2
  676. #define GEMM_DEFAULT_OFFSET_A 64
  677. #define GEMM_DEFAULT_OFFSET_B 256
  678. #define GEMM_DEFAULT_ALIGN 0x01ffffUL
  679. #ifdef ARCH_X86
  680. #define SGEMM_DEFAULT_UNROLL_N 4
  681. #define DGEMM_DEFAULT_UNROLL_N 4
  682. #define QGEMM_DEFAULT_UNROLL_N 2
  683. #define CGEMM_DEFAULT_UNROLL_N 2
  684. #define ZGEMM_DEFAULT_UNROLL_N 2
  685. #define XGEMM_DEFAULT_UNROLL_N 1
  686. #define SGEMM_DEFAULT_UNROLL_M 4
  687. #define DGEMM_DEFAULT_UNROLL_M 2
  688. #define QGEMM_DEFAULT_UNROLL_M 2
  689. #define CGEMM_DEFAULT_UNROLL_M 2
  690. #define ZGEMM_DEFAULT_UNROLL_M 1
  691. #define XGEMM_DEFAULT_UNROLL_M 1
  692. #else
  693. #define SGEMM_DEFAULT_UNROLL_N 8
  694. #define DGEMM_DEFAULT_UNROLL_N 4
  695. #define QGEMM_DEFAULT_UNROLL_N 2
  696. #define CGEMM_DEFAULT_UNROLL_N 4
  697. #define ZGEMM_DEFAULT_UNROLL_N 2
  698. #define XGEMM_DEFAULT_UNROLL_N 1
  699. #define SGEMM_DEFAULT_UNROLL_M 4
  700. #define DGEMM_DEFAULT_UNROLL_M 4
  701. #define QGEMM_DEFAULT_UNROLL_M 2
  702. #define CGEMM_DEFAULT_UNROLL_M 2
  703. #define ZGEMM_DEFAULT_UNROLL_M 2
  704. #define XGEMM_DEFAULT_UNROLL_M 1
  705. #endif
  706. #define SGEMM_DEFAULT_P 288
  707. #define DGEMM_DEFAULT_P 288
  708. #define QGEMM_DEFAULT_P 288
  709. #define CGEMM_DEFAULT_P 288
  710. #define ZGEMM_DEFAULT_P 288
  711. #define XGEMM_DEFAULT_P 288
  712. #define SGEMM_DEFAULT_R sgemm_r
  713. #define DGEMM_DEFAULT_R dgemm_r
  714. #define QGEMM_DEFAULT_R qgemm_r
  715. #define CGEMM_DEFAULT_R cgemm_r
  716. #define ZGEMM_DEFAULT_R zgemm_r
  717. #define XGEMM_DEFAULT_R xgemm_r
  718. #define SGEMM_DEFAULT_Q 256
  719. #define DGEMM_DEFAULT_Q 128
  720. #define QGEMM_DEFAULT_Q 64
  721. #define CGEMM_DEFAULT_Q 128
  722. #define ZGEMM_DEFAULT_Q 64
  723. #define XGEMM_DEFAULT_Q 32
  724. #define SYMV_P 16
  725. #define HAVE_EXCLUSIVE_CACHE
  726. #endif
  727. #if defined(PENTIUM) || defined(PENTIUM2) || defined(PENTIUM3)
  728. #ifdef HAVE_SSE
  729. #define SNUMOPT 2
  730. #else
  731. #define SNUMOPT 1
  732. #endif
  733. #define DNUMOPT 1
  734. #define GEMM_DEFAULT_OFFSET_A 0
  735. #define GEMM_DEFAULT_OFFSET_B 0
  736. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  737. #ifdef HAVE_SSE
  738. #define SGEMM_DEFAULT_UNROLL_M 8
  739. #define CGEMM_DEFAULT_UNROLL_M 4
  740. #else
  741. #define SGEMM_DEFAULT_UNROLL_M 4
  742. #define CGEMM_DEFAULT_UNROLL_M 2
  743. #endif
  744. #define DGEMM_DEFAULT_UNROLL_M 2
  745. #define SGEMM_DEFAULT_UNROLL_N 2
  746. #define DGEMM_DEFAULT_UNROLL_N 2
  747. #define QGEMM_DEFAULT_UNROLL_M 2
  748. #define QGEMM_DEFAULT_UNROLL_N 2
  749. #define CGEMM_DEFAULT_UNROLL_N 1
  750. #define ZGEMM_DEFAULT_UNROLL_M 1
  751. #define ZGEMM_DEFAULT_UNROLL_N 1
  752. #define XGEMM_DEFAULT_UNROLL_M 1
  753. #define XGEMM_DEFAULT_UNROLL_N 1
  754. #define SGEMM_DEFAULT_P sgemm_p
  755. #define SGEMM_DEFAULT_Q 256
  756. #define SGEMM_DEFAULT_R sgemm_r
  757. #define DGEMM_DEFAULT_P dgemm_p
  758. #define DGEMM_DEFAULT_Q 256
  759. #define DGEMM_DEFAULT_R dgemm_r
  760. #define QGEMM_DEFAULT_P qgemm_p
  761. #define QGEMM_DEFAULT_Q 256
  762. #define QGEMM_DEFAULT_R qgemm_r
  763. #define CGEMM_DEFAULT_P cgemm_p
  764. #define CGEMM_DEFAULT_Q 256
  765. #define CGEMM_DEFAULT_R cgemm_r
  766. #define ZGEMM_DEFAULT_P zgemm_p
  767. #define ZGEMM_DEFAULT_Q 256
  768. #define ZGEMM_DEFAULT_R zgemm_r
  769. #define XGEMM_DEFAULT_P xgemm_p
  770. #define XGEMM_DEFAULT_Q 256
  771. #define XGEMM_DEFAULT_R xgemm_r
  772. #define SYMV_P 4
  773. #endif
  774. #ifdef PENTIUMM
  775. #define SNUMOPT 2
  776. #define DNUMOPT 1
  777. #define GEMM_DEFAULT_OFFSET_A 0
  778. #define GEMM_DEFAULT_OFFSET_B 0
  779. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  780. #ifdef CORE_YONAH
  781. #define SGEMM_DEFAULT_UNROLL_M 4
  782. #define SGEMM_DEFAULT_UNROLL_N 4
  783. #define DGEMM_DEFAULT_UNROLL_M 2
  784. #define DGEMM_DEFAULT_UNROLL_N 4
  785. #define QGEMM_DEFAULT_UNROLL_M 2
  786. #define QGEMM_DEFAULT_UNROLL_N 2
  787. #define CGEMM_DEFAULT_UNROLL_M 2
  788. #define CGEMM_DEFAULT_UNROLL_N 2
  789. #define ZGEMM_DEFAULT_UNROLL_M 1
  790. #define ZGEMM_DEFAULT_UNROLL_N 2
  791. #define XGEMM_DEFAULT_UNROLL_M 1
  792. #define XGEMM_DEFAULT_UNROLL_N 1
  793. #else
  794. #define SGEMM_DEFAULT_UNROLL_M 8
  795. #define SGEMM_DEFAULT_UNROLL_N 2
  796. #define DGEMM_DEFAULT_UNROLL_M 2
  797. #define DGEMM_DEFAULT_UNROLL_N 2
  798. #define QGEMM_DEFAULT_UNROLL_M 2
  799. #define QGEMM_DEFAULT_UNROLL_N 2
  800. #define CGEMM_DEFAULT_UNROLL_M 4
  801. #define CGEMM_DEFAULT_UNROLL_N 1
  802. #define ZGEMM_DEFAULT_UNROLL_M 1
  803. #define ZGEMM_DEFAULT_UNROLL_N 1
  804. #define XGEMM_DEFAULT_UNROLL_M 1
  805. #define XGEMM_DEFAULT_UNROLL_N 1
  806. #endif
  807. #define SGEMM_DEFAULT_P sgemm_p
  808. #define SGEMM_DEFAULT_Q 256
  809. #define SGEMM_DEFAULT_R sgemm_r
  810. #define DGEMM_DEFAULT_P dgemm_p
  811. #define DGEMM_DEFAULT_Q 256
  812. #define DGEMM_DEFAULT_R dgemm_r
  813. #define QGEMM_DEFAULT_P qgemm_p
  814. #define QGEMM_DEFAULT_Q 256
  815. #define QGEMM_DEFAULT_R qgemm_r
  816. #define CGEMM_DEFAULT_P cgemm_p
  817. #define CGEMM_DEFAULT_Q 256
  818. #define CGEMM_DEFAULT_R cgemm_r
  819. #define ZGEMM_DEFAULT_P zgemm_p
  820. #define ZGEMM_DEFAULT_Q 256
  821. #define ZGEMM_DEFAULT_R zgemm_r
  822. #define XGEMM_DEFAULT_P xgemm_p
  823. #define XGEMM_DEFAULT_Q 256
  824. #define XGEMM_DEFAULT_R xgemm_r
  825. #define SYMV_P 4
  826. #endif
  827. #ifdef CORE_NORTHWOOD
  828. #define SNUMOPT 4
  829. #define DNUMOPT 2
  830. #define GEMM_DEFAULT_OFFSET_A 0
  831. #define GEMM_DEFAULT_OFFSET_B 32
  832. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  833. #define SYMV_P 8
  834. #define SGEMM_DEFAULT_UNROLL_M 8
  835. #define DGEMM_DEFAULT_UNROLL_M 4
  836. #define QGEMM_DEFAULT_UNROLL_M 2
  837. #define CGEMM_DEFAULT_UNROLL_M 4
  838. #define ZGEMM_DEFAULT_UNROLL_M 2
  839. #define XGEMM_DEFAULT_UNROLL_M 1
  840. #define SGEMM_DEFAULT_UNROLL_N 2
  841. #define DGEMM_DEFAULT_UNROLL_N 2
  842. #define QGEMM_DEFAULT_UNROLL_N 2
  843. #define CGEMM_DEFAULT_UNROLL_N 1
  844. #define ZGEMM_DEFAULT_UNROLL_N 1
  845. #define XGEMM_DEFAULT_UNROLL_N 1
  846. #define SGEMM_DEFAULT_P sgemm_p
  847. #define SGEMM_DEFAULT_R sgemm_r
  848. #define DGEMM_DEFAULT_P dgemm_p
  849. #define DGEMM_DEFAULT_R dgemm_r
  850. #define QGEMM_DEFAULT_P qgemm_p
  851. #define QGEMM_DEFAULT_R qgemm_r
  852. #define CGEMM_DEFAULT_P cgemm_p
  853. #define CGEMM_DEFAULT_R cgemm_r
  854. #define ZGEMM_DEFAULT_P zgemm_p
  855. #define ZGEMM_DEFAULT_R zgemm_r
  856. #define XGEMM_DEFAULT_P xgemm_p
  857. #define XGEMM_DEFAULT_R xgemm_r
  858. #define SGEMM_DEFAULT_Q 128
  859. #define DGEMM_DEFAULT_Q 128
  860. #define QGEMM_DEFAULT_Q 128
  861. #define CGEMM_DEFAULT_Q 128
  862. #define ZGEMM_DEFAULT_Q 128
  863. #define XGEMM_DEFAULT_Q 128
  864. #endif
  865. #ifdef CORE_PRESCOTT
  866. #define SNUMOPT 4
  867. #define DNUMOPT 2
  868. #ifndef __64BIT__
  869. #define GEMM_DEFAULT_OFFSET_A 128
  870. #define GEMM_DEFAULT_OFFSET_B 192
  871. #else
  872. #define GEMM_DEFAULT_OFFSET_A 0
  873. #define GEMM_DEFAULT_OFFSET_B 256
  874. #endif
  875. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  876. #define SYMV_P 8
  877. #ifdef ARCH_X86
  878. #define SGEMM_DEFAULT_UNROLL_M 4
  879. #define DGEMM_DEFAULT_UNROLL_M 2
  880. #define QGEMM_DEFAULT_UNROLL_M 2
  881. #define CGEMM_DEFAULT_UNROLL_M 2
  882. #define ZGEMM_DEFAULT_UNROLL_M 1
  883. #define XGEMM_DEFAULT_UNROLL_M 1
  884. #else
  885. #define SGEMM_DEFAULT_UNROLL_M 8
  886. #define DGEMM_DEFAULT_UNROLL_M 4
  887. #define QGEMM_DEFAULT_UNROLL_M 2
  888. #define CGEMM_DEFAULT_UNROLL_M 4
  889. #define ZGEMM_DEFAULT_UNROLL_M 2
  890. #define XGEMM_DEFAULT_UNROLL_M 1
  891. #endif
  892. #define SGEMM_DEFAULT_UNROLL_N 4
  893. #define DGEMM_DEFAULT_UNROLL_N 4
  894. #define QGEMM_DEFAULT_UNROLL_N 2
  895. #define CGEMM_DEFAULT_UNROLL_N 2
  896. #define ZGEMM_DEFAULT_UNROLL_N 2
  897. #define XGEMM_DEFAULT_UNROLL_N 1
  898. #define SGEMM_DEFAULT_P sgemm_p
  899. #define SGEMM_DEFAULT_R sgemm_r
  900. #define DGEMM_DEFAULT_P dgemm_p
  901. #define DGEMM_DEFAULT_R dgemm_r
  902. #define QGEMM_DEFAULT_P qgemm_p
  903. #define QGEMM_DEFAULT_R qgemm_r
  904. #define CGEMM_DEFAULT_P cgemm_p
  905. #define CGEMM_DEFAULT_R cgemm_r
  906. #define ZGEMM_DEFAULT_P zgemm_p
  907. #define ZGEMM_DEFAULT_R zgemm_r
  908. #define XGEMM_DEFAULT_P xgemm_p
  909. #define XGEMM_DEFAULT_R xgemm_r
  910. #define SGEMM_DEFAULT_Q 128
  911. #define DGEMM_DEFAULT_Q 128
  912. #define QGEMM_DEFAULT_Q 128
  913. #define CGEMM_DEFAULT_Q 128
  914. #define ZGEMM_DEFAULT_Q 128
  915. #define XGEMM_DEFAULT_Q 128
  916. #endif
  917. #ifdef CORE2
  918. #define SNUMOPT 8
  919. #define DNUMOPT 4
  920. #define GEMM_DEFAULT_OFFSET_A 448
  921. #define GEMM_DEFAULT_OFFSET_B 128
  922. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  923. #define SYMV_P 8
  924. #define SWITCH_RATIO 4
  925. #ifdef ARCH_X86
  926. #define SGEMM_DEFAULT_UNROLL_M 8
  927. #define DGEMM_DEFAULT_UNROLL_M 4
  928. #define QGEMM_DEFAULT_UNROLL_M 2
  929. #define CGEMM_DEFAULT_UNROLL_M 4
  930. #define ZGEMM_DEFAULT_UNROLL_M 2
  931. #define XGEMM_DEFAULT_UNROLL_M 1
  932. #define SGEMM_DEFAULT_UNROLL_N 2
  933. #define DGEMM_DEFAULT_UNROLL_N 2
  934. #define QGEMM_DEFAULT_UNROLL_N 2
  935. #define CGEMM_DEFAULT_UNROLL_N 1
  936. #define ZGEMM_DEFAULT_UNROLL_N 1
  937. #define XGEMM_DEFAULT_UNROLL_N 1
  938. #define MASK(a, b) ((((a) + (b) - 1) / (b)) * (b))
  939. #else
  940. #define SGEMM_DEFAULT_UNROLL_M 8
  941. #define DGEMM_DEFAULT_UNROLL_M 4
  942. #define QGEMM_DEFAULT_UNROLL_M 2
  943. #define CGEMM_DEFAULT_UNROLL_M 4
  944. #define ZGEMM_DEFAULT_UNROLL_M 2
  945. #define XGEMM_DEFAULT_UNROLL_M 1
  946. #define SGEMM_DEFAULT_UNROLL_N 4
  947. #define DGEMM_DEFAULT_UNROLL_N 4
  948. #define QGEMM_DEFAULT_UNROLL_N 2
  949. #define CGEMM_DEFAULT_UNROLL_N 2
  950. #define ZGEMM_DEFAULT_UNROLL_N 2
  951. #define XGEMM_DEFAULT_UNROLL_N 1
  952. #endif
  953. #define SGEMM_DEFAULT_P sgemm_p
  954. #define SGEMM_DEFAULT_R sgemm_r
  955. #define DGEMM_DEFAULT_P dgemm_p
  956. #define DGEMM_DEFAULT_R dgemm_r
  957. #define QGEMM_DEFAULT_P qgemm_p
  958. #define QGEMM_DEFAULT_R qgemm_r
  959. #define CGEMM_DEFAULT_P cgemm_p
  960. #define CGEMM_DEFAULT_R cgemm_r
  961. #define ZGEMM_DEFAULT_P zgemm_p
  962. #define ZGEMM_DEFAULT_R zgemm_r
  963. #define XGEMM_DEFAULT_P xgemm_p
  964. #define XGEMM_DEFAULT_R xgemm_r
  965. #define SGEMM_DEFAULT_Q 256
  966. #define DGEMM_DEFAULT_Q 256
  967. #define QGEMM_DEFAULT_Q 256
  968. #define CGEMM_DEFAULT_Q 256
  969. #define ZGEMM_DEFAULT_Q 256
  970. #define XGEMM_DEFAULT_Q 256
  971. #endif
  972. #ifdef PENRYN
  973. #define SNUMOPT 8
  974. #define DNUMOPT 4
  975. #define GEMM_DEFAULT_OFFSET_A 128
  976. #define GEMM_DEFAULT_OFFSET_B 0
  977. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  978. #define SYMV_P 8
  979. #define SWITCH_RATIO 4
  980. #ifdef ARCH_X86
  981. #define SGEMM_DEFAULT_UNROLL_M 4
  982. #define DGEMM_DEFAULT_UNROLL_M 2
  983. #define QGEMM_DEFAULT_UNROLL_M 2
  984. #define CGEMM_DEFAULT_UNROLL_M 2
  985. #define ZGEMM_DEFAULT_UNROLL_M 1
  986. #define XGEMM_DEFAULT_UNROLL_M 1
  987. #define SGEMM_DEFAULT_UNROLL_N 4
  988. #define DGEMM_DEFAULT_UNROLL_N 4
  989. #define QGEMM_DEFAULT_UNROLL_N 2
  990. #define CGEMM_DEFAULT_UNROLL_N 2
  991. #define ZGEMM_DEFAULT_UNROLL_N 2
  992. #define XGEMM_DEFAULT_UNROLL_N 1
  993. #else
  994. #define SGEMM_DEFAULT_UNROLL_M 8
  995. #define DGEMM_DEFAULT_UNROLL_M 4
  996. #define QGEMM_DEFAULT_UNROLL_M 2
  997. #define CGEMM_DEFAULT_UNROLL_M 4
  998. #define ZGEMM_DEFAULT_UNROLL_M 2
  999. #define XGEMM_DEFAULT_UNROLL_M 1
  1000. #define SGEMM_DEFAULT_UNROLL_N 4
  1001. #define DGEMM_DEFAULT_UNROLL_N 4
  1002. #define QGEMM_DEFAULT_UNROLL_N 2
  1003. #define CGEMM_DEFAULT_UNROLL_N 2
  1004. #define ZGEMM_DEFAULT_UNROLL_N 2
  1005. #define XGEMM_DEFAULT_UNROLL_N 1
  1006. #endif
  1007. #define SGEMM_DEFAULT_P sgemm_p
  1008. #define SGEMM_DEFAULT_R sgemm_r
  1009. #define DGEMM_DEFAULT_P dgemm_p
  1010. #define DGEMM_DEFAULT_R dgemm_r
  1011. #define QGEMM_DEFAULT_P qgemm_p
  1012. #define QGEMM_DEFAULT_R qgemm_r
  1013. #define CGEMM_DEFAULT_P cgemm_p
  1014. #define CGEMM_DEFAULT_R cgemm_r
  1015. #define ZGEMM_DEFAULT_P zgemm_p
  1016. #define ZGEMM_DEFAULT_R zgemm_r
  1017. #define XGEMM_DEFAULT_P xgemm_p
  1018. #define XGEMM_DEFAULT_R xgemm_r
  1019. #define SGEMM_DEFAULT_Q 512
  1020. #define DGEMM_DEFAULT_Q 256
  1021. #define QGEMM_DEFAULT_Q 128
  1022. #define CGEMM_DEFAULT_Q 512
  1023. #define ZGEMM_DEFAULT_Q 256
  1024. #define XGEMM_DEFAULT_Q 128
  1025. #define GETRF_FACTOR 0.75
  1026. #endif
  1027. #ifdef DUNNINGTON
  1028. #define SNUMOPT 8
  1029. #define DNUMOPT 4
  1030. #define GEMM_DEFAULT_OFFSET_A 128
  1031. #define GEMM_DEFAULT_OFFSET_B 0
  1032. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1033. #define SYMV_P 8
  1034. #define SWITCH_RATIO 4
  1035. #ifdef ARCH_X86
  1036. #define SGEMM_DEFAULT_UNROLL_M 4
  1037. #define DGEMM_DEFAULT_UNROLL_M 2
  1038. #define QGEMM_DEFAULT_UNROLL_M 2
  1039. #define CGEMM_DEFAULT_UNROLL_M 2
  1040. #define ZGEMM_DEFAULT_UNROLL_M 1
  1041. #define XGEMM_DEFAULT_UNROLL_M 1
  1042. #define SGEMM_DEFAULT_UNROLL_N 4
  1043. #define DGEMM_DEFAULT_UNROLL_N 4
  1044. #define QGEMM_DEFAULT_UNROLL_N 2
  1045. #define CGEMM_DEFAULT_UNROLL_N 2
  1046. #define ZGEMM_DEFAULT_UNROLL_N 2
  1047. #define XGEMM_DEFAULT_UNROLL_N 1
  1048. #else
  1049. #define SGEMM_DEFAULT_UNROLL_M 8
  1050. #define DGEMM_DEFAULT_UNROLL_M 4
  1051. #define QGEMM_DEFAULT_UNROLL_M 2
  1052. #define CGEMM_DEFAULT_UNROLL_M 4
  1053. #define ZGEMM_DEFAULT_UNROLL_M 2
  1054. #define XGEMM_DEFAULT_UNROLL_M 1
  1055. #define SGEMM_DEFAULT_UNROLL_N 4
  1056. #define DGEMM_DEFAULT_UNROLL_N 4
  1057. #define QGEMM_DEFAULT_UNROLL_N 2
  1058. #define CGEMM_DEFAULT_UNROLL_N 2
  1059. #define ZGEMM_DEFAULT_UNROLL_N 2
  1060. #define XGEMM_DEFAULT_UNROLL_N 1
  1061. #endif
  1062. #define SGEMM_DEFAULT_P sgemm_p
  1063. #define SGEMM_DEFAULT_R sgemm_r
  1064. #define DGEMM_DEFAULT_P dgemm_p
  1065. #define DGEMM_DEFAULT_R dgemm_r
  1066. #define QGEMM_DEFAULT_P qgemm_p
  1067. #define QGEMM_DEFAULT_R qgemm_r
  1068. #define CGEMM_DEFAULT_P cgemm_p
  1069. #define CGEMM_DEFAULT_R cgemm_r
  1070. #define ZGEMM_DEFAULT_P zgemm_p
  1071. #define ZGEMM_DEFAULT_R zgemm_r
  1072. #define XGEMM_DEFAULT_P xgemm_p
  1073. #define XGEMM_DEFAULT_R xgemm_r
  1074. #define SGEMM_DEFAULT_Q 768
  1075. #define DGEMM_DEFAULT_Q 384
  1076. #define QGEMM_DEFAULT_Q 192
  1077. #define CGEMM_DEFAULT_Q 768
  1078. #define ZGEMM_DEFAULT_Q 384
  1079. #define XGEMM_DEFAULT_Q 192
  1080. #define GETRF_FACTOR 0.75
  1081. #define GEMM_THREAD gemm_thread_mn
  1082. #endif
  1083. #ifdef NEHALEM
  1084. #define SNUMOPT 8
  1085. #define DNUMOPT 4
  1086. #define GEMM_DEFAULT_OFFSET_A 32
  1087. #define GEMM_DEFAULT_OFFSET_B 0
  1088. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1089. #define SYMV_P 8
  1090. #define SWITCH_RATIO 4
  1091. #ifdef ARCH_X86
  1092. #define SGEMM_DEFAULT_UNROLL_M 4
  1093. #define DGEMM_DEFAULT_UNROLL_M 2
  1094. #define QGEMM_DEFAULT_UNROLL_M 2
  1095. #define CGEMM_DEFAULT_UNROLL_M 2
  1096. #define ZGEMM_DEFAULT_UNROLL_M 1
  1097. #define XGEMM_DEFAULT_UNROLL_M 1
  1098. #define SGEMM_DEFAULT_UNROLL_N 4
  1099. #define DGEMM_DEFAULT_UNROLL_N 4
  1100. #define QGEMM_DEFAULT_UNROLL_N 2
  1101. #define CGEMM_DEFAULT_UNROLL_N 2
  1102. #define ZGEMM_DEFAULT_UNROLL_N 2
  1103. #define XGEMM_DEFAULT_UNROLL_N 1
  1104. #else
  1105. #define SGEMM_DEFAULT_UNROLL_M 4
  1106. #define DGEMM_DEFAULT_UNROLL_M 2
  1107. #define QGEMM_DEFAULT_UNROLL_M 2
  1108. #define CGEMM_DEFAULT_UNROLL_M 2
  1109. #define ZGEMM_DEFAULT_UNROLL_M 1
  1110. #define XGEMM_DEFAULT_UNROLL_M 1
  1111. #define SGEMM_DEFAULT_UNROLL_N 8
  1112. #define DGEMM_DEFAULT_UNROLL_N 8
  1113. #define QGEMM_DEFAULT_UNROLL_N 2
  1114. #define CGEMM_DEFAULT_UNROLL_N 4
  1115. #define ZGEMM_DEFAULT_UNROLL_N 4
  1116. #define XGEMM_DEFAULT_UNROLL_N 1
  1117. #endif
  1118. #define SGEMM_DEFAULT_P 504
  1119. #define SGEMM_DEFAULT_R sgemm_r
  1120. #define DGEMM_DEFAULT_P 504
  1121. #define DGEMM_DEFAULT_R dgemm_r
  1122. #define QGEMM_DEFAULT_P 504
  1123. #define QGEMM_DEFAULT_R qgemm_r
  1124. #define CGEMM_DEFAULT_P 252
  1125. #define CGEMM_DEFAULT_R cgemm_r
  1126. #define ZGEMM_DEFAULT_P 252
  1127. #define ZGEMM_DEFAULT_R zgemm_r
  1128. #define XGEMM_DEFAULT_P 252
  1129. #define XGEMM_DEFAULT_R xgemm_r
  1130. #define SGEMM_DEFAULT_Q 512
  1131. #define DGEMM_DEFAULT_Q 256
  1132. #define QGEMM_DEFAULT_Q 128
  1133. #define CGEMM_DEFAULT_Q 512
  1134. #define ZGEMM_DEFAULT_Q 256
  1135. #define XGEMM_DEFAULT_Q 128
  1136. #define GETRF_FACTOR 0.72
  1137. #endif
  1138. #ifdef SANDYBRIDGE
  1139. #define SNUMOPT 8
  1140. #define DNUMOPT 4
  1141. #define GEMM_DEFAULT_OFFSET_A 0
  1142. #define GEMM_DEFAULT_OFFSET_B 0
  1143. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1144. #define SYMV_P 8
  1145. #define SWITCH_RATIO 4
  1146. #ifdef ARCH_X86
  1147. #define SGEMM_DEFAULT_UNROLL_M 4
  1148. #define DGEMM_DEFAULT_UNROLL_M 2
  1149. #define QGEMM_DEFAULT_UNROLL_M 2
  1150. #define CGEMM_DEFAULT_UNROLL_M 2
  1151. #define ZGEMM_DEFAULT_UNROLL_M 1
  1152. #define XGEMM_DEFAULT_UNROLL_M 1
  1153. #define SGEMM_DEFAULT_UNROLL_N 4
  1154. #define DGEMM_DEFAULT_UNROLL_N 4
  1155. #define QGEMM_DEFAULT_UNROLL_N 2
  1156. #define CGEMM_DEFAULT_UNROLL_N 2
  1157. #define ZGEMM_DEFAULT_UNROLL_N 2
  1158. #define XGEMM_DEFAULT_UNROLL_N 1
  1159. #else
  1160. #define SGEMM_DEFAULT_UNROLL_M 16
  1161. #define DGEMM_DEFAULT_UNROLL_M 8
  1162. #define QGEMM_DEFAULT_UNROLL_M 2
  1163. #define CGEMM_DEFAULT_UNROLL_M 8
  1164. #define ZGEMM_DEFAULT_UNROLL_M 1
  1165. #define XGEMM_DEFAULT_UNROLL_M 1
  1166. #define SGEMM_DEFAULT_UNROLL_N 4
  1167. #define DGEMM_DEFAULT_UNROLL_N 4
  1168. #define QGEMM_DEFAULT_UNROLL_N 2
  1169. #define CGEMM_DEFAULT_UNROLL_N 2
  1170. #define ZGEMM_DEFAULT_UNROLL_N 4
  1171. #define XGEMM_DEFAULT_UNROLL_N 1
  1172. #endif
  1173. #define SGEMM_DEFAULT_P 768
  1174. #define SGEMM_DEFAULT_R sgemm_r
  1175. //#define SGEMM_DEFAULT_R 1024
  1176. #define DGEMM_DEFAULT_P 512
  1177. #define DGEMM_DEFAULT_R dgemm_r
  1178. //#define DGEMM_DEFAULT_R 1024
  1179. #define QGEMM_DEFAULT_P 504
  1180. #define QGEMM_DEFAULT_R qgemm_r
  1181. #define CGEMM_DEFAULT_P 768
  1182. #define CGEMM_DEFAULT_R cgemm_r
  1183. //#define CGEMM_DEFAULT_R 1024
  1184. #define ZGEMM_DEFAULT_P 512
  1185. #define ZGEMM_DEFAULT_R zgemm_r
  1186. //#define ZGEMM_DEFAULT_R 1024
  1187. #define XGEMM_DEFAULT_P 252
  1188. #define XGEMM_DEFAULT_R xgemm_r
  1189. #define SGEMM_DEFAULT_Q 384
  1190. #define DGEMM_DEFAULT_Q 256
  1191. #define QGEMM_DEFAULT_Q 128
  1192. #define CGEMM_DEFAULT_Q 512
  1193. #define ZGEMM_DEFAULT_Q 192
  1194. #define XGEMM_DEFAULT_Q 128
  1195. #define CGEMM3M_DEFAULT_UNROLL_N 8
  1196. #define CGEMM3M_DEFAULT_UNROLL_M 4
  1197. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  1198. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  1199. #define CGEMM3M_DEFAULT_P 448
  1200. #define ZGEMM3M_DEFAULT_P 224
  1201. #define XGEMM3M_DEFAULT_P 112
  1202. #define CGEMM3M_DEFAULT_Q 224
  1203. #define ZGEMM3M_DEFAULT_Q 224
  1204. #define XGEMM3M_DEFAULT_Q 224
  1205. #define CGEMM3M_DEFAULT_R 12288
  1206. #define ZGEMM3M_DEFAULT_R 12288
  1207. #define XGEMM3M_DEFAULT_R 12288
  1208. #define GETRF_FACTOR 0.72
  1209. #endif
  1210. #ifdef HASWELL
  1211. #define SNUMOPT 16
  1212. #define DNUMOPT 8
  1213. #define GEMM_DEFAULT_OFFSET_A 0
  1214. #define GEMM_DEFAULT_OFFSET_B 0
  1215. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1216. #define SYMV_P 8
  1217. #define SWITCH_RATIO 32
  1218. #define GEMM_PREFERED_SIZE 16
  1219. #ifdef ARCH_X86
  1220. #define SGEMM_DEFAULT_UNROLL_M 4
  1221. #define DGEMM_DEFAULT_UNROLL_M 2
  1222. #define QGEMM_DEFAULT_UNROLL_M 2
  1223. #define CGEMM_DEFAULT_UNROLL_M 2
  1224. #define ZGEMM_DEFAULT_UNROLL_M 1
  1225. #define XGEMM_DEFAULT_UNROLL_M 1
  1226. #define SGEMM_DEFAULT_UNROLL_N 4
  1227. #define DGEMM_DEFAULT_UNROLL_N 4
  1228. #define QGEMM_DEFAULT_UNROLL_N 2
  1229. #define CGEMM_DEFAULT_UNROLL_N 2
  1230. #define ZGEMM_DEFAULT_UNROLL_N 2
  1231. #define XGEMM_DEFAULT_UNROLL_N 1
  1232. #else
  1233. #define SGEMM_DEFAULT_UNROLL_M 8
  1234. #define DGEMM_DEFAULT_UNROLL_M 4
  1235. #define QGEMM_DEFAULT_UNROLL_M 2
  1236. #define CGEMM_DEFAULT_UNROLL_M 8
  1237. #define ZGEMM_DEFAULT_UNROLL_M 4
  1238. #define XGEMM_DEFAULT_UNROLL_M 1
  1239. #define SGEMM_DEFAULT_UNROLL_N 4
  1240. #define DGEMM_DEFAULT_UNROLL_N 8
  1241. #define QGEMM_DEFAULT_UNROLL_N 2
  1242. #define CGEMM_DEFAULT_UNROLL_N 2
  1243. #define ZGEMM_DEFAULT_UNROLL_N 2
  1244. #define XGEMM_DEFAULT_UNROLL_N 1
  1245. #define SGEMM_DEFAULT_UNROLL_MN 32
  1246. #define DGEMM_DEFAULT_UNROLL_MN 32
  1247. #endif
  1248. #ifdef ARCH_X86
  1249. #define SGEMM_DEFAULT_P 512
  1250. #define SGEMM_DEFAULT_R sgemm_r
  1251. #define DGEMM_DEFAULT_P 512
  1252. #define DGEMM_DEFAULT_R dgemm_r
  1253. #define QGEMM_DEFAULT_P 504
  1254. #define QGEMM_DEFAULT_R qgemm_r
  1255. #define CGEMM_DEFAULT_P 128
  1256. #define CGEMM_DEFAULT_R 1024
  1257. #define ZGEMM_DEFAULT_P 512
  1258. #define ZGEMM_DEFAULT_R zgemm_r
  1259. #define XGEMM_DEFAULT_P 252
  1260. #define XGEMM_DEFAULT_R xgemm_r
  1261. #define SGEMM_DEFAULT_Q 256
  1262. #define DGEMM_DEFAULT_Q 256
  1263. #define QGEMM_DEFAULT_Q 128
  1264. #define CGEMM_DEFAULT_Q 256
  1265. #define ZGEMM_DEFAULT_Q 192
  1266. #define XGEMM_DEFAULT_Q 128
  1267. #else
  1268. #define SGEMM_DEFAULT_P 320
  1269. #define DGEMM_DEFAULT_P 512
  1270. #define CGEMM_DEFAULT_P 256
  1271. #define ZGEMM_DEFAULT_P 192
  1272. #ifdef WINDOWS_ABI
  1273. #define SGEMM_DEFAULT_Q 320
  1274. #define DGEMM_DEFAULT_Q 128
  1275. #else
  1276. #define SGEMM_DEFAULT_Q 320
  1277. #define DGEMM_DEFAULT_Q 256
  1278. #endif
  1279. #define CGEMM_DEFAULT_Q 256
  1280. #define ZGEMM_DEFAULT_Q 192
  1281. #define SGEMM_DEFAULT_R sgemm_r
  1282. #define DGEMM_DEFAULT_R 13824
  1283. #define CGEMM_DEFAULT_R cgemm_r
  1284. #define ZGEMM_DEFAULT_R zgemm_r
  1285. #define QGEMM_DEFAULT_Q 128
  1286. #define QGEMM_DEFAULT_P 504
  1287. #define QGEMM_DEFAULT_R qgemm_r
  1288. #define XGEMM_DEFAULT_P 252
  1289. #define XGEMM_DEFAULT_R xgemm_r
  1290. #define XGEMM_DEFAULT_Q 128
  1291. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1292. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1293. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1294. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1295. #define CGEMM3M_DEFAULT_P 320
  1296. #define ZGEMM3M_DEFAULT_P 256
  1297. #define XGEMM3M_DEFAULT_P 112
  1298. #define CGEMM3M_DEFAULT_Q 320
  1299. #define ZGEMM3M_DEFAULT_Q 256
  1300. #define XGEMM3M_DEFAULT_Q 224
  1301. #define CGEMM3M_DEFAULT_R 12288
  1302. #define ZGEMM3M_DEFAULT_R 12288
  1303. #define XGEMM3M_DEFAULT_R 12288
  1304. #endif
  1305. #endif
  1306. #ifdef SKYLAKEX
  1307. #define SNUMOPT 16
  1308. #define DNUMOPT 8
  1309. #define GEMM_DEFAULT_OFFSET_A 0
  1310. #define GEMM_DEFAULT_OFFSET_B 0
  1311. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1312. #define SYMV_P 8
  1313. #define SWITCH_RATIO 32
  1314. #define GEMM_PREFERED_SIZE 32
  1315. #define USE_SGEMM_KERNEL_DIRECT 1
  1316. #ifdef ARCH_X86
  1317. #define SGEMM_DEFAULT_UNROLL_M 4
  1318. #define DGEMM_DEFAULT_UNROLL_M 2
  1319. #define QGEMM_DEFAULT_UNROLL_M 2
  1320. #define CGEMM_DEFAULT_UNROLL_M 2
  1321. #define ZGEMM_DEFAULT_UNROLL_M 1
  1322. #define XGEMM_DEFAULT_UNROLL_M 1
  1323. #define SGEMM_DEFAULT_UNROLL_N 4
  1324. #define DGEMM_DEFAULT_UNROLL_N 4
  1325. #define QGEMM_DEFAULT_UNROLL_N 2
  1326. #define CGEMM_DEFAULT_UNROLL_N 2
  1327. #define ZGEMM_DEFAULT_UNROLL_N 2
  1328. #define XGEMM_DEFAULT_UNROLL_N 1
  1329. #else
  1330. #define SGEMM_DEFAULT_UNROLL_M 16
  1331. #define DGEMM_DEFAULT_UNROLL_M 4
  1332. #define QGEMM_DEFAULT_UNROLL_M 2
  1333. #define CGEMM_DEFAULT_UNROLL_M 8
  1334. #define ZGEMM_DEFAULT_UNROLL_M 4
  1335. #define XGEMM_DEFAULT_UNROLL_M 1
  1336. #define SGEMM_DEFAULT_UNROLL_N 4
  1337. #define DGEMM_DEFAULT_UNROLL_N 8
  1338. #define QGEMM_DEFAULT_UNROLL_N 2
  1339. #define CGEMM_DEFAULT_UNROLL_N 2
  1340. #define ZGEMM_DEFAULT_UNROLL_N 2
  1341. #define XGEMM_DEFAULT_UNROLL_N 1
  1342. #define SGEMM_DEFAULT_UNROLL_MN 32
  1343. #define DGEMM_DEFAULT_UNROLL_MN 32
  1344. #endif
  1345. #ifdef ARCH_X86
  1346. #define SGEMM_DEFAULT_P 512
  1347. #define SGEMM_DEFAULT_R sgemm_r
  1348. #define DGEMM_DEFAULT_P 512
  1349. #define DGEMM_DEFAULT_R dgemm_r
  1350. #define QGEMM_DEFAULT_P 504
  1351. #define QGEMM_DEFAULT_R qgemm_r
  1352. #define CGEMM_DEFAULT_P 128
  1353. #define CGEMM_DEFAULT_R 1024
  1354. #define ZGEMM_DEFAULT_P 512
  1355. #define ZGEMM_DEFAULT_R zgemm_r
  1356. #define XGEMM_DEFAULT_P 252
  1357. #define XGEMM_DEFAULT_R xgemm_r
  1358. #define SGEMM_DEFAULT_Q 256
  1359. #define DGEMM_DEFAULT_Q 256
  1360. #define QGEMM_DEFAULT_Q 128
  1361. #define CGEMM_DEFAULT_Q 256
  1362. #define ZGEMM_DEFAULT_Q 192
  1363. #define XGEMM_DEFAULT_Q 128
  1364. #else
  1365. #define SGEMM_DEFAULT_P 640
  1366. #define DGEMM_DEFAULT_P 384
  1367. #define CGEMM_DEFAULT_P 384
  1368. #define ZGEMM_DEFAULT_P 256
  1369. #define SGEMM_DEFAULT_Q 320
  1370. #define DGEMM_DEFAULT_Q 168
  1371. #define CGEMM_DEFAULT_Q 192
  1372. #define ZGEMM_DEFAULT_Q 128
  1373. #define SGEMM_DEFAULT_R sgemm_r
  1374. #define DGEMM_DEFAULT_R 13824
  1375. #define CGEMM_DEFAULT_R cgemm_r
  1376. #define ZGEMM_DEFAULT_R zgemm_r
  1377. #define QGEMM_DEFAULT_Q 128
  1378. #define QGEMM_DEFAULT_P 504
  1379. #define QGEMM_DEFAULT_R qgemm_r
  1380. #define XGEMM_DEFAULT_P 252
  1381. #define XGEMM_DEFAULT_R xgemm_r
  1382. #define XGEMM_DEFAULT_Q 128
  1383. #define CGEMM3M_DEFAULT_UNROLL_N 8
  1384. #define CGEMM3M_DEFAULT_UNROLL_M 4
  1385. #define ZGEMM3M_DEFAULT_UNROLL_N 8
  1386. #define ZGEMM3M_DEFAULT_UNROLL_M 2
  1387. #define CGEMM3M_DEFAULT_P 448
  1388. #define ZGEMM3M_DEFAULT_P 224
  1389. #define XGEMM3M_DEFAULT_P 112
  1390. #define CGEMM3M_DEFAULT_Q 224
  1391. #define ZGEMM3M_DEFAULT_Q 224
  1392. #define XGEMM3M_DEFAULT_Q 224
  1393. #define CGEMM3M_DEFAULT_R 12288
  1394. #define ZGEMM3M_DEFAULT_R 12288
  1395. #define XGEMM3M_DEFAULT_R 12288
  1396. #endif
  1397. #endif
  1398. #ifdef ATOM
  1399. #define SNUMOPT 2
  1400. #define DNUMOPT 1
  1401. #define GEMM_DEFAULT_OFFSET_A 64
  1402. #define GEMM_DEFAULT_OFFSET_B 0
  1403. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1404. #define SYMV_P 8
  1405. #ifdef ARCH_X86
  1406. #define SGEMM_DEFAULT_UNROLL_M 4
  1407. #define DGEMM_DEFAULT_UNROLL_M 2
  1408. #define QGEMM_DEFAULT_UNROLL_M 2
  1409. #define CGEMM_DEFAULT_UNROLL_M 2
  1410. #define ZGEMM_DEFAULT_UNROLL_M 1
  1411. #define XGEMM_DEFAULT_UNROLL_M 1
  1412. #else
  1413. #define SGEMM_DEFAULT_UNROLL_M 8
  1414. #define DGEMM_DEFAULT_UNROLL_M 4
  1415. #define QGEMM_DEFAULT_UNROLL_M 2
  1416. #define CGEMM_DEFAULT_UNROLL_M 4
  1417. #define ZGEMM_DEFAULT_UNROLL_M 2
  1418. #define XGEMM_DEFAULT_UNROLL_M 1
  1419. #endif
  1420. #define SGEMM_DEFAULT_UNROLL_N 4
  1421. #define DGEMM_DEFAULT_UNROLL_N 2
  1422. #define QGEMM_DEFAULT_UNROLL_N 2
  1423. #define CGEMM_DEFAULT_UNROLL_N 2
  1424. #define ZGEMM_DEFAULT_UNROLL_N 1
  1425. #define XGEMM_DEFAULT_UNROLL_N 1
  1426. #define SGEMM_DEFAULT_P sgemm_p
  1427. #define SGEMM_DEFAULT_R sgemm_r
  1428. #define DGEMM_DEFAULT_P dgemm_p
  1429. #define DGEMM_DEFAULT_R dgemm_r
  1430. #define QGEMM_DEFAULT_P qgemm_p
  1431. #define QGEMM_DEFAULT_R qgemm_r
  1432. #define CGEMM_DEFAULT_P cgemm_p
  1433. #define CGEMM_DEFAULT_R cgemm_r
  1434. #define ZGEMM_DEFAULT_P zgemm_p
  1435. #define ZGEMM_DEFAULT_R zgemm_r
  1436. #define XGEMM_DEFAULT_P xgemm_p
  1437. #define XGEMM_DEFAULT_R xgemm_r
  1438. #define SGEMM_DEFAULT_Q 256
  1439. #define DGEMM_DEFAULT_Q 256
  1440. #define QGEMM_DEFAULT_Q 256
  1441. #define CGEMM_DEFAULT_Q 256
  1442. #define ZGEMM_DEFAULT_Q 256
  1443. #define XGEMM_DEFAULT_Q 256
  1444. #endif
  1445. #ifdef ITANIUM2
  1446. #define SNUMOPT 4
  1447. #define DNUMOPT 4
  1448. #define GEMM_DEFAULT_OFFSET_A 0
  1449. #define GEMM_DEFAULT_OFFSET_B 128
  1450. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1451. #define SGEMM_DEFAULT_UNROLL_M 8
  1452. #define SGEMM_DEFAULT_UNROLL_N 8
  1453. #define DGEMM_DEFAULT_UNROLL_M 8
  1454. #define DGEMM_DEFAULT_UNROLL_N 8
  1455. #define QGEMM_DEFAULT_UNROLL_M 8
  1456. #define QGEMM_DEFAULT_UNROLL_N 8
  1457. #define CGEMM_DEFAULT_UNROLL_M 4
  1458. #define CGEMM_DEFAULT_UNROLL_N 4
  1459. #define ZGEMM_DEFAULT_UNROLL_M 4
  1460. #define ZGEMM_DEFAULT_UNROLL_N 4
  1461. #define XGEMM_DEFAULT_UNROLL_M 4
  1462. #define XGEMM_DEFAULT_UNROLL_N 4
  1463. #define SGEMM_DEFAULT_P sgemm_p
  1464. #define DGEMM_DEFAULT_P dgemm_p
  1465. #define QGEMM_DEFAULT_P qgemm_p
  1466. #define CGEMM_DEFAULT_P cgemm_p
  1467. #define ZGEMM_DEFAULT_P zgemm_p
  1468. #define XGEMM_DEFAULT_P xgemm_p
  1469. #define SGEMM_DEFAULT_Q 1024
  1470. #define DGEMM_DEFAULT_Q 1024
  1471. #define QGEMM_DEFAULT_Q 1024
  1472. #define CGEMM_DEFAULT_Q 1024
  1473. #define ZGEMM_DEFAULT_Q 1024
  1474. #define XGEMM_DEFAULT_Q 1024
  1475. #define SGEMM_DEFAULT_R sgemm_r
  1476. #define DGEMM_DEFAULT_R dgemm_r
  1477. #define QGEMM_DEFAULT_R qgemm_r
  1478. #define CGEMM_DEFAULT_R cgemm_r
  1479. #define ZGEMM_DEFAULT_R zgemm_r
  1480. #define XGEMM_DEFAULT_R xgemm_r
  1481. #define SYMV_P 16
  1482. #define GETRF_FACTOR 0.65
  1483. #endif
  1484. #if defined(EV4) || defined(EV5) || defined(EV6)
  1485. #ifdef EV4
  1486. #define SNUMOPT 1
  1487. #define DNUMOPT 1
  1488. #else
  1489. #define SNUMOPT 2
  1490. #define DNUMOPT 2
  1491. #endif
  1492. #define GEMM_DEFAULT_OFFSET_A 512
  1493. #define GEMM_DEFAULT_OFFSET_B 512
  1494. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1495. #define SGEMM_DEFAULT_UNROLL_M 4
  1496. #define SGEMM_DEFAULT_UNROLL_N 4
  1497. #define DGEMM_DEFAULT_UNROLL_M 4
  1498. #define DGEMM_DEFAULT_UNROLL_N 4
  1499. #define CGEMM_DEFAULT_UNROLL_M 2
  1500. #define CGEMM_DEFAULT_UNROLL_N 2
  1501. #define ZGEMM_DEFAULT_UNROLL_M 2
  1502. #define ZGEMM_DEFAULT_UNROLL_N 2
  1503. #define SYMV_P 8
  1504. #ifdef EV4
  1505. #define SGEMM_DEFAULT_P 32
  1506. #define SGEMM_DEFAULT_Q 112
  1507. #define SGEMM_DEFAULT_R 256
  1508. #define DGEMM_DEFAULT_P 32
  1509. #define DGEMM_DEFAULT_Q 56
  1510. #define DGEMM_DEFAULT_R 256
  1511. #define CGEMM_DEFAULT_P 32
  1512. #define CGEMM_DEFAULT_Q 64
  1513. #define CGEMM_DEFAULT_R 240
  1514. #define ZGEMM_DEFAULT_P 32
  1515. #define ZGEMM_DEFAULT_Q 32
  1516. #define ZGEMM_DEFAULT_R 240
  1517. #endif
  1518. #ifdef EV5
  1519. #define SGEMM_DEFAULT_P 64
  1520. #define SGEMM_DEFAULT_Q 256
  1521. #define DGEMM_DEFAULT_P 64
  1522. #define DGEMM_DEFAULT_Q 128
  1523. #define CGEMM_DEFAULT_P 64
  1524. #define CGEMM_DEFAULT_Q 128
  1525. #define ZGEMM_DEFAULT_P 64
  1526. #define ZGEMM_DEFAULT_Q 64
  1527. #endif
  1528. #ifdef EV6
  1529. #define SGEMM_DEFAULT_P 256
  1530. #define SGEMM_DEFAULT_Q 512
  1531. #define DGEMM_DEFAULT_P 256
  1532. #define DGEMM_DEFAULT_Q 256
  1533. #define CGEMM_DEFAULT_P 256
  1534. #define CGEMM_DEFAULT_Q 256
  1535. #define ZGEMM_DEFAULT_P 128
  1536. #define ZGEMM_DEFAULT_Q 256
  1537. #endif
  1538. #endif
  1539. #ifdef CELL
  1540. #define SNUMOPT 2
  1541. #define DNUMOPT 2
  1542. #define GEMM_DEFAULT_OFFSET_A 0
  1543. #define GEMM_DEFAULT_OFFSET_B 8192
  1544. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1545. #define SGEMM_DEFAULT_UNROLL_M 16
  1546. #define SGEMM_DEFAULT_UNROLL_N 4
  1547. #define DGEMM_DEFAULT_UNROLL_M 4
  1548. #define DGEMM_DEFAULT_UNROLL_N 4
  1549. #define CGEMM_DEFAULT_UNROLL_M 8
  1550. #define CGEMM_DEFAULT_UNROLL_N 2
  1551. #define ZGEMM_DEFAULT_UNROLL_M 2
  1552. #define ZGEMM_DEFAULT_UNROLL_N 2
  1553. #define SGEMM_DEFAULT_P 128
  1554. #define DGEMM_DEFAULT_P 128
  1555. #define CGEMM_DEFAULT_P 128
  1556. #define ZGEMM_DEFAULT_P 128
  1557. #define SGEMM_DEFAULT_Q 512
  1558. #define DGEMM_DEFAULT_Q 256
  1559. #define CGEMM_DEFAULT_Q 256
  1560. #define ZGEMM_DEFAULT_Q 128
  1561. #define SYMV_P 4
  1562. #endif
  1563. #ifdef PPCG4
  1564. #define GEMM_DEFAULT_OFFSET_A 0
  1565. #define GEMM_DEFAULT_OFFSET_B 1024
  1566. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1567. #define SGEMM_DEFAULT_UNROLL_M 16
  1568. #define SGEMM_DEFAULT_UNROLL_N 4
  1569. #define DGEMM_DEFAULT_UNROLL_M 4
  1570. #define DGEMM_DEFAULT_UNROLL_N 4
  1571. #define CGEMM_DEFAULT_UNROLL_M 8
  1572. #define CGEMM_DEFAULT_UNROLL_N 2
  1573. #define ZGEMM_DEFAULT_UNROLL_M 2
  1574. #define ZGEMM_DEFAULT_UNROLL_N 2
  1575. #define SGEMM_DEFAULT_P 256
  1576. #define DGEMM_DEFAULT_P 128
  1577. #define CGEMM_DEFAULT_P 128
  1578. #define ZGEMM_DEFAULT_P 64
  1579. #define SGEMM_DEFAULT_Q 256
  1580. #define DGEMM_DEFAULT_Q 256
  1581. #define CGEMM_DEFAULT_Q 256
  1582. #define ZGEMM_DEFAULT_Q 256
  1583. #define SYMV_P 4
  1584. #endif
  1585. #ifdef PPC970
  1586. #define SNUMOPT 4
  1587. #define DNUMOPT 4
  1588. #define GEMM_DEFAULT_OFFSET_A 2688
  1589. #define GEMM_DEFAULT_OFFSET_B 3072
  1590. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1591. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1592. #define SGEMM_DEFAULT_UNROLL_M 4
  1593. #else
  1594. #define SGEMM_DEFAULT_UNROLL_M 16
  1595. #endif
  1596. #define SGEMM_DEFAULT_UNROLL_N 4
  1597. #define DGEMM_DEFAULT_UNROLL_M 4
  1598. #define DGEMM_DEFAULT_UNROLL_N 4
  1599. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1600. #define CGEMM_DEFAULT_UNROLL_M 2
  1601. #else
  1602. #define CGEMM_DEFAULT_UNROLL_M 8
  1603. #endif
  1604. #define CGEMM_DEFAULT_UNROLL_N 2
  1605. #define ZGEMM_DEFAULT_UNROLL_M 2
  1606. #define ZGEMM_DEFAULT_UNROLL_N 2
  1607. #if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD)
  1608. #if L2_SIZE == 1024976
  1609. #define SGEMM_DEFAULT_P 320
  1610. #define DGEMM_DEFAULT_P 256
  1611. #define CGEMM_DEFAULT_P 256
  1612. #define ZGEMM_DEFAULT_P 256
  1613. #else
  1614. #define SGEMM_DEFAULT_P 176
  1615. #define DGEMM_DEFAULT_P 176
  1616. #define CGEMM_DEFAULT_P 176
  1617. #define ZGEMM_DEFAULT_P 176
  1618. #endif
  1619. #endif
  1620. #define SGEMM_DEFAULT_Q 512
  1621. #define DGEMM_DEFAULT_Q 256
  1622. #define CGEMM_DEFAULT_Q 256
  1623. #define ZGEMM_DEFAULT_Q 128
  1624. #define SYMV_P 4
  1625. #endif
  1626. #ifdef PPC440
  1627. #define SNUMOPT 2
  1628. #define DNUMOPT 2
  1629. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1630. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1631. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1632. #define SGEMM_DEFAULT_UNROLL_M 4
  1633. #define SGEMM_DEFAULT_UNROLL_N 4
  1634. #define DGEMM_DEFAULT_UNROLL_M 4
  1635. #define DGEMM_DEFAULT_UNROLL_N 4
  1636. #define CGEMM_DEFAULT_UNROLL_M 2
  1637. #define CGEMM_DEFAULT_UNROLL_N 2
  1638. #define ZGEMM_DEFAULT_UNROLL_M 2
  1639. #define ZGEMM_DEFAULT_UNROLL_N 2
  1640. #define SGEMM_DEFAULT_P 512
  1641. #define DGEMM_DEFAULT_P 512
  1642. #define CGEMM_DEFAULT_P 512
  1643. #define ZGEMM_DEFAULT_P 512
  1644. #define SGEMM_DEFAULT_Q 1024
  1645. #define DGEMM_DEFAULT_Q 512
  1646. #define CGEMM_DEFAULT_Q 512
  1647. #define ZGEMM_DEFAULT_Q 256
  1648. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  1649. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  1650. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  1651. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  1652. #define SYMV_P 4
  1653. #endif
  1654. #ifdef PPC440FP2
  1655. #define SNUMOPT 4
  1656. #define DNUMOPT 4
  1657. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1658. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1659. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1660. #define SGEMM_DEFAULT_UNROLL_M 8
  1661. #define SGEMM_DEFAULT_UNROLL_N 4
  1662. #define DGEMM_DEFAULT_UNROLL_M 8
  1663. #define DGEMM_DEFAULT_UNROLL_N 4
  1664. #define CGEMM_DEFAULT_UNROLL_M 4
  1665. #define CGEMM_DEFAULT_UNROLL_N 2
  1666. #define ZGEMM_DEFAULT_UNROLL_M 4
  1667. #define ZGEMM_DEFAULT_UNROLL_N 2
  1668. #define SGEMM_DEFAULT_P 128
  1669. #define DGEMM_DEFAULT_P 128
  1670. #define CGEMM_DEFAULT_P 128
  1671. #define ZGEMM_DEFAULT_P 128
  1672. #if 1
  1673. #define SGEMM_DEFAULT_Q 4096
  1674. #define DGEMM_DEFAULT_Q 3072
  1675. #define CGEMM_DEFAULT_Q 2048
  1676. #define ZGEMM_DEFAULT_Q 1024
  1677. #else
  1678. #define SGEMM_DEFAULT_Q 512
  1679. #define DGEMM_DEFAULT_Q 256
  1680. #define CGEMM_DEFAULT_Q 256
  1681. #define ZGEMM_DEFAULT_Q 128
  1682. #endif
  1683. #define SYMV_P 4
  1684. #endif
  1685. #if defined(POWER3) || defined(POWER4) || defined(POWER5)
  1686. #define GEMM_DEFAULT_OFFSET_A 0
  1687. #define GEMM_DEFAULT_OFFSET_B 2048
  1688. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1689. #define SGEMM_DEFAULT_UNROLL_M 4
  1690. #define SGEMM_DEFAULT_UNROLL_N 4
  1691. #define DGEMM_DEFAULT_UNROLL_M 4
  1692. #define DGEMM_DEFAULT_UNROLL_N 4
  1693. #define CGEMM_DEFAULT_UNROLL_M 2
  1694. #define CGEMM_DEFAULT_UNROLL_N 2
  1695. #define ZGEMM_DEFAULT_UNROLL_M 2
  1696. #define ZGEMM_DEFAULT_UNROLL_N 2
  1697. #ifdef POWER3
  1698. #define SNUMOPT 4
  1699. #define DNUMOPT 4
  1700. #define SGEMM_DEFAULT_P 256
  1701. #define SGEMM_DEFAULT_Q 432
  1702. #define SGEMM_DEFAULT_R 1012
  1703. #define DGEMM_DEFAULT_P 256
  1704. #define DGEMM_DEFAULT_Q 216
  1705. #define DGEMM_DEFAULT_R 1012
  1706. #define ZGEMM_DEFAULT_P 256
  1707. #define ZGEMM_DEFAULT_Q 104
  1708. #define ZGEMM_DEFAULT_R 1012
  1709. #endif
  1710. #if defined(POWER4)
  1711. #ifdef ALLOC_HUGETLB
  1712. #define SGEMM_DEFAULT_P 184
  1713. #define DGEMM_DEFAULT_P 184
  1714. #define CGEMM_DEFAULT_P 184
  1715. #define ZGEMM_DEFAULT_P 184
  1716. #else
  1717. #define SGEMM_DEFAULT_P 144
  1718. #define DGEMM_DEFAULT_P 144
  1719. #define CGEMM_DEFAULT_P 144
  1720. #define ZGEMM_DEFAULT_P 144
  1721. #endif
  1722. #endif
  1723. #if defined(POWER5)
  1724. #ifdef ALLOC_HUGETLB
  1725. #define SGEMM_DEFAULT_P 512
  1726. #define DGEMM_DEFAULT_P 256
  1727. #define CGEMM_DEFAULT_P 256
  1728. #define ZGEMM_DEFAULT_P 128
  1729. #else
  1730. #define SGEMM_DEFAULT_P 320
  1731. #define DGEMM_DEFAULT_P 160
  1732. #define CGEMM_DEFAULT_P 160
  1733. #define ZGEMM_DEFAULT_P 80
  1734. #endif
  1735. #define SGEMM_DEFAULT_Q 256
  1736. #define CGEMM_DEFAULT_Q 256
  1737. #define DGEMM_DEFAULT_Q 256
  1738. #define ZGEMM_DEFAULT_Q 256
  1739. #endif
  1740. #define SYMV_P 8
  1741. #endif
  1742. #if defined(POWER6)
  1743. #define SNUMOPT 4
  1744. #define DNUMOPT 4
  1745. #define GEMM_DEFAULT_OFFSET_A 384
  1746. #define GEMM_DEFAULT_OFFSET_B 1024
  1747. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1748. #define SGEMM_DEFAULT_UNROLL_M 4
  1749. #define SGEMM_DEFAULT_UNROLL_N 4
  1750. #define DGEMM_DEFAULT_UNROLL_M 4
  1751. #define DGEMM_DEFAULT_UNROLL_N 4
  1752. #define CGEMM_DEFAULT_UNROLL_M 2
  1753. #define CGEMM_DEFAULT_UNROLL_N 4
  1754. #define ZGEMM_DEFAULT_UNROLL_M 2
  1755. #define ZGEMM_DEFAULT_UNROLL_N 4
  1756. #define SGEMM_DEFAULT_P 992
  1757. #define DGEMM_DEFAULT_P 480
  1758. #define CGEMM_DEFAULT_P 488
  1759. #define ZGEMM_DEFAULT_P 248
  1760. #define SGEMM_DEFAULT_Q 504
  1761. #define DGEMM_DEFAULT_Q 504
  1762. #define CGEMM_DEFAULT_Q 400
  1763. #define ZGEMM_DEFAULT_Q 400
  1764. #define SYMV_P 8
  1765. #endif
  1766. #if defined(POWER8)
  1767. #define SNUMOPT 16
  1768. #define DNUMOPT 8
  1769. #define GEMM_DEFAULT_OFFSET_A 0
  1770. #define GEMM_DEFAULT_OFFSET_B 65536
  1771. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1772. #define SGEMM_DEFAULT_UNROLL_M 16
  1773. #define SGEMM_DEFAULT_UNROLL_N 8
  1774. #define DGEMM_DEFAULT_UNROLL_M 16
  1775. #define DGEMM_DEFAULT_UNROLL_N 4
  1776. #define CGEMM_DEFAULT_UNROLL_M 8
  1777. #define CGEMM_DEFAULT_UNROLL_N 4
  1778. #define ZGEMM_DEFAULT_UNROLL_M 8
  1779. #define ZGEMM_DEFAULT_UNROLL_N 2
  1780. #define SGEMM_DEFAULT_P 1280
  1781. #define DGEMM_DEFAULT_P 640
  1782. #define CGEMM_DEFAULT_P 640
  1783. #define ZGEMM_DEFAULT_P 320
  1784. #define SGEMM_DEFAULT_Q 640
  1785. #define DGEMM_DEFAULT_Q 720
  1786. #define CGEMM_DEFAULT_Q 640
  1787. #define ZGEMM_DEFAULT_Q 640
  1788. #define SYMV_P 8
  1789. #endif
  1790. #if defined(POWER9)
  1791. #define SNUMOPT 16
  1792. #define DNUMOPT 8
  1793. #define GEMM_DEFAULT_OFFSET_A 0
  1794. #define GEMM_DEFAULT_OFFSET_B 65536
  1795. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1796. #define SGEMM_DEFAULT_UNROLL_M 16
  1797. #define SGEMM_DEFAULT_UNROLL_N 8
  1798. #define DGEMM_DEFAULT_UNROLL_M 16
  1799. #define DGEMM_DEFAULT_UNROLL_N 4
  1800. #define CGEMM_DEFAULT_UNROLL_M 8
  1801. #define CGEMM_DEFAULT_UNROLL_N 4
  1802. #define ZGEMM_DEFAULT_UNROLL_M 8
  1803. #define ZGEMM_DEFAULT_UNROLL_N 2
  1804. #define SGEMM_DEFAULT_P 832
  1805. #define DGEMM_DEFAULT_P 128
  1806. #define CGEMM_DEFAULT_P 512
  1807. #define ZGEMM_DEFAULT_P 256
  1808. #define SGEMM_DEFAULT_Q 1026
  1809. #define DGEMM_DEFAULT_Q 384
  1810. #define CGEMM_DEFAULT_Q 1026
  1811. #define ZGEMM_DEFAULT_Q 1026
  1812. #define SYMV_P 8
  1813. #endif
  1814. #if defined(SPARC) && defined(V7)
  1815. #define SNUMOPT 4
  1816. #define DNUMOPT 4
  1817. #define GEMM_DEFAULT_OFFSET_A 0
  1818. #define GEMM_DEFAULT_OFFSET_B 2048
  1819. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1820. #define SGEMM_DEFAULT_UNROLL_M 2
  1821. #define SGEMM_DEFAULT_UNROLL_N 8
  1822. #define DGEMM_DEFAULT_UNROLL_M 2
  1823. #define DGEMM_DEFAULT_UNROLL_N 8
  1824. #define CGEMM_DEFAULT_UNROLL_M 1
  1825. #define CGEMM_DEFAULT_UNROLL_N 4
  1826. #define ZGEMM_DEFAULT_UNROLL_M 1
  1827. #define ZGEMM_DEFAULT_UNROLL_N 4
  1828. #define SGEMM_DEFAULT_P 256
  1829. #define DGEMM_DEFAULT_P 256
  1830. #define CGEMM_DEFAULT_P 256
  1831. #define ZGEMM_DEFAULT_P 256
  1832. #define SGEMM_DEFAULT_Q 512
  1833. #define DGEMM_DEFAULT_Q 256
  1834. #define CGEMM_DEFAULT_Q 256
  1835. #define ZGEMM_DEFAULT_Q 128
  1836. #define SYMV_P 8
  1837. #define GEMM_THREAD gemm_thread_mn
  1838. #endif
  1839. #if (defined(SPARC) && defined(V9)) || defined(__sparc_v9__)
  1840. #define SNUMOPT 2
  1841. #define DNUMOPT 2
  1842. #define GEMM_DEFAULT_OFFSET_A 0
  1843. #define GEMM_DEFAULT_OFFSET_B 2048
  1844. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1845. #define SGEMM_DEFAULT_UNROLL_M 4
  1846. #define SGEMM_DEFAULT_UNROLL_N 4
  1847. #define DGEMM_DEFAULT_UNROLL_M 4
  1848. #define DGEMM_DEFAULT_UNROLL_N 4
  1849. #define CGEMM_DEFAULT_UNROLL_M 2
  1850. #define CGEMM_DEFAULT_UNROLL_N 2
  1851. #define ZGEMM_DEFAULT_UNROLL_M 2
  1852. #define ZGEMM_DEFAULT_UNROLL_N 2
  1853. #define SGEMM_DEFAULT_P 512
  1854. #define DGEMM_DEFAULT_P 512
  1855. #define CGEMM_DEFAULT_P 512
  1856. #define ZGEMM_DEFAULT_P 512
  1857. #define SGEMM_DEFAULT_Q 1024
  1858. #define DGEMM_DEFAULT_Q 512
  1859. #define CGEMM_DEFAULT_Q 512
  1860. #define ZGEMM_DEFAULT_Q 256
  1861. #define SYMV_P 8
  1862. #endif
  1863. #ifdef SICORTEX
  1864. #define SNUMOPT 2
  1865. #define DNUMOPT 2
  1866. #define GEMM_DEFAULT_OFFSET_A 0
  1867. #define GEMM_DEFAULT_OFFSET_B 0
  1868. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1869. #define SGEMM_DEFAULT_UNROLL_M 2
  1870. #define SGEMM_DEFAULT_UNROLL_N 8
  1871. #define DGEMM_DEFAULT_UNROLL_M 2
  1872. #define DGEMM_DEFAULT_UNROLL_N 8
  1873. #define CGEMM_DEFAULT_UNROLL_M 1
  1874. #define CGEMM_DEFAULT_UNROLL_N 4
  1875. #define ZGEMM_DEFAULT_UNROLL_M 1
  1876. #define ZGEMM_DEFAULT_UNROLL_N 4
  1877. #define SGEMM_DEFAULT_P 108
  1878. #define DGEMM_DEFAULT_P 112
  1879. #define CGEMM_DEFAULT_P 108
  1880. #define ZGEMM_DEFAULT_P 112
  1881. #define SGEMM_DEFAULT_Q 288
  1882. #define DGEMM_DEFAULT_Q 144
  1883. #define CGEMM_DEFAULT_Q 144
  1884. #define ZGEMM_DEFAULT_Q 72
  1885. #define SGEMM_DEFAULT_R 2000
  1886. #define DGEMM_DEFAULT_R 2000
  1887. #define CGEMM_DEFAULT_R 2000
  1888. #define ZGEMM_DEFAULT_R 2000
  1889. #define SYMV_P 16
  1890. #endif
  1891. #ifdef LOONGSON3A
  1892. ////Copy from SICORTEX
  1893. #define SNUMOPT 2
  1894. #define DNUMOPT 2
  1895. #define GEMM_DEFAULT_OFFSET_A 0
  1896. #define GEMM_DEFAULT_OFFSET_B 0
  1897. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1898. #define SGEMM_DEFAULT_UNROLL_M 8
  1899. #define SGEMM_DEFAULT_UNROLL_N 4
  1900. #define DGEMM_DEFAULT_UNROLL_M 4
  1901. #define DGEMM_DEFAULT_UNROLL_N 4
  1902. #define CGEMM_DEFAULT_UNROLL_M 4
  1903. #define CGEMM_DEFAULT_UNROLL_N 2
  1904. #define ZGEMM_DEFAULT_UNROLL_M 2
  1905. #define ZGEMM_DEFAULT_UNROLL_N 2
  1906. #define SGEMM_DEFAULT_P 64
  1907. #define DGEMM_DEFAULT_P 44
  1908. #define CGEMM_DEFAULT_P 64
  1909. #define ZGEMM_DEFAULT_P 32
  1910. #define SGEMM_DEFAULT_Q 192
  1911. #define DGEMM_DEFAULT_Q 92
  1912. #define CGEMM_DEFAULT_Q 128
  1913. #define ZGEMM_DEFAULT_Q 80
  1914. #define SGEMM_DEFAULT_R 640
  1915. #define DGEMM_DEFAULT_R dgemm_r
  1916. #define CGEMM_DEFAULT_R 640
  1917. #define ZGEMM_DEFAULT_R 640
  1918. #define GEMM_OFFSET_A1 0x10000
  1919. #define GEMM_OFFSET_B1 0x100000
  1920. #define SYMV_P 16
  1921. #endif
  1922. #ifdef LOONGSON3B
  1923. #define SNUMOPT 2
  1924. #define DNUMOPT 2
  1925. #define GEMM_DEFAULT_OFFSET_A 0
  1926. #define GEMM_DEFAULT_OFFSET_B 0
  1927. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1928. #define SGEMM_DEFAULT_UNROLL_M 2
  1929. #define SGEMM_DEFAULT_UNROLL_N 2
  1930. #define DGEMM_DEFAULT_UNROLL_M 2
  1931. #define DGEMM_DEFAULT_UNROLL_N 2
  1932. #define CGEMM_DEFAULT_UNROLL_M 2
  1933. #define CGEMM_DEFAULT_UNROLL_N 2
  1934. #define ZGEMM_DEFAULT_UNROLL_M 2
  1935. #define ZGEMM_DEFAULT_UNROLL_N 2
  1936. #define SGEMM_DEFAULT_P 64
  1937. #define DGEMM_DEFAULT_P 24
  1938. #define CGEMM_DEFAULT_P 24
  1939. #define ZGEMM_DEFAULT_P 20
  1940. #define SGEMM_DEFAULT_Q 192
  1941. #define DGEMM_DEFAULT_Q 128
  1942. #define CGEMM_DEFAULT_Q 128
  1943. #define ZGEMM_DEFAULT_Q 64
  1944. #define SGEMM_DEFAULT_R 512
  1945. #define DGEMM_DEFAULT_R 512
  1946. #define CGEMM_DEFAULT_R 512
  1947. #define ZGEMM_DEFAULT_R 512
  1948. #define GEMM_OFFSET_A1 0x10000
  1949. #define GEMM_OFFSET_B1 0x100000
  1950. #define SYMV_P 16
  1951. #endif
  1952. #if defined(P5600) || defined(MIPS1004K) || defined(I6400) || defined(P6600) || defined(I6500)
  1953. #define SNUMOPT 2
  1954. #define DNUMOPT 2
  1955. #define GEMM_DEFAULT_OFFSET_A 0
  1956. #define GEMM_DEFAULT_OFFSET_B 0
  1957. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1958. #ifdef HAVE_MSA
  1959. #define SGEMM_DEFAULT_UNROLL_M 8
  1960. #define SGEMM_DEFAULT_UNROLL_N 8
  1961. #define DGEMM_DEFAULT_UNROLL_M 8
  1962. #define DGEMM_DEFAULT_UNROLL_N 4
  1963. #define CGEMM_DEFAULT_UNROLL_M 8
  1964. #define CGEMM_DEFAULT_UNROLL_N 4
  1965. #define ZGEMM_DEFAULT_UNROLL_M 4
  1966. #define ZGEMM_DEFAULT_UNROLL_N 4
  1967. #else
  1968. #define SGEMM_DEFAULT_UNROLL_M 2
  1969. #define SGEMM_DEFAULT_UNROLL_N 2
  1970. #define DGEMM_DEFAULT_UNROLL_M 2
  1971. #define DGEMM_DEFAULT_UNROLL_N 2
  1972. #define CGEMM_DEFAULT_UNROLL_M 2
  1973. #define CGEMM_DEFAULT_UNROLL_N 2
  1974. #define ZGEMM_DEFAULT_UNROLL_M 2
  1975. #define ZGEMM_DEFAULT_UNROLL_N 2
  1976. #endif
  1977. #define SGEMM_DEFAULT_P 128
  1978. #define DGEMM_DEFAULT_P 128
  1979. #define CGEMM_DEFAULT_P 96
  1980. #define ZGEMM_DEFAULT_P 64
  1981. #define SGEMM_DEFAULT_Q 240
  1982. #define DGEMM_DEFAULT_Q 120
  1983. #define CGEMM_DEFAULT_Q 120
  1984. #define ZGEMM_DEFAULT_Q 120
  1985. #define SGEMM_DEFAULT_R 12288
  1986. #define DGEMM_DEFAULT_R 8192
  1987. #define CGEMM_DEFAULT_R 4096
  1988. #define ZGEMM_DEFAULT_R 4096
  1989. #define SYMV_P 16
  1990. #endif
  1991. #ifdef ARMV7
  1992. #define SNUMOPT 2
  1993. #define DNUMOPT 2
  1994. #define GEMM_DEFAULT_OFFSET_A 0
  1995. #define GEMM_DEFAULT_OFFSET_B 0
  1996. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1997. #define SGEMM_DEFAULT_UNROLL_M 4
  1998. #define SGEMM_DEFAULT_UNROLL_N 4
  1999. #define DGEMM_DEFAULT_UNROLL_M 4
  2000. #define DGEMM_DEFAULT_UNROLL_N 4
  2001. #define CGEMM_DEFAULT_UNROLL_M 2
  2002. #define CGEMM_DEFAULT_UNROLL_N 2
  2003. #define ZGEMM_DEFAULT_UNROLL_M 2
  2004. #define ZGEMM_DEFAULT_UNROLL_N 2
  2005. #define SGEMM_DEFAULT_P 128
  2006. #define DGEMM_DEFAULT_P 128
  2007. #define CGEMM_DEFAULT_P 96
  2008. #define ZGEMM_DEFAULT_P 64
  2009. #define SGEMM_DEFAULT_Q 240
  2010. #define DGEMM_DEFAULT_Q 120
  2011. #define CGEMM_DEFAULT_Q 120
  2012. #define ZGEMM_DEFAULT_Q 120
  2013. #define SGEMM_DEFAULT_R 12288
  2014. #define DGEMM_DEFAULT_R 8192
  2015. #define CGEMM_DEFAULT_R 4096
  2016. #define ZGEMM_DEFAULT_R 4096
  2017. #define SYMV_P 16
  2018. #endif
  2019. #if defined(ARMV6)
  2020. #define SNUMOPT 2
  2021. #define DNUMOPT 2
  2022. #define GEMM_DEFAULT_OFFSET_A 0
  2023. #define GEMM_DEFAULT_OFFSET_B 0
  2024. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2025. #define SGEMM_DEFAULT_UNROLL_M 4
  2026. #define SGEMM_DEFAULT_UNROLL_N 2
  2027. #define DGEMM_DEFAULT_UNROLL_M 4
  2028. #define DGEMM_DEFAULT_UNROLL_N 2
  2029. #define CGEMM_DEFAULT_UNROLL_M 2
  2030. #define CGEMM_DEFAULT_UNROLL_N 2
  2031. #define ZGEMM_DEFAULT_UNROLL_M 2
  2032. #define ZGEMM_DEFAULT_UNROLL_N 2
  2033. #define SGEMM_DEFAULT_P 128
  2034. #define DGEMM_DEFAULT_P 128
  2035. #define CGEMM_DEFAULT_P 96
  2036. #define ZGEMM_DEFAULT_P 64
  2037. #define SGEMM_DEFAULT_Q 240
  2038. #define DGEMM_DEFAULT_Q 120
  2039. #define CGEMM_DEFAULT_Q 120
  2040. #define ZGEMM_DEFAULT_Q 120
  2041. #define SGEMM_DEFAULT_R 12288
  2042. #define DGEMM_DEFAULT_R 8192
  2043. #define CGEMM_DEFAULT_R 4096
  2044. #define ZGEMM_DEFAULT_R 4096
  2045. #define SYMV_P 16
  2046. #endif
  2047. // Common ARMv8 parameters
  2048. #if defined(ARMV8)
  2049. #define SNUMOPT 2
  2050. #define DNUMOPT 2
  2051. #define GEMM_DEFAULT_OFFSET_A 0
  2052. #define GEMM_DEFAULT_OFFSET_B 0
  2053. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2054. #define SYMV_P 16
  2055. #if defined(CORTEXA53) || defined(CORTEXA57) || \
  2056. defined(CORTEXA72) || defined(CORTEXA73) || \
  2057. defined(FALKOR) || defined(TSV110)
  2058. #define SGEMM_DEFAULT_UNROLL_M 16
  2059. #define SGEMM_DEFAULT_UNROLL_N 4
  2060. #define DGEMM_DEFAULT_UNROLL_M 8
  2061. #define DGEMM_DEFAULT_UNROLL_N 4
  2062. #define CGEMM_DEFAULT_UNROLL_M 8
  2063. #define CGEMM_DEFAULT_UNROLL_N 4
  2064. #define ZGEMM_DEFAULT_UNROLL_M 4
  2065. #define ZGEMM_DEFAULT_UNROLL_N 4
  2066. /*FIXME: this should be using the cache size, but there is currently no easy way to
  2067. query that on ARM. So if getarch counted more than 8 cores we simply assume the host
  2068. is a big desktop or server with abundant cache rather than a phone or embedded device */
  2069. #if NUM_CORES > 8
  2070. #define SGEMM_DEFAULT_P 512
  2071. #define DGEMM_DEFAULT_P 256
  2072. #define CGEMM_DEFAULT_P 256
  2073. #define ZGEMM_DEFAULT_P 128
  2074. #define SGEMM_DEFAULT_Q 1024
  2075. #define DGEMM_DEFAULT_Q 512
  2076. #define CGEMM_DEFAULT_Q 512
  2077. #define ZGEMM_DEFAULT_Q 512
  2078. #else
  2079. #define SGEMM_DEFAULT_P 128
  2080. #define DGEMM_DEFAULT_P 160
  2081. #define CGEMM_DEFAULT_P 128
  2082. #define ZGEMM_DEFAULT_P 128
  2083. #define SGEMM_DEFAULT_Q 352
  2084. #define DGEMM_DEFAULT_Q 128
  2085. #define CGEMM_DEFAULT_Q 224
  2086. #define ZGEMM_DEFAULT_Q 112
  2087. #endif
  2088. #define SGEMM_DEFAULT_R 4096
  2089. #define DGEMM_DEFAULT_R 4096
  2090. #define CGEMM_DEFAULT_R 4096
  2091. #define ZGEMM_DEFAULT_R 2048
  2092. #elif defined(THUNDERX)
  2093. #define SGEMM_DEFAULT_UNROLL_M 4
  2094. #define SGEMM_DEFAULT_UNROLL_N 4
  2095. #define DGEMM_DEFAULT_UNROLL_M 2
  2096. #define DGEMM_DEFAULT_UNROLL_N 2
  2097. #define CGEMM_DEFAULT_UNROLL_M 2
  2098. #define CGEMM_DEFAULT_UNROLL_N 2
  2099. #define ZGEMM_DEFAULT_UNROLL_M 2
  2100. #define ZGEMM_DEFAULT_UNROLL_N 2
  2101. #define SGEMM_DEFAULT_P 128
  2102. #define DGEMM_DEFAULT_P 128
  2103. #define CGEMM_DEFAULT_P 96
  2104. #define ZGEMM_DEFAULT_P 64
  2105. #define SGEMM_DEFAULT_Q 240
  2106. #define DGEMM_DEFAULT_Q 120
  2107. #define CGEMM_DEFAULT_Q 120
  2108. #define ZGEMM_DEFAULT_Q 120
  2109. #define SGEMM_DEFAULT_R 12288
  2110. #define DGEMM_DEFAULT_R 8192
  2111. #define CGEMM_DEFAULT_R 4096
  2112. #define ZGEMM_DEFAULT_R 4096
  2113. #elif defined(THUNDERX2T99)
  2114. #define SGEMM_DEFAULT_UNROLL_M 16
  2115. #define SGEMM_DEFAULT_UNROLL_N 4
  2116. #define DGEMM_DEFAULT_UNROLL_M 8
  2117. #define DGEMM_DEFAULT_UNROLL_N 4
  2118. #define CGEMM_DEFAULT_UNROLL_M 8
  2119. #define CGEMM_DEFAULT_UNROLL_N 4
  2120. #define ZGEMM_DEFAULT_UNROLL_M 4
  2121. #define ZGEMM_DEFAULT_UNROLL_N 4
  2122. #define SGEMM_DEFAULT_P 128
  2123. #define DGEMM_DEFAULT_P 160
  2124. #define CGEMM_DEFAULT_P 128
  2125. #define ZGEMM_DEFAULT_P 128
  2126. #define SGEMM_DEFAULT_Q 352
  2127. #define DGEMM_DEFAULT_Q 128
  2128. #define CGEMM_DEFAULT_Q 224
  2129. #define ZGEMM_DEFAULT_Q 112
  2130. #define SGEMM_DEFAULT_R 4096
  2131. #define DGEMM_DEFAULT_R 4096
  2132. #define CGEMM_DEFAULT_R 4096
  2133. #define ZGEMM_DEFAULT_R 4096
  2134. #else // Other/undetected ARMv8 cores
  2135. #define SGEMM_DEFAULT_UNROLL_M 16
  2136. #define SGEMM_DEFAULT_UNROLL_N 4
  2137. #define DGEMM_DEFAULT_UNROLL_M 8
  2138. #define DGEMM_DEFAULT_UNROLL_N 4
  2139. #define CGEMM_DEFAULT_UNROLL_M 8
  2140. #define CGEMM_DEFAULT_UNROLL_N 4
  2141. #define ZGEMM_DEFAULT_UNROLL_M 4
  2142. #define ZGEMM_DEFAULT_UNROLL_N 4
  2143. #define SGEMM_DEFAULT_P 128
  2144. #define DGEMM_DEFAULT_P 160
  2145. #define CGEMM_DEFAULT_P 128
  2146. #define ZGEMM_DEFAULT_P 128
  2147. #define SGEMM_DEFAULT_Q 352
  2148. #define DGEMM_DEFAULT_Q 128
  2149. #define CGEMM_DEFAULT_Q 224
  2150. #define ZGEMM_DEFAULT_Q 112
  2151. #define SGEMM_DEFAULT_R 4096
  2152. #define DGEMM_DEFAULT_R 4096
  2153. #define CGEMM_DEFAULT_R 4096
  2154. #define ZGEMM_DEFAULT_R 4096
  2155. #endif // Cores
  2156. #endif // ARMv8
  2157. #if defined(ARMV5)
  2158. #define SNUMOPT 2
  2159. #define DNUMOPT 2
  2160. #define GEMM_DEFAULT_OFFSET_A 0
  2161. #define GEMM_DEFAULT_OFFSET_B 0
  2162. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2163. #define SGEMM_DEFAULT_UNROLL_M 2
  2164. #define SGEMM_DEFAULT_UNROLL_N 2
  2165. #define DGEMM_DEFAULT_UNROLL_M 2
  2166. #define DGEMM_DEFAULT_UNROLL_N 2
  2167. #define CGEMM_DEFAULT_UNROLL_M 2
  2168. #define CGEMM_DEFAULT_UNROLL_N 2
  2169. #define ZGEMM_DEFAULT_UNROLL_M 2
  2170. #define ZGEMM_DEFAULT_UNROLL_N 2
  2171. #define SGEMM_DEFAULT_P 128
  2172. #define DGEMM_DEFAULT_P 128
  2173. #define CGEMM_DEFAULT_P 96
  2174. #define ZGEMM_DEFAULT_P 64
  2175. #define SGEMM_DEFAULT_Q 240
  2176. #define DGEMM_DEFAULT_Q 120
  2177. #define CGEMM_DEFAULT_Q 120
  2178. #define ZGEMM_DEFAULT_Q 120
  2179. #define SGEMM_DEFAULT_R 12288
  2180. #define DGEMM_DEFAULT_R 8192
  2181. #define CGEMM_DEFAULT_R 4096
  2182. #define ZGEMM_DEFAULT_R 4096
  2183. #define SYMV_P 16
  2184. #endif
  2185. #ifdef CORTEXA9
  2186. #define SNUMOPT 2
  2187. #define DNUMOPT 2
  2188. #define GEMM_DEFAULT_OFFSET_A 0
  2189. #define GEMM_DEFAULT_OFFSET_B 0
  2190. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2191. #define SGEMM_DEFAULT_UNROLL_M 4
  2192. #define SGEMM_DEFAULT_UNROLL_N 4
  2193. #define DGEMM_DEFAULT_UNROLL_M 4
  2194. #define DGEMM_DEFAULT_UNROLL_N 4
  2195. #define CGEMM_DEFAULT_UNROLL_M 2
  2196. #define CGEMM_DEFAULT_UNROLL_N 2
  2197. #define ZGEMM_DEFAULT_UNROLL_M 2
  2198. #define ZGEMM_DEFAULT_UNROLL_N 2
  2199. #define SGEMM_DEFAULT_P 128
  2200. #define DGEMM_DEFAULT_P 128
  2201. #define CGEMM_DEFAULT_P 96
  2202. #define ZGEMM_DEFAULT_P 64
  2203. #define SGEMM_DEFAULT_Q 240
  2204. #define DGEMM_DEFAULT_Q 120
  2205. #define CGEMM_DEFAULT_Q 120
  2206. #define ZGEMM_DEFAULT_Q 120
  2207. #define SGEMM_DEFAULT_R 12288
  2208. #define DGEMM_DEFAULT_R 8192
  2209. #define CGEMM_DEFAULT_R 4096
  2210. #define ZGEMM_DEFAULT_R 4096
  2211. #define SYMV_P 16
  2212. #endif
  2213. #ifdef CORTEXA15
  2214. #define SNUMOPT 2
  2215. #define DNUMOPT 2
  2216. #define GEMM_DEFAULT_OFFSET_A 0
  2217. #define GEMM_DEFAULT_OFFSET_B 0
  2218. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2219. #define SGEMM_DEFAULT_UNROLL_M 4
  2220. #define SGEMM_DEFAULT_UNROLL_N 4
  2221. #define DGEMM_DEFAULT_UNROLL_M 4
  2222. #define DGEMM_DEFAULT_UNROLL_N 4
  2223. #define CGEMM_DEFAULT_UNROLL_M 2
  2224. #define CGEMM_DEFAULT_UNROLL_N 2
  2225. #define ZGEMM_DEFAULT_UNROLL_M 2
  2226. #define ZGEMM_DEFAULT_UNROLL_N 2
  2227. #define SGEMM_DEFAULT_P 128
  2228. #define DGEMM_DEFAULT_P 128
  2229. #define CGEMM_DEFAULT_P 96
  2230. #define ZGEMM_DEFAULT_P 64
  2231. #define SGEMM_DEFAULT_Q 240
  2232. #define DGEMM_DEFAULT_Q 120
  2233. #define CGEMM_DEFAULT_Q 120
  2234. #define ZGEMM_DEFAULT_Q 120
  2235. #define SGEMM_DEFAULT_R 12288
  2236. #define DGEMM_DEFAULT_R 8192
  2237. #define CGEMM_DEFAULT_R 4096
  2238. #define ZGEMM_DEFAULT_R 4096
  2239. #define SYMV_P 16
  2240. #endif
  2241. #if defined(ZARCH_GENERIC)
  2242. #define SNUMOPT 2
  2243. #define DNUMOPT 2
  2244. #define GEMM_DEFAULT_OFFSET_A 0
  2245. #define GEMM_DEFAULT_OFFSET_B 0
  2246. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2247. #define SGEMM_DEFAULT_UNROLL_M 2
  2248. #define SGEMM_DEFAULT_UNROLL_N 2
  2249. #define DGEMM_DEFAULT_UNROLL_M 2
  2250. #define DGEMM_DEFAULT_UNROLL_N 2
  2251. #define CGEMM_DEFAULT_UNROLL_M 2
  2252. #define CGEMM_DEFAULT_UNROLL_N 2
  2253. #define ZGEMM_DEFAULT_UNROLL_M 2
  2254. #define ZGEMM_DEFAULT_UNROLL_N 2
  2255. #define SGEMM_DEFAULT_P 128
  2256. #define DGEMM_DEFAULT_P 128
  2257. #define CGEMM_DEFAULT_P 96
  2258. #define ZGEMM_DEFAULT_P 64
  2259. #define SGEMM_DEFAULT_Q 240
  2260. #define DGEMM_DEFAULT_Q 120
  2261. #define CGEMM_DEFAULT_Q 120
  2262. #define ZGEMM_DEFAULT_Q 120
  2263. #define SGEMM_DEFAULT_R 12288
  2264. #define DGEMM_DEFAULT_R 8192
  2265. #define CGEMM_DEFAULT_R 4096
  2266. #define ZGEMM_DEFAULT_R 4096
  2267. #define SYMV_P 16
  2268. #endif
  2269. #if defined(Z13)
  2270. #define SNUMOPT 2
  2271. #define DNUMOPT 2
  2272. #define GEMM_DEFAULT_OFFSET_A 0
  2273. #define GEMM_DEFAULT_OFFSET_B 0
  2274. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2275. #define SGEMM_DEFAULT_UNROLL_M 8
  2276. #define SGEMM_DEFAULT_UNROLL_N 4
  2277. #define DGEMM_DEFAULT_UNROLL_M 8
  2278. #define DGEMM_DEFAULT_UNROLL_N 4
  2279. #define CGEMM_DEFAULT_UNROLL_M 4
  2280. #define CGEMM_DEFAULT_UNROLL_N 4
  2281. #define ZGEMM_DEFAULT_UNROLL_M 4
  2282. #define ZGEMM_DEFAULT_UNROLL_N 4
  2283. #define SGEMM_DEFAULT_P 456
  2284. #define DGEMM_DEFAULT_P 320
  2285. #define CGEMM_DEFAULT_P 480
  2286. #define ZGEMM_DEFAULT_P 224
  2287. #define SGEMM_DEFAULT_Q 488
  2288. #define DGEMM_DEFAULT_Q 384
  2289. #define CGEMM_DEFAULT_Q 128
  2290. #define ZGEMM_DEFAULT_Q 352
  2291. #define SGEMM_DEFAULT_R 8192
  2292. #define DGEMM_DEFAULT_R 4096
  2293. #define CGEMM_DEFAULT_R 4096
  2294. #define ZGEMM_DEFAULT_R 2048
  2295. #define SYMV_P 16
  2296. #endif
  2297. #if defined(Z14)
  2298. #define SNUMOPT 2
  2299. #define DNUMOPT 2
  2300. #define GEMM_DEFAULT_OFFSET_A 0
  2301. #define GEMM_DEFAULT_OFFSET_B 0
  2302. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2303. #define SGEMM_DEFAULT_UNROLL_M 8
  2304. #define SGEMM_DEFAULT_UNROLL_N 4
  2305. #define DGEMM_DEFAULT_UNROLL_M 8
  2306. #define DGEMM_DEFAULT_UNROLL_N 4
  2307. #define CGEMM_DEFAULT_UNROLL_M 4
  2308. #define CGEMM_DEFAULT_UNROLL_N 4
  2309. #define ZGEMM_DEFAULT_UNROLL_M 4
  2310. #define ZGEMM_DEFAULT_UNROLL_N 4
  2311. #define SGEMM_DEFAULT_P 456
  2312. #define DGEMM_DEFAULT_P 320
  2313. #define CGEMM_DEFAULT_P 480
  2314. #define ZGEMM_DEFAULT_P 224
  2315. #define SGEMM_DEFAULT_Q 488
  2316. #define DGEMM_DEFAULT_Q 384
  2317. #define CGEMM_DEFAULT_Q 128
  2318. #define ZGEMM_DEFAULT_Q 352
  2319. #define SGEMM_DEFAULT_R 8192
  2320. #define DGEMM_DEFAULT_R 4096
  2321. #define CGEMM_DEFAULT_R 4096
  2322. #define ZGEMM_DEFAULT_R 2048
  2323. #define SYMV_P 16
  2324. #endif
  2325. #ifdef GENERIC
  2326. #define SNUMOPT 2
  2327. #define DNUMOPT 2
  2328. #define GEMM_DEFAULT_OFFSET_A 0
  2329. #define GEMM_DEFAULT_OFFSET_B 0
  2330. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2331. #define SGEMM_DEFAULT_UNROLL_N 2
  2332. #define DGEMM_DEFAULT_UNROLL_N 2
  2333. #define QGEMM_DEFAULT_UNROLL_N 2
  2334. #define CGEMM_DEFAULT_UNROLL_N 2
  2335. #define ZGEMM_DEFAULT_UNROLL_N 2
  2336. #define XGEMM_DEFAULT_UNROLL_N 1
  2337. #ifdef ARCH_X86
  2338. #define SGEMM_DEFAULT_UNROLL_M 2
  2339. #define DGEMM_DEFAULT_UNROLL_M 2
  2340. #define QGEMM_DEFAULT_UNROLL_M 2
  2341. #define CGEMM_DEFAULT_UNROLL_M 2
  2342. #define ZGEMM_DEFAULT_UNROLL_M 2
  2343. #define XGEMM_DEFAULT_UNROLL_M 1
  2344. #else
  2345. #define SGEMM_DEFAULT_UNROLL_M 2
  2346. #define DGEMM_DEFAULT_UNROLL_M 2
  2347. #define QGEMM_DEFAULT_UNROLL_M 2
  2348. #define CGEMM_DEFAULT_UNROLL_M 2
  2349. #define ZGEMM_DEFAULT_UNROLL_M 2
  2350. #define XGEMM_DEFAULT_UNROLL_M 1
  2351. #endif
  2352. #define SGEMM_DEFAULT_P sgemm_p
  2353. #define DGEMM_DEFAULT_P dgemm_p
  2354. #define QGEMM_DEFAULT_P qgemm_p
  2355. #define CGEMM_DEFAULT_P cgemm_p
  2356. #define ZGEMM_DEFAULT_P zgemm_p
  2357. #define XGEMM_DEFAULT_P xgemm_p
  2358. #define SGEMM_DEFAULT_R sgemm_r
  2359. #define DGEMM_DEFAULT_R dgemm_r
  2360. #define QGEMM_DEFAULT_R qgemm_r
  2361. #define CGEMM_DEFAULT_R cgemm_r
  2362. #define ZGEMM_DEFAULT_R zgemm_r
  2363. #define XGEMM_DEFAULT_R xgemm_r
  2364. #define SGEMM_DEFAULT_Q 128
  2365. #define DGEMM_DEFAULT_Q 128
  2366. #define QGEMM_DEFAULT_Q 128
  2367. #define CGEMM_DEFAULT_Q 128
  2368. #define ZGEMM_DEFAULT_Q 128
  2369. #define XGEMM_DEFAULT_Q 128
  2370. #define SYMV_P 16
  2371. #endif
  2372. #ifndef QGEMM_DEFAULT_UNROLL_M
  2373. #define QGEMM_DEFAULT_UNROLL_M 2
  2374. #endif
  2375. #ifndef QGEMM_DEFAULT_UNROLL_N
  2376. #define QGEMM_DEFAULT_UNROLL_N 2
  2377. #endif
  2378. #ifndef XGEMM_DEFAULT_UNROLL_M
  2379. #define XGEMM_DEFAULT_UNROLL_M 2
  2380. #endif
  2381. #ifndef XGEMM_DEFAULT_UNROLL_N
  2382. #define XGEMM_DEFAULT_UNROLL_N 2
  2383. #endif
  2384. #ifndef HAVE_SSE2
  2385. #define SHUFPD_0 shufps $0x44,
  2386. #define SHUFPD_1 shufps $0x4e,
  2387. #define SHUFPD_2 shufps $0xe4,
  2388. #define SHUFPD_3 shufps $0xee,
  2389. #endif
  2390. #ifndef SHUFPD_0
  2391. #define SHUFPD_0 shufpd $0,
  2392. #endif
  2393. #ifndef SHUFPD_1
  2394. #define SHUFPD_1 shufpd $1,
  2395. #endif
  2396. #ifndef SHUFPD_2
  2397. #define SHUFPD_2 shufpd $2,
  2398. #endif
  2399. #ifndef SHUFPD_3
  2400. #define SHUFPD_3 shufpd $3,
  2401. #endif
  2402. #ifndef SHUFPS_39
  2403. #define SHUFPS_39 shufps $0x39,
  2404. #endif
  2405. #endif