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