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 74 kB

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