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

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12 years ago
12 years ago
12 years ago
5 years ago
5 years ago
12 years ago
5 years ago
5 years ago
12 years ago
5 years ago
12 years ago
5 years ago
5 years ago
5 years ago
12 years ago
6 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
12 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
Simplifying ARMv8 build parameters ARMv8 builds were a bit mixed up, with ThunderX2 code in ARMv8 mode (which is not right because TX2 is ARMv8.1) as well as requiring a few redundancies in the defines, making it harder to maintain and understand what core has what. A few other minor issues were also fixed. Tests were made on the following cores: A53, A57, A72, Falkor, ThunderX, ThunderX2, and XGene. Tests were: OpenBLAS/test, OpenBLAS/benchmark, BLAS-Tester. A summary: * Removed TX2 code from ARMv8 build, to make sure it is compatible with all ARMv8 cores, not just v8.1. Also, the TX2 code has actually harmed performance on big cores. * Commoned up ARMv8 architectures' defines in params.h, to make sure that all will benefit from ARMv8 settings, in addition to their own. * Adding a few more cores, using ARMv8's include strategy, to benefit from compiler optimisations using mtune. Also updated cache information from the manuals, making sure we set good conservative values by default. Removed Vulcan, as it's an alias to TX2. * Auto-detecting most of those cores, but also updating the forced compilation in getarch.c, to make sure the parameters are the same whether compiled natively or forced arch. Benefits: * ARMv8 build is now guaranteed to work on all ARMv8 cores * Improved performance for ARMv8 builds on some cores (A72, Falkor, ThunderX1 and 2: up to 11%) over current develop * Improved performance for *all* cores comparing to develop branch before TX2's patch (9% ~ 36%) * ThunderX1 builds are 14% faster than ARMv8 on TX1, 9% faster than current develop's branch and 8% faster than deveop before tx2 patches Issues: * Regression from current develop branch for A53 (-12%) and A57 (-3%) with ARMv8 builds, but still faster than before TX2's commit (+15% and +24% respectively). This can be improved with a simplification of TX2's code, to be done in future patches. At least the code is guaranteed to be ARMv8.0 now. Comments: * CortexA57 builds are unchanged on A57 hardware from develop's branch, which makes sense, as it's untouched. * CortexA72 builds improve over A57 on A72 hardware, even if they're using the same includes due to new compiler tunning in the makefile.
6 years ago
12 years ago
12 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335
  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 COOPERLAKE
  1415. #define SNUMOPT 16
  1416. #define DNUMOPT 8
  1417. #define GEMM_DEFAULT_OFFSET_A 0
  1418. #define GEMM_DEFAULT_OFFSET_B 0
  1419. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1420. #define SYMV_P 8
  1421. #if defined(XDOUBLE) || defined(DOUBLE)
  1422. #define SWITCH_RATIO 8
  1423. #define GEMM_PREFERED_SIZE 8
  1424. #else
  1425. #define SWITCH_RATIO 16
  1426. #define GEMM_PREFERED_SIZE 16
  1427. #endif
  1428. #define USE_SGEMM_KERNEL_DIRECT 1
  1429. #ifdef ARCH_X86
  1430. #define SGEMM_DEFAULT_UNROLL_M 4
  1431. #define DGEMM_DEFAULT_UNROLL_M 2
  1432. #define QGEMM_DEFAULT_UNROLL_M 2
  1433. #define CGEMM_DEFAULT_UNROLL_M 2
  1434. #define ZGEMM_DEFAULT_UNROLL_M 1
  1435. #define XGEMM_DEFAULT_UNROLL_M 1
  1436. #define SGEMM_DEFAULT_UNROLL_N 4
  1437. #define DGEMM_DEFAULT_UNROLL_N 4
  1438. #define QGEMM_DEFAULT_UNROLL_N 2
  1439. #define CGEMM_DEFAULT_UNROLL_N 2
  1440. #define ZGEMM_DEFAULT_UNROLL_N 2
  1441. #define XGEMM_DEFAULT_UNROLL_N 1
  1442. #else
  1443. #define SGEMM_DEFAULT_UNROLL_M 16
  1444. #define DGEMM_DEFAULT_UNROLL_M 16
  1445. #define QGEMM_DEFAULT_UNROLL_M 2
  1446. #define CGEMM_DEFAULT_UNROLL_M 8
  1447. #define ZGEMM_DEFAULT_UNROLL_M 4
  1448. #define XGEMM_DEFAULT_UNROLL_M 1
  1449. #define SGEMM_DEFAULT_UNROLL_N 4
  1450. #define DGEMM_DEFAULT_UNROLL_N 2
  1451. #define QGEMM_DEFAULT_UNROLL_N 2
  1452. #define CGEMM_DEFAULT_UNROLL_N 2
  1453. #define ZGEMM_DEFAULT_UNROLL_N 2
  1454. #define XGEMM_DEFAULT_UNROLL_N 1
  1455. #define SGEMM_DEFAULT_UNROLL_MN 32
  1456. #define DGEMM_DEFAULT_UNROLL_MN 32
  1457. #endif
  1458. #ifdef ARCH_X86
  1459. #define SGEMM_DEFAULT_P 512
  1460. #define SGEMM_DEFAULT_R sgemm_r
  1461. #define DGEMM_DEFAULT_P 512
  1462. #define DGEMM_DEFAULT_R dgemm_r
  1463. #define QGEMM_DEFAULT_P 504
  1464. #define QGEMM_DEFAULT_R qgemm_r
  1465. #define CGEMM_DEFAULT_P 128
  1466. #define CGEMM_DEFAULT_R 1024
  1467. #define ZGEMM_DEFAULT_P 512
  1468. #define ZGEMM_DEFAULT_R zgemm_r
  1469. #define XGEMM_DEFAULT_P 252
  1470. #define XGEMM_DEFAULT_R xgemm_r
  1471. #define SGEMM_DEFAULT_Q 256
  1472. #define DGEMM_DEFAULT_Q 256
  1473. #define QGEMM_DEFAULT_Q 128
  1474. #define CGEMM_DEFAULT_Q 256
  1475. #define ZGEMM_DEFAULT_Q 192
  1476. #define XGEMM_DEFAULT_Q 128
  1477. #else
  1478. #define SGEMM_DEFAULT_P 640
  1479. #define DGEMM_DEFAULT_P 192
  1480. #define CGEMM_DEFAULT_P 384
  1481. #define ZGEMM_DEFAULT_P 256
  1482. #define SGEMM_DEFAULT_Q 320
  1483. #define DGEMM_DEFAULT_Q 384
  1484. #define CGEMM_DEFAULT_Q 192
  1485. #define ZGEMM_DEFAULT_Q 128
  1486. #define SGEMM_DEFAULT_R sgemm_r
  1487. #define DGEMM_DEFAULT_R 8640
  1488. #define CGEMM_DEFAULT_R cgemm_r
  1489. #define ZGEMM_DEFAULT_R zgemm_r
  1490. #define QGEMM_DEFAULT_Q 128
  1491. #define QGEMM_DEFAULT_P 504
  1492. #define QGEMM_DEFAULT_R qgemm_r
  1493. #define XGEMM_DEFAULT_P 252
  1494. #define XGEMM_DEFAULT_R xgemm_r
  1495. #define XGEMM_DEFAULT_Q 128
  1496. #define CGEMM3M_DEFAULT_UNROLL_N 4
  1497. #define CGEMM3M_DEFAULT_UNROLL_M 8
  1498. #define ZGEMM3M_DEFAULT_UNROLL_N 4
  1499. #define ZGEMM3M_DEFAULT_UNROLL_M 4
  1500. #define CGEMM3M_DEFAULT_P 320
  1501. #define ZGEMM3M_DEFAULT_P 256
  1502. #define XGEMM3M_DEFAULT_P 112
  1503. #define CGEMM3M_DEFAULT_Q 320
  1504. #define ZGEMM3M_DEFAULT_Q 256
  1505. #define XGEMM3M_DEFAULT_Q 224
  1506. #define CGEMM3M_DEFAULT_R 12288
  1507. #define ZGEMM3M_DEFAULT_R 12288
  1508. #define XGEMM3M_DEFAULT_R 12288
  1509. #endif
  1510. #endif
  1511. #ifdef ATOM
  1512. #define SNUMOPT 2
  1513. #define DNUMOPT 1
  1514. #define GEMM_DEFAULT_OFFSET_A 64
  1515. #define GEMM_DEFAULT_OFFSET_B 0
  1516. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1517. #define SYMV_P 8
  1518. #ifdef ARCH_X86
  1519. #define SGEMM_DEFAULT_UNROLL_M 4
  1520. #define DGEMM_DEFAULT_UNROLL_M 2
  1521. #define QGEMM_DEFAULT_UNROLL_M 2
  1522. #define CGEMM_DEFAULT_UNROLL_M 2
  1523. #define ZGEMM_DEFAULT_UNROLL_M 1
  1524. #define XGEMM_DEFAULT_UNROLL_M 1
  1525. #else
  1526. #define SGEMM_DEFAULT_UNROLL_M 8
  1527. #define DGEMM_DEFAULT_UNROLL_M 4
  1528. #define QGEMM_DEFAULT_UNROLL_M 2
  1529. #define CGEMM_DEFAULT_UNROLL_M 4
  1530. #define ZGEMM_DEFAULT_UNROLL_M 2
  1531. #define XGEMM_DEFAULT_UNROLL_M 1
  1532. #endif
  1533. #define SGEMM_DEFAULT_UNROLL_N 4
  1534. #define DGEMM_DEFAULT_UNROLL_N 2
  1535. #define QGEMM_DEFAULT_UNROLL_N 2
  1536. #define CGEMM_DEFAULT_UNROLL_N 2
  1537. #define ZGEMM_DEFAULT_UNROLL_N 1
  1538. #define XGEMM_DEFAULT_UNROLL_N 1
  1539. #define SGEMM_DEFAULT_P sgemm_p
  1540. #define SGEMM_DEFAULT_R sgemm_r
  1541. #define DGEMM_DEFAULT_P dgemm_p
  1542. #define DGEMM_DEFAULT_R dgemm_r
  1543. #define QGEMM_DEFAULT_P qgemm_p
  1544. #define QGEMM_DEFAULT_R qgemm_r
  1545. #define CGEMM_DEFAULT_P cgemm_p
  1546. #define CGEMM_DEFAULT_R cgemm_r
  1547. #define ZGEMM_DEFAULT_P zgemm_p
  1548. #define ZGEMM_DEFAULT_R zgemm_r
  1549. #define XGEMM_DEFAULT_P xgemm_p
  1550. #define XGEMM_DEFAULT_R xgemm_r
  1551. #define SGEMM_DEFAULT_Q 256
  1552. #define DGEMM_DEFAULT_Q 256
  1553. #define QGEMM_DEFAULT_Q 256
  1554. #define CGEMM_DEFAULT_Q 256
  1555. #define ZGEMM_DEFAULT_Q 256
  1556. #define XGEMM_DEFAULT_Q 256
  1557. #endif
  1558. #ifdef ITANIUM2
  1559. #define SNUMOPT 4
  1560. #define DNUMOPT 4
  1561. #define GEMM_DEFAULT_OFFSET_A 0
  1562. #define GEMM_DEFAULT_OFFSET_B 128
  1563. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1564. #define SGEMM_DEFAULT_UNROLL_M 8
  1565. #define SGEMM_DEFAULT_UNROLL_N 8
  1566. #define DGEMM_DEFAULT_UNROLL_M 8
  1567. #define DGEMM_DEFAULT_UNROLL_N 8
  1568. #define QGEMM_DEFAULT_UNROLL_M 8
  1569. #define QGEMM_DEFAULT_UNROLL_N 8
  1570. #define CGEMM_DEFAULT_UNROLL_M 4
  1571. #define CGEMM_DEFAULT_UNROLL_N 4
  1572. #define ZGEMM_DEFAULT_UNROLL_M 4
  1573. #define ZGEMM_DEFAULT_UNROLL_N 4
  1574. #define XGEMM_DEFAULT_UNROLL_M 4
  1575. #define XGEMM_DEFAULT_UNROLL_N 4
  1576. #define SGEMM_DEFAULT_P sgemm_p
  1577. #define DGEMM_DEFAULT_P dgemm_p
  1578. #define QGEMM_DEFAULT_P qgemm_p
  1579. #define CGEMM_DEFAULT_P cgemm_p
  1580. #define ZGEMM_DEFAULT_P zgemm_p
  1581. #define XGEMM_DEFAULT_P xgemm_p
  1582. #define SGEMM_DEFAULT_Q 1024
  1583. #define DGEMM_DEFAULT_Q 1024
  1584. #define QGEMM_DEFAULT_Q 1024
  1585. #define CGEMM_DEFAULT_Q 1024
  1586. #define ZGEMM_DEFAULT_Q 1024
  1587. #define XGEMM_DEFAULT_Q 1024
  1588. #define SGEMM_DEFAULT_R sgemm_r
  1589. #define DGEMM_DEFAULT_R dgemm_r
  1590. #define QGEMM_DEFAULT_R qgemm_r
  1591. #define CGEMM_DEFAULT_R cgemm_r
  1592. #define ZGEMM_DEFAULT_R zgemm_r
  1593. #define XGEMM_DEFAULT_R xgemm_r
  1594. #define SYMV_P 16
  1595. #define GETRF_FACTOR 0.65
  1596. #endif
  1597. #if defined(EV4) || defined(EV5) || defined(EV6)
  1598. #ifdef EV4
  1599. #define SNUMOPT 1
  1600. #define DNUMOPT 1
  1601. #else
  1602. #define SNUMOPT 2
  1603. #define DNUMOPT 2
  1604. #endif
  1605. #define GEMM_DEFAULT_OFFSET_A 512
  1606. #define GEMM_DEFAULT_OFFSET_B 512
  1607. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1608. #define SGEMM_DEFAULT_UNROLL_M 4
  1609. #define SGEMM_DEFAULT_UNROLL_N 4
  1610. #define DGEMM_DEFAULT_UNROLL_M 4
  1611. #define DGEMM_DEFAULT_UNROLL_N 4
  1612. #define CGEMM_DEFAULT_UNROLL_M 2
  1613. #define CGEMM_DEFAULT_UNROLL_N 2
  1614. #define ZGEMM_DEFAULT_UNROLL_M 2
  1615. #define ZGEMM_DEFAULT_UNROLL_N 2
  1616. #define SYMV_P 8
  1617. #ifdef EV4
  1618. #define SGEMM_DEFAULT_P 32
  1619. #define SGEMM_DEFAULT_Q 112
  1620. #define SGEMM_DEFAULT_R 256
  1621. #define DGEMM_DEFAULT_P 32
  1622. #define DGEMM_DEFAULT_Q 56
  1623. #define DGEMM_DEFAULT_R 256
  1624. #define CGEMM_DEFAULT_P 32
  1625. #define CGEMM_DEFAULT_Q 64
  1626. #define CGEMM_DEFAULT_R 240
  1627. #define ZGEMM_DEFAULT_P 32
  1628. #define ZGEMM_DEFAULT_Q 32
  1629. #define ZGEMM_DEFAULT_R 240
  1630. #endif
  1631. #ifdef EV5
  1632. #define SGEMM_DEFAULT_P 64
  1633. #define SGEMM_DEFAULT_Q 256
  1634. #define DGEMM_DEFAULT_P 64
  1635. #define DGEMM_DEFAULT_Q 128
  1636. #define CGEMM_DEFAULT_P 64
  1637. #define CGEMM_DEFAULT_Q 128
  1638. #define ZGEMM_DEFAULT_P 64
  1639. #define ZGEMM_DEFAULT_Q 64
  1640. #endif
  1641. #ifdef EV6
  1642. #define SGEMM_DEFAULT_P 256
  1643. #define SGEMM_DEFAULT_Q 512
  1644. #define DGEMM_DEFAULT_P 256
  1645. #define DGEMM_DEFAULT_Q 256
  1646. #define CGEMM_DEFAULT_P 256
  1647. #define CGEMM_DEFAULT_Q 256
  1648. #define ZGEMM_DEFAULT_P 128
  1649. #define ZGEMM_DEFAULT_Q 256
  1650. #endif
  1651. #endif
  1652. #ifdef CELL
  1653. #define SNUMOPT 2
  1654. #define DNUMOPT 2
  1655. #define GEMM_DEFAULT_OFFSET_A 0
  1656. #define GEMM_DEFAULT_OFFSET_B 8192
  1657. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1658. #define SGEMM_DEFAULT_UNROLL_M 16
  1659. #define SGEMM_DEFAULT_UNROLL_N 4
  1660. #define DGEMM_DEFAULT_UNROLL_M 4
  1661. #define DGEMM_DEFAULT_UNROLL_N 4
  1662. #define CGEMM_DEFAULT_UNROLL_M 8
  1663. #define CGEMM_DEFAULT_UNROLL_N 2
  1664. #define ZGEMM_DEFAULT_UNROLL_M 2
  1665. #define ZGEMM_DEFAULT_UNROLL_N 2
  1666. #define SGEMM_DEFAULT_P 128
  1667. #define DGEMM_DEFAULT_P 128
  1668. #define CGEMM_DEFAULT_P 128
  1669. #define ZGEMM_DEFAULT_P 128
  1670. #define SGEMM_DEFAULT_Q 512
  1671. #define DGEMM_DEFAULT_Q 256
  1672. #define CGEMM_DEFAULT_Q 256
  1673. #define ZGEMM_DEFAULT_Q 128
  1674. #define SYMV_P 4
  1675. #endif
  1676. #ifdef PPCG4
  1677. #define GEMM_DEFAULT_OFFSET_A 0
  1678. #define GEMM_DEFAULT_OFFSET_B 1024
  1679. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1680. #define SGEMM_DEFAULT_UNROLL_M 16
  1681. #define SGEMM_DEFAULT_UNROLL_N 4
  1682. #define DGEMM_DEFAULT_UNROLL_M 4
  1683. #define DGEMM_DEFAULT_UNROLL_N 4
  1684. #define CGEMM_DEFAULT_UNROLL_M 2
  1685. #define CGEMM_DEFAULT_UNROLL_N 2
  1686. #define ZGEMM_DEFAULT_UNROLL_M 2
  1687. #define ZGEMM_DEFAULT_UNROLL_N 2
  1688. #define SGEMM_DEFAULT_P 256
  1689. #define DGEMM_DEFAULT_P 128
  1690. #define CGEMM_DEFAULT_P 128
  1691. #define ZGEMM_DEFAULT_P 64
  1692. #define SGEMM_DEFAULT_Q 256
  1693. #define DGEMM_DEFAULT_Q 256
  1694. #define CGEMM_DEFAULT_Q 256
  1695. #define ZGEMM_DEFAULT_Q 256
  1696. #define SYMV_P 4
  1697. #endif
  1698. #ifdef PPC970
  1699. #define SNUMOPT 4
  1700. #define DNUMOPT 4
  1701. #define GEMM_DEFAULT_OFFSET_A 2688
  1702. #define GEMM_DEFAULT_OFFSET_B 3072
  1703. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1704. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1705. #define SGEMM_DEFAULT_UNROLL_M 4
  1706. #else
  1707. #define SGEMM_DEFAULT_UNROLL_M 16
  1708. #endif
  1709. #define SGEMM_DEFAULT_UNROLL_N 4
  1710. #define DGEMM_DEFAULT_UNROLL_M 4
  1711. #define DGEMM_DEFAULT_UNROLL_N 4
  1712. #if defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  1713. #define CGEMM_DEFAULT_UNROLL_M 2
  1714. #else
  1715. #define CGEMM_DEFAULT_UNROLL_M 8
  1716. #endif
  1717. #define CGEMM_DEFAULT_UNROLL_N 2
  1718. #define ZGEMM_DEFAULT_UNROLL_M 2
  1719. #define ZGEMM_DEFAULT_UNROLL_N 2
  1720. #if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_FREEBSD)
  1721. #if L2_SIZE == 1024976
  1722. #define SGEMM_DEFAULT_P 320
  1723. #define DGEMM_DEFAULT_P 256
  1724. #define CGEMM_DEFAULT_P 256
  1725. #define ZGEMM_DEFAULT_P 256
  1726. #else
  1727. #define SGEMM_DEFAULT_P 176
  1728. #define DGEMM_DEFAULT_P 176
  1729. #define CGEMM_DEFAULT_P 176
  1730. #define ZGEMM_DEFAULT_P 176
  1731. #endif
  1732. #endif
  1733. #define SGEMM_DEFAULT_Q 512
  1734. #define DGEMM_DEFAULT_Q 256
  1735. #define CGEMM_DEFAULT_Q 256
  1736. #define ZGEMM_DEFAULT_Q 128
  1737. #define SYMV_P 4
  1738. #endif
  1739. #ifdef PPC440
  1740. #define SNUMOPT 2
  1741. #define DNUMOPT 2
  1742. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1743. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1744. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1745. #define SGEMM_DEFAULT_UNROLL_M 4
  1746. #define SGEMM_DEFAULT_UNROLL_N 4
  1747. #define DGEMM_DEFAULT_UNROLL_M 4
  1748. #define DGEMM_DEFAULT_UNROLL_N 4
  1749. #define CGEMM_DEFAULT_UNROLL_M 2
  1750. #define CGEMM_DEFAULT_UNROLL_N 2
  1751. #define ZGEMM_DEFAULT_UNROLL_M 2
  1752. #define ZGEMM_DEFAULT_UNROLL_N 2
  1753. #define SGEMM_DEFAULT_P 512
  1754. #define DGEMM_DEFAULT_P 512
  1755. #define CGEMM_DEFAULT_P 512
  1756. #define ZGEMM_DEFAULT_P 512
  1757. #define SGEMM_DEFAULT_Q 1024
  1758. #define DGEMM_DEFAULT_Q 512
  1759. #define CGEMM_DEFAULT_Q 512
  1760. #define ZGEMM_DEFAULT_Q 256
  1761. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  1762. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  1763. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  1764. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  1765. #define SYMV_P 4
  1766. #endif
  1767. #ifdef PPC440FP2
  1768. #define SNUMOPT 4
  1769. #define DNUMOPT 4
  1770. #define GEMM_DEFAULT_OFFSET_A (32 * 0)
  1771. #define GEMM_DEFAULT_OFFSET_B (32 * 0)
  1772. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1773. #define SGEMM_DEFAULT_UNROLL_M 8
  1774. #define SGEMM_DEFAULT_UNROLL_N 4
  1775. #define DGEMM_DEFAULT_UNROLL_M 8
  1776. #define DGEMM_DEFAULT_UNROLL_N 4
  1777. #define CGEMM_DEFAULT_UNROLL_M 4
  1778. #define CGEMM_DEFAULT_UNROLL_N 2
  1779. #define ZGEMM_DEFAULT_UNROLL_M 4
  1780. #define ZGEMM_DEFAULT_UNROLL_N 2
  1781. #define SGEMM_DEFAULT_P 128
  1782. #define DGEMM_DEFAULT_P 128
  1783. #define CGEMM_DEFAULT_P 128
  1784. #define ZGEMM_DEFAULT_P 128
  1785. #if 1
  1786. #define SGEMM_DEFAULT_Q 4096
  1787. #define DGEMM_DEFAULT_Q 3072
  1788. #define CGEMM_DEFAULT_Q 2048
  1789. #define ZGEMM_DEFAULT_Q 1024
  1790. #else
  1791. #define SGEMM_DEFAULT_Q 512
  1792. #define DGEMM_DEFAULT_Q 256
  1793. #define CGEMM_DEFAULT_Q 256
  1794. #define ZGEMM_DEFAULT_Q 128
  1795. #endif
  1796. #define SYMV_P 4
  1797. #endif
  1798. #if defined(POWER3) || defined(POWER4) || defined(POWER5)
  1799. #define GEMM_DEFAULT_OFFSET_A 0
  1800. #define GEMM_DEFAULT_OFFSET_B 2048
  1801. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1802. #define SGEMM_DEFAULT_UNROLL_M 4
  1803. #define SGEMM_DEFAULT_UNROLL_N 4
  1804. #define DGEMM_DEFAULT_UNROLL_M 4
  1805. #define DGEMM_DEFAULT_UNROLL_N 4
  1806. #define CGEMM_DEFAULT_UNROLL_M 2
  1807. #define CGEMM_DEFAULT_UNROLL_N 2
  1808. #define ZGEMM_DEFAULT_UNROLL_M 2
  1809. #define ZGEMM_DEFAULT_UNROLL_N 2
  1810. #ifdef POWER3
  1811. #define SNUMOPT 4
  1812. #define DNUMOPT 4
  1813. #define SGEMM_DEFAULT_P 256
  1814. #define SGEMM_DEFAULT_Q 432
  1815. #define SGEMM_DEFAULT_R 1012
  1816. #define DGEMM_DEFAULT_P 256
  1817. #define DGEMM_DEFAULT_Q 216
  1818. #define DGEMM_DEFAULT_R 1012
  1819. #define ZGEMM_DEFAULT_P 256
  1820. #define ZGEMM_DEFAULT_Q 104
  1821. #define ZGEMM_DEFAULT_R 1012
  1822. #endif
  1823. #if defined(POWER4)
  1824. #ifdef ALLOC_HUGETLB
  1825. #define SGEMM_DEFAULT_P 184
  1826. #define DGEMM_DEFAULT_P 184
  1827. #define CGEMM_DEFAULT_P 184
  1828. #define ZGEMM_DEFAULT_P 184
  1829. #else
  1830. #define SGEMM_DEFAULT_P 144
  1831. #define DGEMM_DEFAULT_P 144
  1832. #define CGEMM_DEFAULT_P 144
  1833. #define ZGEMM_DEFAULT_P 144
  1834. #endif
  1835. #endif
  1836. #if defined(POWER5)
  1837. #ifdef ALLOC_HUGETLB
  1838. #define SGEMM_DEFAULT_P 512
  1839. #define DGEMM_DEFAULT_P 256
  1840. #define CGEMM_DEFAULT_P 256
  1841. #define ZGEMM_DEFAULT_P 128
  1842. #else
  1843. #define SGEMM_DEFAULT_P 320
  1844. #define DGEMM_DEFAULT_P 160
  1845. #define CGEMM_DEFAULT_P 160
  1846. #define ZGEMM_DEFAULT_P 80
  1847. #endif
  1848. #define SGEMM_DEFAULT_Q 256
  1849. #define CGEMM_DEFAULT_Q 256
  1850. #define DGEMM_DEFAULT_Q 256
  1851. #define ZGEMM_DEFAULT_Q 256
  1852. #endif
  1853. #define SYMV_P 8
  1854. #endif
  1855. #if defined(POWER6)
  1856. #define SNUMOPT 4
  1857. #define DNUMOPT 4
  1858. #define GEMM_DEFAULT_OFFSET_A 384
  1859. #define GEMM_DEFAULT_OFFSET_B 1024
  1860. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1861. #define SGEMM_DEFAULT_UNROLL_M 4
  1862. #define SGEMM_DEFAULT_UNROLL_N 4
  1863. #define DGEMM_DEFAULT_UNROLL_M 4
  1864. #define DGEMM_DEFAULT_UNROLL_N 4
  1865. #define CGEMM_DEFAULT_UNROLL_M 2
  1866. #define CGEMM_DEFAULT_UNROLL_N 4
  1867. #define ZGEMM_DEFAULT_UNROLL_M 2
  1868. #define ZGEMM_DEFAULT_UNROLL_N 4
  1869. #define SGEMM_DEFAULT_P 992
  1870. #define DGEMM_DEFAULT_P 480
  1871. #define CGEMM_DEFAULT_P 488
  1872. #define ZGEMM_DEFAULT_P 248
  1873. #define SGEMM_DEFAULT_Q 504
  1874. #define DGEMM_DEFAULT_Q 504
  1875. #define CGEMM_DEFAULT_Q 400
  1876. #define ZGEMM_DEFAULT_Q 400
  1877. #define SYMV_P 8
  1878. #endif
  1879. #if defined(POWER8)
  1880. #define SNUMOPT 16
  1881. #define DNUMOPT 8
  1882. #define GEMM_DEFAULT_OFFSET_A 0
  1883. #define GEMM_DEFAULT_OFFSET_B 65536
  1884. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1885. #if defined(__32BIT__)
  1886. #warning using BINARY32==POWER6
  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 4
  1893. #define ZGEMM_DEFAULT_UNROLL_M 2
  1894. #define ZGEMM_DEFAULT_UNROLL_N 4
  1895. #else
  1896. #define SGEMM_DEFAULT_UNROLL_M 16
  1897. #define SGEMM_DEFAULT_UNROLL_N 8
  1898. #define DGEMM_DEFAULT_UNROLL_M 16
  1899. #define DGEMM_DEFAULT_UNROLL_N 4
  1900. #define CGEMM_DEFAULT_UNROLL_M 8
  1901. #define CGEMM_DEFAULT_UNROLL_N 4
  1902. #define ZGEMM_DEFAULT_UNROLL_M 8
  1903. #define ZGEMM_DEFAULT_UNROLL_N 2
  1904. #endif
  1905. #define SGEMM_DEFAULT_P 1280UL
  1906. #define DGEMM_DEFAULT_P 640UL
  1907. #define CGEMM_DEFAULT_P 640UL
  1908. #define ZGEMM_DEFAULT_P 320UL
  1909. #define SGEMM_DEFAULT_Q 640UL
  1910. #define DGEMM_DEFAULT_Q 720UL
  1911. #define CGEMM_DEFAULT_Q 640UL
  1912. #define ZGEMM_DEFAULT_Q 640UL
  1913. #if 0
  1914. #define SGEMM_DEFAULT_R SGEMM_DEFAULT_P
  1915. #define DGEMM_DEFAULT_R DGEMM_DEFAULT_P
  1916. #define CGEMM_DEFAULT_R CGEMM_DEFAULT_P
  1917. #define ZGEMM_DEFAULT_R ZGEMM_DEFAULT_P
  1918. #endif
  1919. #define SGEMM_DEFAULT_R 4096
  1920. #define DGEMM_DEFAULT_R 4096
  1921. #define CGEMM_DEFAULT_R 4096
  1922. #define ZGEMM_DEFAULT_R 4096
  1923. #define SYMV_P 8
  1924. #endif
  1925. #if defined(POWER9) || defined(POWER10)
  1926. #define SNUMOPT 16
  1927. #define DNUMOPT 8
  1928. #define GEMM_DEFAULT_OFFSET_A 0
  1929. #define GEMM_DEFAULT_OFFSET_B 65536
  1930. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  1931. #define SGEMM_DEFAULT_UNROLL_M 16
  1932. #define SGEMM_DEFAULT_UNROLL_N 8
  1933. #define DGEMM_DEFAULT_UNROLL_M 16
  1934. #define DGEMM_DEFAULT_UNROLL_N 4
  1935. #define CGEMM_DEFAULT_UNROLL_M 8
  1936. #define CGEMM_DEFAULT_UNROLL_N 4
  1937. #define ZGEMM_DEFAULT_UNROLL_M 8
  1938. #define ZGEMM_DEFAULT_UNROLL_N 2
  1939. #define SGEMM_DEFAULT_P 832
  1940. #define DGEMM_DEFAULT_P 128
  1941. #define CGEMM_DEFAULT_P 512
  1942. #define ZGEMM_DEFAULT_P 256
  1943. #define SGEMM_DEFAULT_Q 1026
  1944. #define DGEMM_DEFAULT_Q 384
  1945. #define CGEMM_DEFAULT_Q 1026
  1946. #define ZGEMM_DEFAULT_Q 1026
  1947. #define SGEMM_DEFAULT_R 4096
  1948. #define DGEMM_DEFAULT_R 4096
  1949. #define CGEMM_DEFAULT_R 4096
  1950. #define ZGEMM_DEFAULT_R 4096
  1951. #define SYMV_P 8
  1952. #endif
  1953. #if defined(POWER10)
  1954. #undef SHGEMM_DEFAULT_UNROLL_N
  1955. #undef SHGEMM_DEFAULT_UNROLL_M
  1956. #undef SHGEMM_DEFAULT_P
  1957. #undef SHGEMM_DEFAULT_R
  1958. #undef SHGEMM_DEFAULT_Q
  1959. #define SHGEMM_DEFAULT_UNROLL_M 16
  1960. #define SHGEMM_DEFAULT_UNROLL_N 8
  1961. #define SHGEMM_DEFAULT_P 832
  1962. #define SHGEMM_DEFAULT_Q 1026
  1963. #define SHGEMM_DEFAULT_R 4096
  1964. #endif
  1965. #if defined(SPARC) && defined(V7)
  1966. #define SNUMOPT 4
  1967. #define DNUMOPT 4
  1968. #define GEMM_DEFAULT_OFFSET_A 0
  1969. #define GEMM_DEFAULT_OFFSET_B 2048
  1970. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1971. #define SGEMM_DEFAULT_UNROLL_M 2
  1972. #define SGEMM_DEFAULT_UNROLL_N 8
  1973. #define DGEMM_DEFAULT_UNROLL_M 2
  1974. #define DGEMM_DEFAULT_UNROLL_N 8
  1975. #define CGEMM_DEFAULT_UNROLL_M 1
  1976. #define CGEMM_DEFAULT_UNROLL_N 4
  1977. #define ZGEMM_DEFAULT_UNROLL_M 1
  1978. #define ZGEMM_DEFAULT_UNROLL_N 4
  1979. #define SGEMM_DEFAULT_P 256
  1980. #define DGEMM_DEFAULT_P 256
  1981. #define CGEMM_DEFAULT_P 256
  1982. #define ZGEMM_DEFAULT_P 256
  1983. #define SGEMM_DEFAULT_Q 512
  1984. #define DGEMM_DEFAULT_Q 256
  1985. #define CGEMM_DEFAULT_Q 256
  1986. #define ZGEMM_DEFAULT_Q 128
  1987. #define SYMV_P 8
  1988. #define GEMM_THREAD gemm_thread_mn
  1989. #endif
  1990. #if (defined(SPARC) && defined(V9)) || defined(__sparc_v9__)
  1991. #define SNUMOPT 2
  1992. #define DNUMOPT 2
  1993. #define GEMM_DEFAULT_OFFSET_A 0
  1994. #define GEMM_DEFAULT_OFFSET_B 2048
  1995. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  1996. #define SGEMM_DEFAULT_UNROLL_M 4
  1997. #define SGEMM_DEFAULT_UNROLL_N 4
  1998. #define DGEMM_DEFAULT_UNROLL_M 4
  1999. #define DGEMM_DEFAULT_UNROLL_N 4
  2000. #define CGEMM_DEFAULT_UNROLL_M 2
  2001. #define CGEMM_DEFAULT_UNROLL_N 2
  2002. #define ZGEMM_DEFAULT_UNROLL_M 2
  2003. #define ZGEMM_DEFAULT_UNROLL_N 2
  2004. #define SGEMM_DEFAULT_P 512
  2005. #define DGEMM_DEFAULT_P 512
  2006. #define CGEMM_DEFAULT_P 512
  2007. #define ZGEMM_DEFAULT_P 512
  2008. #define SGEMM_DEFAULT_Q 1024
  2009. #define DGEMM_DEFAULT_Q 512
  2010. #define CGEMM_DEFAULT_Q 512
  2011. #define ZGEMM_DEFAULT_Q 256
  2012. #define SYMV_P 8
  2013. #endif
  2014. #ifdef SICORTEX
  2015. #define SNUMOPT 2
  2016. #define DNUMOPT 2
  2017. #define GEMM_DEFAULT_OFFSET_A 0
  2018. #define GEMM_DEFAULT_OFFSET_B 0
  2019. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2020. #define SGEMM_DEFAULT_UNROLL_M 2
  2021. #define SGEMM_DEFAULT_UNROLL_N 8
  2022. #define DGEMM_DEFAULT_UNROLL_M 2
  2023. #define DGEMM_DEFAULT_UNROLL_N 8
  2024. #define CGEMM_DEFAULT_UNROLL_M 1
  2025. #define CGEMM_DEFAULT_UNROLL_N 4
  2026. #define ZGEMM_DEFAULT_UNROLL_M 1
  2027. #define ZGEMM_DEFAULT_UNROLL_N 4
  2028. #define SGEMM_DEFAULT_P 108
  2029. #define DGEMM_DEFAULT_P 112
  2030. #define CGEMM_DEFAULT_P 108
  2031. #define ZGEMM_DEFAULT_P 112
  2032. #define SGEMM_DEFAULT_Q 288
  2033. #define DGEMM_DEFAULT_Q 144
  2034. #define CGEMM_DEFAULT_Q 144
  2035. #define ZGEMM_DEFAULT_Q 72
  2036. #define SGEMM_DEFAULT_R 2000
  2037. #define DGEMM_DEFAULT_R 2000
  2038. #define CGEMM_DEFAULT_R 2000
  2039. #define ZGEMM_DEFAULT_R 2000
  2040. #define SYMV_P 16
  2041. #endif
  2042. #ifdef LOONGSON3A
  2043. ////Copy from SICORTEX
  2044. #define SNUMOPT 2
  2045. #define DNUMOPT 2
  2046. #define GEMM_DEFAULT_OFFSET_A 0
  2047. #define GEMM_DEFAULT_OFFSET_B 0
  2048. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2049. #define SGEMM_DEFAULT_UNROLL_M 8
  2050. #define SGEMM_DEFAULT_UNROLL_N 4
  2051. #define DGEMM_DEFAULT_UNROLL_M 4
  2052. #define DGEMM_DEFAULT_UNROLL_N 4
  2053. #define CGEMM_DEFAULT_UNROLL_M 4
  2054. #define CGEMM_DEFAULT_UNROLL_N 2
  2055. #define ZGEMM_DEFAULT_UNROLL_M 2
  2056. #define ZGEMM_DEFAULT_UNROLL_N 2
  2057. #define SGEMM_DEFAULT_P 64
  2058. #define DGEMM_DEFAULT_P 44
  2059. #define CGEMM_DEFAULT_P 64
  2060. #define ZGEMM_DEFAULT_P 32
  2061. #define SGEMM_DEFAULT_Q 192
  2062. #define DGEMM_DEFAULT_Q 92
  2063. #define CGEMM_DEFAULT_Q 128
  2064. #define ZGEMM_DEFAULT_Q 80
  2065. #define SGEMM_DEFAULT_R 640
  2066. #define DGEMM_DEFAULT_R dgemm_r
  2067. #define CGEMM_DEFAULT_R 640
  2068. #define ZGEMM_DEFAULT_R 640
  2069. #define GEMM_OFFSET_A1 0x10000
  2070. #define GEMM_OFFSET_B1 0x100000
  2071. #define SYMV_P 16
  2072. #endif
  2073. #ifdef LOONGSON3B
  2074. #define SNUMOPT 2
  2075. #define DNUMOPT 2
  2076. #define GEMM_DEFAULT_OFFSET_A 0
  2077. #define GEMM_DEFAULT_OFFSET_B 0
  2078. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2079. #define SGEMM_DEFAULT_UNROLL_M 2
  2080. #define SGEMM_DEFAULT_UNROLL_N 2
  2081. #define DGEMM_DEFAULT_UNROLL_M 2
  2082. #define DGEMM_DEFAULT_UNROLL_N 2
  2083. #define CGEMM_DEFAULT_UNROLL_M 2
  2084. #define CGEMM_DEFAULT_UNROLL_N 2
  2085. #define ZGEMM_DEFAULT_UNROLL_M 2
  2086. #define ZGEMM_DEFAULT_UNROLL_N 2
  2087. #define SGEMM_DEFAULT_P 64
  2088. #define DGEMM_DEFAULT_P 24
  2089. #define CGEMM_DEFAULT_P 24
  2090. #define ZGEMM_DEFAULT_P 20
  2091. #define SGEMM_DEFAULT_Q 192
  2092. #define DGEMM_DEFAULT_Q 128
  2093. #define CGEMM_DEFAULT_Q 128
  2094. #define ZGEMM_DEFAULT_Q 64
  2095. #define SGEMM_DEFAULT_R 512
  2096. #define DGEMM_DEFAULT_R 512
  2097. #define CGEMM_DEFAULT_R 512
  2098. #define ZGEMM_DEFAULT_R 512
  2099. #define GEMM_OFFSET_A1 0x10000
  2100. #define GEMM_OFFSET_B1 0x100000
  2101. #define SYMV_P 16
  2102. #endif
  2103. #if defined(P5600) || defined(MIPS1004K) || defined(MIPS24K) || defined(I6400) || defined(P6600) || defined(I6500)
  2104. #define SNUMOPT 2
  2105. #define DNUMOPT 2
  2106. #define GEMM_DEFAULT_OFFSET_A 0
  2107. #define GEMM_DEFAULT_OFFSET_B 0
  2108. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2109. #ifdef HAVE_MSA
  2110. #define SGEMM_DEFAULT_UNROLL_M 8
  2111. #define SGEMM_DEFAULT_UNROLL_N 8
  2112. #define DGEMM_DEFAULT_UNROLL_M 8
  2113. #define DGEMM_DEFAULT_UNROLL_N 4
  2114. #define CGEMM_DEFAULT_UNROLL_M 8
  2115. #define CGEMM_DEFAULT_UNROLL_N 4
  2116. #define ZGEMM_DEFAULT_UNROLL_M 4
  2117. #define ZGEMM_DEFAULT_UNROLL_N 4
  2118. #else
  2119. #define SGEMM_DEFAULT_UNROLL_M 2
  2120. #define SGEMM_DEFAULT_UNROLL_N 2
  2121. #define DGEMM_DEFAULT_UNROLL_M 2
  2122. #define DGEMM_DEFAULT_UNROLL_N 2
  2123. #define CGEMM_DEFAULT_UNROLL_M 2
  2124. #define CGEMM_DEFAULT_UNROLL_N 2
  2125. #define ZGEMM_DEFAULT_UNROLL_M 2
  2126. #define ZGEMM_DEFAULT_UNROLL_N 2
  2127. #endif
  2128. #define SGEMM_DEFAULT_P 128
  2129. #define DGEMM_DEFAULT_P 128
  2130. #define CGEMM_DEFAULT_P 96
  2131. #define ZGEMM_DEFAULT_P 64
  2132. #define SGEMM_DEFAULT_Q 240
  2133. #define DGEMM_DEFAULT_Q 120
  2134. #define CGEMM_DEFAULT_Q 120
  2135. #define ZGEMM_DEFAULT_Q 120
  2136. #define SGEMM_DEFAULT_R 12288
  2137. #define DGEMM_DEFAULT_R 8192
  2138. #define CGEMM_DEFAULT_R 4096
  2139. #define ZGEMM_DEFAULT_R 4096
  2140. #define SYMV_P 16
  2141. #endif
  2142. #ifdef ARMV7
  2143. #define SNUMOPT 2
  2144. #define DNUMOPT 2
  2145. #define GEMM_DEFAULT_OFFSET_A 0
  2146. #define GEMM_DEFAULT_OFFSET_B 0
  2147. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2148. #define SGEMM_DEFAULT_UNROLL_M 4
  2149. #define SGEMM_DEFAULT_UNROLL_N 4
  2150. #define DGEMM_DEFAULT_UNROLL_M 4
  2151. #define DGEMM_DEFAULT_UNROLL_N 4
  2152. #define CGEMM_DEFAULT_UNROLL_M 2
  2153. #define CGEMM_DEFAULT_UNROLL_N 2
  2154. #define ZGEMM_DEFAULT_UNROLL_M 2
  2155. #define ZGEMM_DEFAULT_UNROLL_N 2
  2156. #define SGEMM_DEFAULT_P 128
  2157. #define DGEMM_DEFAULT_P 128
  2158. #define CGEMM_DEFAULT_P 96
  2159. #define ZGEMM_DEFAULT_P 64
  2160. #define SGEMM_DEFAULT_Q 240
  2161. #define DGEMM_DEFAULT_Q 120
  2162. #define CGEMM_DEFAULT_Q 120
  2163. #define ZGEMM_DEFAULT_Q 120
  2164. #define SGEMM_DEFAULT_R 12288
  2165. #define DGEMM_DEFAULT_R 8192
  2166. #define CGEMM_DEFAULT_R 4096
  2167. #define ZGEMM_DEFAULT_R 4096
  2168. #define SYMV_P 16
  2169. #endif
  2170. #if defined(ARMV6)
  2171. #define SNUMOPT 2
  2172. #define DNUMOPT 2
  2173. #define GEMM_DEFAULT_OFFSET_A 0
  2174. #define GEMM_DEFAULT_OFFSET_B 0
  2175. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2176. #define SGEMM_DEFAULT_UNROLL_M 4
  2177. #define SGEMM_DEFAULT_UNROLL_N 2
  2178. #define DGEMM_DEFAULT_UNROLL_M 4
  2179. #define DGEMM_DEFAULT_UNROLL_N 2
  2180. #define CGEMM_DEFAULT_UNROLL_M 2
  2181. #define CGEMM_DEFAULT_UNROLL_N 2
  2182. #define ZGEMM_DEFAULT_UNROLL_M 2
  2183. #define ZGEMM_DEFAULT_UNROLL_N 2
  2184. #define SGEMM_DEFAULT_P 128
  2185. #define DGEMM_DEFAULT_P 128
  2186. #define CGEMM_DEFAULT_P 96
  2187. #define ZGEMM_DEFAULT_P 64
  2188. #define SGEMM_DEFAULT_Q 240
  2189. #define DGEMM_DEFAULT_Q 120
  2190. #define CGEMM_DEFAULT_Q 120
  2191. #define ZGEMM_DEFAULT_Q 120
  2192. #define SGEMM_DEFAULT_R 12288
  2193. #define DGEMM_DEFAULT_R 8192
  2194. #define CGEMM_DEFAULT_R 4096
  2195. #define ZGEMM_DEFAULT_R 4096
  2196. #define SYMV_P 16
  2197. #endif
  2198. // Common ARMv8 parameters
  2199. #if defined(ARMV8)
  2200. #define SNUMOPT 2
  2201. #define DNUMOPT 2
  2202. #define GEMM_DEFAULT_OFFSET_A 0
  2203. #define GEMM_DEFAULT_OFFSET_B 0
  2204. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2205. #define SYMV_P 16
  2206. #if defined(CORTEXA57) || \
  2207. defined(CORTEXA72) || defined(CORTEXA73) || \
  2208. defined(FALKOR) || defined(TSV110) || defined(EMAG8180)
  2209. #define SGEMM_DEFAULT_UNROLL_M 16
  2210. #define SGEMM_DEFAULT_UNROLL_N 4
  2211. #define DGEMM_DEFAULT_UNROLL_M 8
  2212. #define DGEMM_DEFAULT_UNROLL_N 4
  2213. #define CGEMM_DEFAULT_UNROLL_M 8
  2214. #define CGEMM_DEFAULT_UNROLL_N 4
  2215. #define ZGEMM_DEFAULT_UNROLL_M 4
  2216. #define ZGEMM_DEFAULT_UNROLL_N 4
  2217. /*FIXME: this should be using the cache size, but there is currently no easy way to
  2218. query that on ARM. So if getarch counted more than 8 cores we simply assume the host
  2219. is a big desktop or server with abundant cache rather than a phone or embedded device */
  2220. #if NUM_CORES > 8 || defined(TSV110) || defined(EMAG8180)
  2221. #define SGEMM_DEFAULT_P 512
  2222. #define DGEMM_DEFAULT_P 256
  2223. #define CGEMM_DEFAULT_P 256
  2224. #define ZGEMM_DEFAULT_P 128
  2225. #define SGEMM_DEFAULT_Q 1024
  2226. #define DGEMM_DEFAULT_Q 512
  2227. #define CGEMM_DEFAULT_Q 512
  2228. #define ZGEMM_DEFAULT_Q 512
  2229. #else
  2230. #define SGEMM_DEFAULT_P 128
  2231. #define DGEMM_DEFAULT_P 160
  2232. #define CGEMM_DEFAULT_P 128
  2233. #define ZGEMM_DEFAULT_P 128
  2234. #define SGEMM_DEFAULT_Q 352
  2235. #define DGEMM_DEFAULT_Q 128
  2236. #define CGEMM_DEFAULT_Q 224
  2237. #define ZGEMM_DEFAULT_Q 112
  2238. #endif
  2239. #define SGEMM_DEFAULT_R 4096
  2240. #define DGEMM_DEFAULT_R 4096
  2241. #define CGEMM_DEFAULT_R 4096
  2242. #define ZGEMM_DEFAULT_R 2048
  2243. #elif defined(CORTEXA53)
  2244. #define SGEMM_DEFAULT_UNROLL_M 8
  2245. #define SGEMM_DEFAULT_UNROLL_N 8
  2246. #define DGEMM_DEFAULT_UNROLL_M 8
  2247. #define DGEMM_DEFAULT_UNROLL_N 4
  2248. #define CGEMM_DEFAULT_UNROLL_M 8
  2249. #define CGEMM_DEFAULT_UNROLL_N 4
  2250. #define ZGEMM_DEFAULT_UNROLL_M 4
  2251. #define ZGEMM_DEFAULT_UNROLL_N 4
  2252. #define SGEMM_DEFAULT_P 256
  2253. #define DGEMM_DEFAULT_P 160
  2254. #define CGEMM_DEFAULT_P 128
  2255. #define ZGEMM_DEFAULT_P 128
  2256. #define SGEMM_DEFAULT_Q 256
  2257. #define DGEMM_DEFAULT_Q 128
  2258. #define CGEMM_DEFAULT_Q 224
  2259. #define ZGEMM_DEFAULT_Q 112
  2260. #define SGEMM_DEFAULT_R 4096
  2261. #define DGEMM_DEFAULT_R 4096
  2262. #define CGEMM_DEFAULT_R 4096
  2263. #define ZGEMM_DEFAULT_R 2048
  2264. #elif defined(THUNDERX)
  2265. #define SGEMM_DEFAULT_UNROLL_M 4
  2266. #define SGEMM_DEFAULT_UNROLL_N 4
  2267. #define DGEMM_DEFAULT_UNROLL_M 2
  2268. #define DGEMM_DEFAULT_UNROLL_N 2
  2269. #define CGEMM_DEFAULT_UNROLL_M 2
  2270. #define CGEMM_DEFAULT_UNROLL_N 2
  2271. #define ZGEMM_DEFAULT_UNROLL_M 2
  2272. #define ZGEMM_DEFAULT_UNROLL_N 2
  2273. #define SGEMM_DEFAULT_P 128
  2274. #define DGEMM_DEFAULT_P 128
  2275. #define CGEMM_DEFAULT_P 96
  2276. #define ZGEMM_DEFAULT_P 64
  2277. #define SGEMM_DEFAULT_Q 240
  2278. #define DGEMM_DEFAULT_Q 120
  2279. #define CGEMM_DEFAULT_Q 120
  2280. #define ZGEMM_DEFAULT_Q 120
  2281. #define SGEMM_DEFAULT_R 12288
  2282. #define DGEMM_DEFAULT_R 8192
  2283. #define CGEMM_DEFAULT_R 4096
  2284. #define ZGEMM_DEFAULT_R 4096
  2285. #elif defined(THUNDERX2T99)
  2286. #define SGEMM_DEFAULT_UNROLL_M 16
  2287. #define SGEMM_DEFAULT_UNROLL_N 4
  2288. #define DGEMM_DEFAULT_UNROLL_M 8
  2289. #define DGEMM_DEFAULT_UNROLL_N 4
  2290. #define CGEMM_DEFAULT_UNROLL_M 8
  2291. #define CGEMM_DEFAULT_UNROLL_N 4
  2292. #define ZGEMM_DEFAULT_UNROLL_M 4
  2293. #define ZGEMM_DEFAULT_UNROLL_N 4
  2294. #define SGEMM_DEFAULT_P 128
  2295. #define DGEMM_DEFAULT_P 160
  2296. #define CGEMM_DEFAULT_P 128
  2297. #define ZGEMM_DEFAULT_P 128
  2298. #define SGEMM_DEFAULT_Q 352
  2299. #define DGEMM_DEFAULT_Q 128
  2300. #define CGEMM_DEFAULT_Q 224
  2301. #define ZGEMM_DEFAULT_Q 112
  2302. #define SGEMM_DEFAULT_R 4096
  2303. #define DGEMM_DEFAULT_R 4096
  2304. #define CGEMM_DEFAULT_R 4096
  2305. #define ZGEMM_DEFAULT_R 4096
  2306. #elif defined(THUNDERX3T110)
  2307. #define SGEMM_DEFAULT_UNROLL_M 16
  2308. #define SGEMM_DEFAULT_UNROLL_N 4
  2309. #define DGEMM_DEFAULT_UNROLL_M 8
  2310. #define DGEMM_DEFAULT_UNROLL_N 4
  2311. #define CGEMM_DEFAULT_UNROLL_M 8
  2312. #define CGEMM_DEFAULT_UNROLL_N 4
  2313. #define ZGEMM_DEFAULT_UNROLL_M 4
  2314. #define ZGEMM_DEFAULT_UNROLL_N 4
  2315. #define SGEMM_DEFAULT_P 128
  2316. #define DGEMM_DEFAULT_P 320
  2317. #define CGEMM_DEFAULT_P 128
  2318. #define ZGEMM_DEFAULT_P 128
  2319. #define SGEMM_DEFAULT_Q 352
  2320. #define DGEMM_DEFAULT_Q 128
  2321. #define CGEMM_DEFAULT_Q 224
  2322. #define ZGEMM_DEFAULT_Q 112
  2323. #define SGEMM_DEFAULT_R 4096
  2324. #define DGEMM_DEFAULT_R 4096
  2325. #define CGEMM_DEFAULT_R 4096
  2326. #define ZGEMM_DEFAULT_R 4096
  2327. #elif defined(NEOVERSEN1)
  2328. #define SGEMM_DEFAULT_UNROLL_M 16
  2329. #define SGEMM_DEFAULT_UNROLL_N 4
  2330. #define DGEMM_DEFAULT_UNROLL_M 8
  2331. #define DGEMM_DEFAULT_UNROLL_N 4
  2332. #define CGEMM_DEFAULT_UNROLL_M 8
  2333. #define CGEMM_DEFAULT_UNROLL_N 4
  2334. #define ZGEMM_DEFAULT_UNROLL_M 4
  2335. #define ZGEMM_DEFAULT_UNROLL_N 4
  2336. #define SGEMM_DEFAULT_P 128
  2337. #define DGEMM_DEFAULT_P 160
  2338. #define CGEMM_DEFAULT_P 128
  2339. #define ZGEMM_DEFAULT_P 128
  2340. #define SGEMM_DEFAULT_Q 352
  2341. #define DGEMM_DEFAULT_Q 128
  2342. #define CGEMM_DEFAULT_Q 224
  2343. #define ZGEMM_DEFAULT_Q 112
  2344. #define SGEMM_DEFAULT_R 4096
  2345. #define DGEMM_DEFAULT_R 4096
  2346. #define CGEMM_DEFAULT_R 4096
  2347. #define ZGEMM_DEFAULT_R 4096
  2348. #else // Other/undetected ARMv8 cores
  2349. #define SGEMM_DEFAULT_UNROLL_M 16
  2350. #define SGEMM_DEFAULT_UNROLL_N 4
  2351. #define DGEMM_DEFAULT_UNROLL_M 8
  2352. #define DGEMM_DEFAULT_UNROLL_N 4
  2353. #define CGEMM_DEFAULT_UNROLL_M 8
  2354. #define CGEMM_DEFAULT_UNROLL_N 4
  2355. #define ZGEMM_DEFAULT_UNROLL_M 4
  2356. #define ZGEMM_DEFAULT_UNROLL_N 4
  2357. #define SGEMM_DEFAULT_P 128
  2358. #define DGEMM_DEFAULT_P 160
  2359. #define CGEMM_DEFAULT_P 128
  2360. #define ZGEMM_DEFAULT_P 128
  2361. #define SGEMM_DEFAULT_Q 352
  2362. #define DGEMM_DEFAULT_Q 128
  2363. #define CGEMM_DEFAULT_Q 224
  2364. #define ZGEMM_DEFAULT_Q 112
  2365. #define SGEMM_DEFAULT_R 4096
  2366. #define DGEMM_DEFAULT_R 4096
  2367. #define CGEMM_DEFAULT_R 4096
  2368. #define ZGEMM_DEFAULT_R 4096
  2369. #endif // Cores
  2370. #endif // ARMv8
  2371. #if defined(ARMV5)
  2372. #define SNUMOPT 2
  2373. #define DNUMOPT 2
  2374. #define GEMM_DEFAULT_OFFSET_A 0
  2375. #define GEMM_DEFAULT_OFFSET_B 0
  2376. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2377. #define SGEMM_DEFAULT_UNROLL_M 2
  2378. #define SGEMM_DEFAULT_UNROLL_N 2
  2379. #define DGEMM_DEFAULT_UNROLL_M 2
  2380. #define DGEMM_DEFAULT_UNROLL_N 2
  2381. #define CGEMM_DEFAULT_UNROLL_M 2
  2382. #define CGEMM_DEFAULT_UNROLL_N 2
  2383. #define ZGEMM_DEFAULT_UNROLL_M 2
  2384. #define ZGEMM_DEFAULT_UNROLL_N 2
  2385. #define SGEMM_DEFAULT_P 128
  2386. #define DGEMM_DEFAULT_P 128
  2387. #define CGEMM_DEFAULT_P 96
  2388. #define ZGEMM_DEFAULT_P 64
  2389. #define SGEMM_DEFAULT_Q 240
  2390. #define DGEMM_DEFAULT_Q 120
  2391. #define CGEMM_DEFAULT_Q 120
  2392. #define ZGEMM_DEFAULT_Q 120
  2393. #define SGEMM_DEFAULT_R 12288
  2394. #define DGEMM_DEFAULT_R 8192
  2395. #define CGEMM_DEFAULT_R 4096
  2396. #define ZGEMM_DEFAULT_R 4096
  2397. #define SYMV_P 16
  2398. #endif
  2399. #ifdef CORTEXA9
  2400. #define SNUMOPT 2
  2401. #define DNUMOPT 2
  2402. #define GEMM_DEFAULT_OFFSET_A 0
  2403. #define GEMM_DEFAULT_OFFSET_B 0
  2404. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2405. #define SGEMM_DEFAULT_UNROLL_M 4
  2406. #define SGEMM_DEFAULT_UNROLL_N 4
  2407. #define DGEMM_DEFAULT_UNROLL_M 4
  2408. #define DGEMM_DEFAULT_UNROLL_N 4
  2409. #define CGEMM_DEFAULT_UNROLL_M 2
  2410. #define CGEMM_DEFAULT_UNROLL_N 2
  2411. #define ZGEMM_DEFAULT_UNROLL_M 2
  2412. #define ZGEMM_DEFAULT_UNROLL_N 2
  2413. #define SGEMM_DEFAULT_P 128
  2414. #define DGEMM_DEFAULT_P 128
  2415. #define CGEMM_DEFAULT_P 96
  2416. #define ZGEMM_DEFAULT_P 64
  2417. #define SGEMM_DEFAULT_Q 240
  2418. #define DGEMM_DEFAULT_Q 120
  2419. #define CGEMM_DEFAULT_Q 120
  2420. #define ZGEMM_DEFAULT_Q 120
  2421. #define SGEMM_DEFAULT_R 12288
  2422. #define DGEMM_DEFAULT_R 8192
  2423. #define CGEMM_DEFAULT_R 4096
  2424. #define ZGEMM_DEFAULT_R 4096
  2425. #define SYMV_P 16
  2426. #endif
  2427. #ifdef CORTEXA15
  2428. #define SNUMOPT 2
  2429. #define DNUMOPT 2
  2430. #define GEMM_DEFAULT_OFFSET_A 0
  2431. #define GEMM_DEFAULT_OFFSET_B 0
  2432. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2433. #define SGEMM_DEFAULT_UNROLL_M 4
  2434. #define SGEMM_DEFAULT_UNROLL_N 4
  2435. #define DGEMM_DEFAULT_UNROLL_M 4
  2436. #define DGEMM_DEFAULT_UNROLL_N 4
  2437. #define CGEMM_DEFAULT_UNROLL_M 2
  2438. #define CGEMM_DEFAULT_UNROLL_N 2
  2439. #define ZGEMM_DEFAULT_UNROLL_M 2
  2440. #define ZGEMM_DEFAULT_UNROLL_N 2
  2441. #define SGEMM_DEFAULT_P 128
  2442. #define DGEMM_DEFAULT_P 128
  2443. #define CGEMM_DEFAULT_P 96
  2444. #define ZGEMM_DEFAULT_P 64
  2445. #define SGEMM_DEFAULT_Q 240
  2446. #define DGEMM_DEFAULT_Q 120
  2447. #define CGEMM_DEFAULT_Q 120
  2448. #define ZGEMM_DEFAULT_Q 120
  2449. #define SGEMM_DEFAULT_R 12288
  2450. #define DGEMM_DEFAULT_R 8192
  2451. #define CGEMM_DEFAULT_R 4096
  2452. #define ZGEMM_DEFAULT_R 4096
  2453. #define SYMV_P 16
  2454. #endif
  2455. #if defined(ZARCH_GENERIC)
  2456. #define SNUMOPT 2
  2457. #define DNUMOPT 2
  2458. #define GEMM_DEFAULT_OFFSET_A 0
  2459. #define GEMM_DEFAULT_OFFSET_B 0
  2460. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2461. #define SGEMM_DEFAULT_UNROLL_M 2
  2462. #define SGEMM_DEFAULT_UNROLL_N 2
  2463. #define DGEMM_DEFAULT_UNROLL_M 2
  2464. #define DGEMM_DEFAULT_UNROLL_N 2
  2465. #define CGEMM_DEFAULT_UNROLL_M 2
  2466. #define CGEMM_DEFAULT_UNROLL_N 2
  2467. #define ZGEMM_DEFAULT_UNROLL_M 2
  2468. #define ZGEMM_DEFAULT_UNROLL_N 2
  2469. #define SGEMM_DEFAULT_P 128
  2470. #define DGEMM_DEFAULT_P 128
  2471. #define CGEMM_DEFAULT_P 96
  2472. #define ZGEMM_DEFAULT_P 64
  2473. #define SGEMM_DEFAULT_Q 240
  2474. #define DGEMM_DEFAULT_Q 120
  2475. #define CGEMM_DEFAULT_Q 120
  2476. #define ZGEMM_DEFAULT_Q 120
  2477. #define SGEMM_DEFAULT_R 12288
  2478. #define DGEMM_DEFAULT_R 8192
  2479. #define CGEMM_DEFAULT_R 4096
  2480. #define ZGEMM_DEFAULT_R 4096
  2481. #define SYMV_P 16
  2482. #endif
  2483. #if defined(Z13)
  2484. #define SNUMOPT 2
  2485. #define DNUMOPT 2
  2486. #define GEMM_DEFAULT_OFFSET_A 0
  2487. #define GEMM_DEFAULT_OFFSET_B 0
  2488. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2489. #define SGEMM_DEFAULT_UNROLL_M 8
  2490. #define SGEMM_DEFAULT_UNROLL_N 4
  2491. #define DGEMM_DEFAULT_UNROLL_M 8
  2492. #define DGEMM_DEFAULT_UNROLL_N 4
  2493. #define CGEMM_DEFAULT_UNROLL_M 4
  2494. #define CGEMM_DEFAULT_UNROLL_N 4
  2495. #define ZGEMM_DEFAULT_UNROLL_M 4
  2496. #define ZGEMM_DEFAULT_UNROLL_N 4
  2497. #define SGEMM_DEFAULT_P 456
  2498. #define DGEMM_DEFAULT_P 320
  2499. #define CGEMM_DEFAULT_P 480
  2500. #define ZGEMM_DEFAULT_P 224
  2501. #define SGEMM_DEFAULT_Q 488
  2502. #define DGEMM_DEFAULT_Q 384
  2503. #define CGEMM_DEFAULT_Q 128
  2504. #define ZGEMM_DEFAULT_Q 352
  2505. #define SGEMM_DEFAULT_R 8192
  2506. #define DGEMM_DEFAULT_R 4096
  2507. #define CGEMM_DEFAULT_R 4096
  2508. #define ZGEMM_DEFAULT_R 2048
  2509. #define SYMV_P 16
  2510. #endif
  2511. #if defined(Z14)
  2512. #define SNUMOPT 2
  2513. #define DNUMOPT 2
  2514. #define GEMM_DEFAULT_OFFSET_A 0
  2515. #define GEMM_DEFAULT_OFFSET_B 0
  2516. #define GEMM_DEFAULT_ALIGN 0x03fffUL
  2517. #define SGEMM_DEFAULT_UNROLL_M 16
  2518. #define SGEMM_DEFAULT_UNROLL_N 4
  2519. #define DGEMM_DEFAULT_UNROLL_M 8
  2520. #define DGEMM_DEFAULT_UNROLL_N 4
  2521. #define CGEMM_DEFAULT_UNROLL_M 4
  2522. #define CGEMM_DEFAULT_UNROLL_N 4
  2523. #define ZGEMM_DEFAULT_UNROLL_M 4
  2524. #define ZGEMM_DEFAULT_UNROLL_N 4
  2525. #define SGEMM_DEFAULT_P 480
  2526. #define DGEMM_DEFAULT_P 320
  2527. #define CGEMM_DEFAULT_P 480
  2528. #define ZGEMM_DEFAULT_P 224
  2529. #define SGEMM_DEFAULT_Q 512
  2530. #define DGEMM_DEFAULT_Q 384
  2531. #define CGEMM_DEFAULT_Q 128
  2532. #define ZGEMM_DEFAULT_Q 352
  2533. #define SGEMM_DEFAULT_R 8192
  2534. #define DGEMM_DEFAULT_R 4096
  2535. #define CGEMM_DEFAULT_R 4096
  2536. #define ZGEMM_DEFAULT_R 2048
  2537. #define SYMV_P 16
  2538. #endif
  2539. #ifdef GENERIC
  2540. #define SNUMOPT 2
  2541. #define DNUMOPT 2
  2542. #define GEMM_DEFAULT_OFFSET_A 0
  2543. #define GEMM_DEFAULT_OFFSET_B 0
  2544. #define GEMM_DEFAULT_ALIGN 0x0ffffUL
  2545. #define SGEMM_DEFAULT_UNROLL_N 2
  2546. #define DGEMM_DEFAULT_UNROLL_N 2
  2547. #define QGEMM_DEFAULT_UNROLL_N 2
  2548. #define CGEMM_DEFAULT_UNROLL_N 2
  2549. #define ZGEMM_DEFAULT_UNROLL_N 2
  2550. #define XGEMM_DEFAULT_UNROLL_N 1
  2551. #ifdef ARCH_X86
  2552. #define SGEMM_DEFAULT_UNROLL_M 2
  2553. #define DGEMM_DEFAULT_UNROLL_M 2
  2554. #define QGEMM_DEFAULT_UNROLL_M 2
  2555. #define CGEMM_DEFAULT_UNROLL_M 2
  2556. #define ZGEMM_DEFAULT_UNROLL_M 2
  2557. #define XGEMM_DEFAULT_UNROLL_M 1
  2558. #else
  2559. #define SGEMM_DEFAULT_UNROLL_M 2
  2560. #define DGEMM_DEFAULT_UNROLL_M 2
  2561. #define QGEMM_DEFAULT_UNROLL_M 2
  2562. #define CGEMM_DEFAULT_UNROLL_M 2
  2563. #define ZGEMM_DEFAULT_UNROLL_M 2
  2564. #define XGEMM_DEFAULT_UNROLL_M 1
  2565. #endif
  2566. #define SGEMM_DEFAULT_P sgemm_p
  2567. #define DGEMM_DEFAULT_P dgemm_p
  2568. #define QGEMM_DEFAULT_P qgemm_p
  2569. #define CGEMM_DEFAULT_P cgemm_p
  2570. #define ZGEMM_DEFAULT_P zgemm_p
  2571. #define XGEMM_DEFAULT_P xgemm_p
  2572. #define SGEMM_DEFAULT_R sgemm_r
  2573. #define DGEMM_DEFAULT_R dgemm_r
  2574. #define QGEMM_DEFAULT_R qgemm_r
  2575. #define CGEMM_DEFAULT_R cgemm_r
  2576. #define ZGEMM_DEFAULT_R zgemm_r
  2577. #define XGEMM_DEFAULT_R xgemm_r
  2578. #define SGEMM_DEFAULT_Q 128
  2579. #define DGEMM_DEFAULT_Q 128
  2580. #define QGEMM_DEFAULT_Q 128
  2581. #define CGEMM_DEFAULT_Q 128
  2582. #define ZGEMM_DEFAULT_Q 128
  2583. #define XGEMM_DEFAULT_Q 128
  2584. #define SYMV_P 16
  2585. #endif
  2586. #ifndef QGEMM_DEFAULT_UNROLL_M
  2587. #define QGEMM_DEFAULT_UNROLL_M 2
  2588. #endif
  2589. #ifndef QGEMM_DEFAULT_UNROLL_N
  2590. #define QGEMM_DEFAULT_UNROLL_N 2
  2591. #endif
  2592. #ifndef XGEMM_DEFAULT_UNROLL_M
  2593. #define XGEMM_DEFAULT_UNROLL_M 2
  2594. #endif
  2595. #ifndef XGEMM_DEFAULT_UNROLL_N
  2596. #define XGEMM_DEFAULT_UNROLL_N 2
  2597. #endif
  2598. #ifndef HAVE_SSE2
  2599. #define SHUFPD_0 shufps $0x44,
  2600. #define SHUFPD_1 shufps $0x4e,
  2601. #define SHUFPD_2 shufps $0xe4,
  2602. #define SHUFPD_3 shufps $0xee,
  2603. #endif
  2604. #ifndef SHUFPD_0
  2605. #define SHUFPD_0 shufpd $0,
  2606. #endif
  2607. #ifndef SHUFPD_1
  2608. #define SHUFPD_1 shufpd $1,
  2609. #endif
  2610. #ifndef SHUFPD_2
  2611. #define SHUFPD_2 shufpd $2,
  2612. #endif
  2613. #ifndef SHUFPD_3
  2614. #define SHUFPD_3 shufpd $3,
  2615. #endif
  2616. #ifndef SHUFPS_39
  2617. #define SHUFPS_39 shufps $0x39,
  2618. #endif
  2619. #endif