You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

param.h 72 kB

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