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.

getarch.c 49 kB

6 years ago
14 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
10 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
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
6 years ago
6 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559
  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. #if defined(__WIN32__) || defined(__WIN64__) || defined(__CYGWIN32__) || defined(__CYGWIN64__) || defined(_WIN32) || defined(_WIN64)
  66. #define OS_WINDOWS
  67. #endif
  68. #if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)
  69. #define INTEL_AMD
  70. #endif
  71. #include <stdio.h>
  72. #include <string.h>
  73. #ifdef OS_WINDOWS
  74. #include <windows.h>
  75. #endif
  76. #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
  77. #include <sys/types.h>
  78. #include <sys/sysctl.h>
  79. #endif
  80. #if defined(linux) || defined(__sun__)
  81. #include <sys/sysinfo.h>
  82. #include <unistd.h>
  83. #endif
  84. #if defined(AIX)
  85. #include <sys/sysinfo.h>
  86. #endif
  87. #if defined(__x86_64__) || defined(_M_X64)
  88. #if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6))
  89. #else
  90. #ifndef NO_AVX512
  91. #define NO_AVX512
  92. #endif
  93. #endif
  94. #endif
  95. /* #define FORCE_P2 */
  96. /* #define FORCE_KATMAI */
  97. /* #define FORCE_COPPERMINE */
  98. /* #define FORCE_NORTHWOOD */
  99. /* #define FORCE_PRESCOTT */
  100. /* #define FORCE_BANIAS */
  101. /* #define FORCE_YONAH */
  102. /* #define FORCE_CORE2 */
  103. /* #define FORCE_PENRYN */
  104. /* #define FORCE_DUNNINGTON */
  105. /* #define FORCE_NEHALEM */
  106. /* #define FORCE_SANDYBRIDGE */
  107. /* #define FORCE_ATOM */
  108. /* #define FORCE_ATHLON */
  109. /* #define FORCE_OPTERON */
  110. /* #define FORCE_OPTERON_SSE3 */
  111. /* #define FORCE_BARCELONA */
  112. /* #define FORCE_SHANGHAI */
  113. /* #define FORCE_ISTANBUL */
  114. /* #define FORCE_BOBCAT */
  115. /* #define FORCE_BULLDOZER */
  116. /* #define FORCE_PILEDRIVER */
  117. /* #define FORCE_SSE_GENERIC */
  118. /* #define FORCE_VIAC3 */
  119. /* #define FORCE_NANO */
  120. /* #define FORCE_POWER3 */
  121. /* #define FORCE_POWER4 */
  122. /* #define FORCE_POWER5 */
  123. /* #define FORCE_POWER6 */
  124. /* #define FORCE_POWER7 */
  125. /* #define FORCE_POWER8 */
  126. /* #define FORCE_PPCG4 */
  127. /* #define FORCE_PPC970 */
  128. /* #define FORCE_PPC970MP */
  129. /* #define FORCE_PPC440 */
  130. /* #define FORCE_PPC440FP2 */
  131. /* #define FORCE_CELL */
  132. /* #define FORCE_SICORTEX */
  133. /* #define FORCE_LOONGSON3A */
  134. /* #define FORCE_LOONGSON3B */
  135. /* #define FORCE_I6400 */
  136. /* #define FORCE_P6600 */
  137. /* #define FORCE_P5600 */
  138. /* #define FORCE_I6500 */
  139. /* #define FORCE_ITANIUM2 */
  140. /* #define FORCE_SPARC */
  141. /* #define FORCE_SPARCV7 */
  142. /* #define FORCE_ZARCH_GENERIC */
  143. /* #define FORCE_Z13 */
  144. /* #define FORCE_GENERIC */
  145. #ifdef FORCE_P2
  146. #define FORCE
  147. #define FORCE_INTEL
  148. #define ARCHITECTURE "X86"
  149. #define SUBARCHITECTURE "PENTIUM2"
  150. #define ARCHCONFIG "-DPENTIUM2 " \
  151. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  152. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  153. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  154. "-DHAVE_CMOV -DHAVE_MMX"
  155. #define LIBNAME "p2"
  156. #define CORENAME "P5"
  157. #endif
  158. #ifdef FORCE_KATMAI
  159. #define FORCE
  160. #define FORCE_INTEL
  161. #define ARCHITECTURE "X86"
  162. #define SUBARCHITECTURE "PENTIUM3"
  163. #define ARCHCONFIG "-DPENTIUM3 " \
  164. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  165. "-DL2_SIZE=524288 -DL2_LINESIZE=32 " \
  166. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  167. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE "
  168. #define LIBNAME "katmai"
  169. #define CORENAME "KATMAI"
  170. #endif
  171. #ifdef FORCE_COPPERMINE
  172. #define FORCE
  173. #define FORCE_INTEL
  174. #define ARCHITECTURE "X86"
  175. #define SUBARCHITECTURE "PENTIUM3"
  176. #define ARCHCONFIG "-DPENTIUM3 " \
  177. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
  178. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  179. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  180. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE "
  181. #define LIBNAME "coppermine"
  182. #define CORENAME "COPPERMINE"
  183. #endif
  184. #ifdef FORCE_NORTHWOOD
  185. #define FORCE
  186. #define FORCE_INTEL
  187. #define ARCHITECTURE "X86"
  188. #define SUBARCHITECTURE "PENTIUM4"
  189. #define ARCHCONFIG "-DPENTIUM4 " \
  190. "-DL1_DATA_SIZE=8192 -DL1_DATA_LINESIZE=64 " \
  191. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  192. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  193. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  194. #define LIBNAME "northwood"
  195. #define CORENAME "NORTHWOOD"
  196. #endif
  197. #ifdef FORCE_PRESCOTT
  198. #define FORCE
  199. #define FORCE_INTEL
  200. #define ARCHITECTURE "X86"
  201. #define SUBARCHITECTURE "PENTIUM4"
  202. #define ARCHCONFIG "-DPENTIUM4 " \
  203. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  204. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  205. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  206. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3"
  207. #define LIBNAME "prescott"
  208. #define CORENAME "PRESCOTT"
  209. #endif
  210. #ifdef FORCE_BANIAS
  211. #define FORCE
  212. #define FORCE_INTEL
  213. #define ARCHITECTURE "X86"
  214. #define SUBARCHITECTURE "BANIAS"
  215. #define ARCHCONFIG "-DPENTIUMM " \
  216. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  217. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  218. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  219. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  220. #define LIBNAME "banias"
  221. #define CORENAME "BANIAS"
  222. #endif
  223. #ifdef FORCE_YONAH
  224. #define FORCE
  225. #define FORCE_INTEL
  226. #define ARCHITECTURE "X86"
  227. #define SUBARCHITECTURE "YONAH"
  228. #define ARCHCONFIG "-DPENTIUMM " \
  229. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  230. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  231. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  232. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  233. #define LIBNAME "yonah"
  234. #define CORENAME "YONAH"
  235. #endif
  236. #ifdef FORCE_CORE2
  237. #define FORCE
  238. #define FORCE_INTEL
  239. #define ARCHITECTURE "X86"
  240. #define SUBARCHITECTURE "CONRORE"
  241. #define ARCHCONFIG "-DCORE2 " \
  242. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  243. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  244. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 " \
  245. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3"
  246. #define LIBNAME "core2"
  247. #define CORENAME "CORE2"
  248. #endif
  249. #ifdef FORCE_PENRYN
  250. #define FORCE
  251. #define FORCE_INTEL
  252. #define ARCHITECTURE "X86"
  253. #define SUBARCHITECTURE "PENRYN"
  254. #define ARCHCONFIG "-DPENRYN " \
  255. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  256. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  257. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 " \
  258. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1"
  259. #define LIBNAME "penryn"
  260. #define CORENAME "PENRYN"
  261. #endif
  262. #ifdef FORCE_DUNNINGTON
  263. #define FORCE
  264. #define FORCE_INTEL
  265. #define ARCHITECTURE "X86"
  266. #define SUBARCHITECTURE "DUNNINGTON"
  267. #define ARCHCONFIG "-DDUNNINGTON " \
  268. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  269. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  270. "-DL3_SIZE=16777216 -DL3_LINESIZE=64 " \
  271. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 " \
  272. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1"
  273. #define LIBNAME "dunnington"
  274. #define CORENAME "DUNNINGTON"
  275. #endif
  276. #ifdef FORCE_NEHALEM
  277. #define FORCE
  278. #define FORCE_INTEL
  279. #define ARCHITECTURE "X86"
  280. #define SUBARCHITECTURE "NEHALEM"
  281. #define ARCHCONFIG "-DNEHALEM " \
  282. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  283. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  284. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  285. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2"
  286. #define LIBNAME "nehalem"
  287. #define CORENAME "NEHALEM"
  288. #endif
  289. #ifdef FORCE_SANDYBRIDGE
  290. #define FORCE
  291. #define FORCE_INTEL
  292. #define ARCHITECTURE "X86"
  293. #define SUBARCHITECTURE "SANDYBRIDGE"
  294. #define ARCHCONFIG "-DSANDYBRIDGE " \
  295. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  296. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  297. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  298. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX"
  299. #define LIBNAME "sandybridge"
  300. #define CORENAME "SANDYBRIDGE"
  301. #endif
  302. #ifdef FORCE_HASWELL
  303. #define FORCE
  304. #define FORCE_INTEL
  305. #define ARCHITECTURE "X86"
  306. #define SUBARCHITECTURE "HASWELL"
  307. #define ARCHCONFIG "-DHASWELL " \
  308. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  309. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  310. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  311. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  312. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  313. #define LIBNAME "haswell"
  314. #define CORENAME "HASWELL"
  315. #endif
  316. #ifdef FORCE_SKYLAKEX
  317. #ifdef NO_AVX512
  318. #define FORCE
  319. #define FORCE_INTEL
  320. #define ARCHITECTURE "X86"
  321. #define SUBARCHITECTURE "HASWELL"
  322. #define ARCHCONFIG "-DHASWELL " \
  323. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  324. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  325. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  326. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  327. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  328. #define LIBNAME "haswell"
  329. #define CORENAME "HASWELL"
  330. #else
  331. #define FORCE
  332. #define FORCE_INTEL
  333. #define ARCHITECTURE "X86"
  334. #define SUBARCHITECTURE "SKYLAKEX"
  335. #define ARCHCONFIG "-DSKYLAKEX " \
  336. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  337. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  338. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  339. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  340. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3 -DHAVE_AVX512VL -march=skylake-avx512"
  341. #define LIBNAME "skylakex"
  342. #define CORENAME "SKYLAKEX"
  343. #endif
  344. #endif
  345. #ifdef FORCE_COOPERLAKE
  346. #ifdef NO_AVX512
  347. #define FORCE
  348. #define FORCE_INTEL
  349. #define ARCHITECTURE "X86"
  350. #define SUBARCHITECTURE "HASWELL"
  351. #define ARCHCONFIG "-DHASWELL " \
  352. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  353. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  354. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  355. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  356. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  357. #define LIBNAME "haswell"
  358. #define CORENAME "HASWELL"
  359. #else
  360. #define FORCE
  361. #define FORCE_INTEL
  362. #define ARCHITECTURE "X86"
  363. #define SUBARCHITECTURE "COOPERLAKE"
  364. #define ARCHCONFIG "-DCOOPERLAKE " \
  365. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  366. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  367. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  368. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 -DHAVE_AVX " \
  369. "-DHAVE_AVX2 -DHAVE_FMA3 -DFMA3 -DHAVE_AVX512VL -DHAVE_AVX512BF16 -march=cooperlake"
  370. #define LIBNAME "cooperlake"
  371. #define CORENAME "COOPERLAKE"
  372. #endif
  373. #endif
  374. #ifdef FORCE_ATOM
  375. #define FORCE
  376. #define FORCE_INTEL
  377. #define ARCHITECTURE "X86"
  378. #define SUBARCHITECTURE "ATOM"
  379. #define ARCHCONFIG "-DATOM " \
  380. "-DL1_DATA_SIZE=24576 -DL1_DATA_LINESIZE=64 " \
  381. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  382. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  383. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3"
  384. #define LIBNAME "atom"
  385. #define CORENAME "ATOM"
  386. #endif
  387. #ifdef FORCE_ATHLON
  388. #define FORCE
  389. #define FORCE_INTEL
  390. #define ARCHITECTURE "X86"
  391. #define SUBARCHITECTURE "ATHLON"
  392. #define ARCHCONFIG "-DATHLON " \
  393. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  394. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  395. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DHAVE_3DNOW " \
  396. "-DHAVE_3DNOWEX -DHAVE_MMX -DHAVE_SSE "
  397. #define LIBNAME "athlon"
  398. #define CORENAME "ATHLON"
  399. #endif
  400. #ifdef FORCE_OPTERON
  401. #define FORCE
  402. #define FORCE_INTEL
  403. #define ARCHITECTURE "X86"
  404. #define SUBARCHITECTURE "OPTERON"
  405. #define ARCHCONFIG "-DOPTERON " \
  406. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  407. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  408. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DHAVE_3DNOW " \
  409. "-DHAVE_3DNOWEX -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 "
  410. #define LIBNAME "opteron"
  411. #define CORENAME "OPTERON"
  412. #endif
  413. #ifdef FORCE_OPTERON_SSE3
  414. #define FORCE
  415. #define FORCE_INTEL
  416. #define ARCHITECTURE "X86"
  417. #define SUBARCHITECTURE "OPTERON"
  418. #define ARCHCONFIG "-DOPTERON " \
  419. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  420. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  421. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DHAVE_3DNOW " \
  422. "-DHAVE_3DNOWEX -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3"
  423. #define LIBNAME "opteron"
  424. #define CORENAME "OPTERON"
  425. #endif
  426. #if defined(FORCE_BARCELONA) || defined(FORCE_SHANGHAI) || defined(FORCE_ISTANBUL)
  427. #define FORCE
  428. #define FORCE_INTEL
  429. #define ARCHITECTURE "X86"
  430. #define SUBARCHITECTURE "BARCELONA"
  431. #define ARCHCONFIG "-DBARCELONA " \
  432. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  433. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL3_SIZE=2097152 " \
  434. "-DDTB_DEFAULT_ENTRIES=48 -DDTB_SIZE=4096 " \
  435. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 " \
  436. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU"
  437. #define LIBNAME "barcelona"
  438. #define CORENAME "BARCELONA"
  439. #endif
  440. #if defined(FORCE_BOBCAT)
  441. #define FORCE
  442. #define FORCE_INTEL
  443. #define ARCHITECTURE "X86"
  444. #define SUBARCHITECTURE "BOBCAT"
  445. #define ARCHCONFIG "-DBOBCAT " \
  446. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  447. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  448. "-DDTB_DEFAULT_ENTRIES=40 -DDTB_SIZE=4096 " \
  449. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3 " \
  450. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_CFLUSH -DHAVE_CMOV"
  451. #define LIBNAME "bobcat"
  452. #define CORENAME "BOBCAT"
  453. #endif
  454. #if defined (FORCE_BULLDOZER)
  455. #define FORCE
  456. #define FORCE_INTEL
  457. #define ARCHITECTURE "X86"
  458. #define SUBARCHITECTURE "BULLDOZER"
  459. #define ARCHCONFIG "-DBULLDOZER " \
  460. "-DL1_DATA_SIZE=49152 -DL1_DATA_LINESIZE=64 " \
  461. "-DL2_SIZE=1024000 -DL2_LINESIZE=64 -DL3_SIZE=16777216 " \
  462. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 " \
  463. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 " \
  464. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU " \
  465. "-DHAVE_AVX"
  466. #define LIBNAME "bulldozer"
  467. #define CORENAME "BULLDOZER"
  468. #endif
  469. #if defined (FORCE_PILEDRIVER)
  470. #define FORCE
  471. #define FORCE_INTEL
  472. #define ARCHITECTURE "X86"
  473. #define SUBARCHITECTURE "PILEDRIVER"
  474. #define ARCHCONFIG "-DPILEDRIVER " \
  475. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  476. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL3_SIZE=12582912 " \
  477. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  478. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  479. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  480. "-DHAVE_AVX -DHAVE_FMA3"
  481. #define LIBNAME "piledriver"
  482. #define CORENAME "PILEDRIVER"
  483. #endif
  484. #if defined (FORCE_STEAMROLLER)
  485. #define FORCE
  486. #define FORCE_INTEL
  487. #define ARCHITECTURE "X86"
  488. #define SUBARCHITECTURE "STEAMROLLER"
  489. #define ARCHCONFIG "-DSTEAMROLLER " \
  490. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  491. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL3_SIZE=12582912 " \
  492. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  493. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  494. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  495. "-DHAVE_AVX -DHAVE_FMA3"
  496. #define LIBNAME "steamroller"
  497. #define CORENAME "STEAMROLLER"
  498. #endif
  499. #if defined (FORCE_EXCAVATOR)
  500. #define FORCE
  501. #define FORCE_INTEL
  502. #define ARCHITECTURE "X86"
  503. #define SUBARCHITECTURE "EXCAVATOR"
  504. #define ARCHCONFIG "-DEXCAVATOR " \
  505. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  506. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL3_SIZE=12582912 " \
  507. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  508. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  509. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  510. "-DHAVE_AVX -DHAVE_FMA3"
  511. #define LIBNAME "excavator"
  512. #define CORENAME "EXCAVATOR"
  513. #endif
  514. #if defined (FORCE_ZEN)
  515. #define FORCE
  516. #define FORCE_INTEL
  517. #define ARCHITECTURE "X86"
  518. #define SUBARCHITECTURE "ZEN"
  519. #define ARCHCONFIG "-DZEN " \
  520. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  521. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL2_CODE_ASSOCIATIVE=8 " \
  522. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  523. "-DL3_SIZE=16777216 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=8 " \
  524. "-DITB_DEFAULT_ENTRIES=64 -DITB_SIZE=4096 " \
  525. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  526. "-DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 " \
  527. "-DHAVE_SSE4A -DHAVE_MISALIGNSSE -DHAVE_128BITFPU -DHAVE_FASTMOVU -DHAVE_CFLUSH " \
  528. "-DHAVE_AVX -DHAVE_AVX2 -DHAVE_FMA3 -DFMA3"
  529. #define LIBNAME "zen"
  530. #define CORENAME "ZEN"
  531. #endif
  532. #ifdef FORCE_SSE_GENERIC
  533. #define FORCE
  534. #define FORCE_INTEL
  535. #define ARCHITECTURE "X86"
  536. #define SUBARCHITECTURE "GENERIC"
  537. #define ARCHCONFIG "-DGENERIC " \
  538. "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
  539. "-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
  540. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  541. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2"
  542. #define LIBNAME "generic"
  543. #define CORENAME "GENERIC"
  544. #endif
  545. #ifdef FORCE_VIAC3
  546. #define FORCE
  547. #define FORCE_INTEL
  548. #define ARCHITECTURE "X86"
  549. #define SUBARCHITECTURE "VIAC3"
  550. #define ARCHCONFIG "-DVIAC3 " \
  551. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  552. "-DL2_SIZE=65536 -DL2_LINESIZE=32 " \
  553. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 " \
  554. "-DHAVE_MMX -DHAVE_SSE "
  555. #define LIBNAME "viac3"
  556. #define CORENAME "VIAC3"
  557. #endif
  558. #ifdef FORCE_NANO
  559. #define FORCE
  560. #define FORCE_INTEL
  561. #define ARCHITECTURE "X86"
  562. #define SUBARCHITECTURE "NANO"
  563. #define ARCHCONFIG "-DNANO " \
  564. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  565. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 " \
  566. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 " \
  567. "-DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_SSE3 -DHAVE_SSSE3"
  568. #define LIBNAME "nano"
  569. #define CORENAME "NANO"
  570. #endif
  571. #ifdef FORCE_POWER3
  572. #define FORCE
  573. #define ARCHITECTURE "POWER"
  574. #define SUBARCHITECTURE "POWER3"
  575. #define SUBDIRNAME "power"
  576. #define ARCHCONFIG "-DPOWER3 " \
  577. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=128 " \
  578. "-DL2_SIZE=2097152 -DL2_LINESIZE=128 " \
  579. "-DDTB_DEFAULT_ENTRIES=256 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  580. #define LIBNAME "power3"
  581. #define CORENAME "POWER3"
  582. #endif
  583. #ifdef FORCE_POWER4
  584. #define FORCE
  585. #define ARCHITECTURE "POWER"
  586. #define SUBARCHITECTURE "POWER4"
  587. #define SUBDIRNAME "power"
  588. #define ARCHCONFIG "-DPOWER4 " \
  589. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  590. "-DL2_SIZE=1509949 -DL2_LINESIZE=128 " \
  591. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=6 "
  592. #define LIBNAME "power4"
  593. #define CORENAME "POWER4"
  594. #endif
  595. #ifdef FORCE_POWER5
  596. #define FORCE
  597. #define ARCHITECTURE "POWER"
  598. #define SUBARCHITECTURE "POWER5"
  599. #define SUBDIRNAME "power"
  600. #define ARCHCONFIG "-DPOWER5 " \
  601. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  602. "-DL2_SIZE=1509949 -DL2_LINESIZE=128 " \
  603. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=6 "
  604. #define LIBNAME "power5"
  605. #define CORENAME "POWER5"
  606. #endif
  607. #if defined(FORCE_POWER6) || defined(FORCE_POWER7)
  608. #define FORCE
  609. #define ARCHITECTURE "POWER"
  610. #define SUBARCHITECTURE "POWER6"
  611. #define SUBDIRNAME "power"
  612. #define ARCHCONFIG "-DPOWER6 " \
  613. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=128 " \
  614. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  615. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  616. #define LIBNAME "power6"
  617. #define CORENAME "POWER6"
  618. #endif
  619. #if defined(FORCE_POWER8)
  620. #define FORCE
  621. #define ARCHITECTURE "POWER"
  622. #define SUBARCHITECTURE "POWER8"
  623. #define SUBDIRNAME "power"
  624. #define ARCHCONFIG "-DPOWER8 " \
  625. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=128 " \
  626. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  627. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  628. #define LIBNAME "power8"
  629. #define CORENAME "POWER8"
  630. #endif
  631. #if defined(FORCE_POWER9)
  632. #define FORCE
  633. #define ARCHITECTURE "POWER"
  634. #define SUBARCHITECTURE "POWER9"
  635. #define SUBDIRNAME "power"
  636. #define ARCHCONFIG "-DPOWER9 " \
  637. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  638. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  639. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  640. #define LIBNAME "power9"
  641. #define CORENAME "POWER9"
  642. #endif
  643. #if defined(FORCE_POWER10)
  644. #define FORCE
  645. #define ARCHITECTURE "POWER"
  646. #define SUBARCHITECTURE "POWER10"
  647. #define SUBDIRNAME "power"
  648. #define ARCHCONFIG "-DPOWER10 " \
  649. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  650. "-DL2_SIZE=4194304 -DL2_LINESIZE=128 " \
  651. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  652. #define LIBNAME "power10"
  653. #define CORENAME "POWER10"
  654. #endif
  655. #ifdef FORCE_PPCG4
  656. #define FORCE
  657. #define ARCHITECTURE "POWER"
  658. #define SUBARCHITECTURE "PPCG4"
  659. #define SUBDIRNAME "power"
  660. #define ARCHCONFIG "-DPPCG4 " \
  661. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  662. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  663. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  664. #define LIBNAME "ppcg4"
  665. #define CORENAME "PPCG4"
  666. #endif
  667. #ifdef FORCE_PPC970
  668. #define FORCE
  669. #define ARCHITECTURE "POWER"
  670. #define SUBARCHITECTURE "PPC970"
  671. #define SUBDIRNAME "power"
  672. #define ARCHCONFIG "-DPPC970 " \
  673. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  674. "-DL2_SIZE=512488 -DL2_LINESIZE=128 " \
  675. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  676. #define LIBNAME "ppc970"
  677. #define CORENAME "PPC970"
  678. #endif
  679. #ifdef FORCE_PPC970MP
  680. #define FORCE
  681. #define ARCHITECTURE "POWER"
  682. #define SUBARCHITECTURE "PPC970"
  683. #define SUBDIRNAME "power"
  684. #define ARCHCONFIG "-DPPC970 " \
  685. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  686. "-DL2_SIZE=1024976 -DL2_LINESIZE=128 " \
  687. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  688. #define LIBNAME "ppc970mp"
  689. #define CORENAME "PPC970"
  690. #endif
  691. #ifdef FORCE_PPC440
  692. #define FORCE
  693. #define ARCHITECTURE "POWER"
  694. #define SUBARCHITECTURE "PPC440"
  695. #define SUBDIRNAME "power"
  696. #define ARCHCONFIG "-DPPC440 " \
  697. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  698. "-DL2_SIZE=16384 -DL2_LINESIZE=128 " \
  699. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=16 "
  700. #define LIBNAME "ppc440"
  701. #define CORENAME "PPC440"
  702. #endif
  703. #ifdef FORCE_PPC440FP2
  704. #define FORCE
  705. #define ARCHITECTURE "POWER"
  706. #define SUBARCHITECTURE "PPC440FP2"
  707. #define SUBDIRNAME "power"
  708. #define ARCHCONFIG "-DPPC440FP2 " \
  709. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  710. "-DL2_SIZE=16384 -DL2_LINESIZE=128 " \
  711. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=16 "
  712. #define LIBNAME "ppc440FP2"
  713. #define CORENAME "PPC440FP2"
  714. #endif
  715. #ifdef FORCE_CELL
  716. #define FORCE
  717. #define ARCHITECTURE "POWER"
  718. #define SUBARCHITECTURE "CELL"
  719. #define SUBDIRNAME "power"
  720. #define ARCHCONFIG "-DCELL " \
  721. "-DL1_DATA_SIZE=262144 -DL1_DATA_LINESIZE=128 " \
  722. "-DL2_SIZE=512488 -DL2_LINESIZE=128 " \
  723. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  724. #define LIBNAME "cell"
  725. #define CORENAME "CELL"
  726. #endif
  727. #ifdef FORCE_SICORTEX
  728. #define FORCE
  729. #define ARCHITECTURE "MIPS"
  730. #define SUBARCHITECTURE "SICORTEX"
  731. #define SUBDIRNAME "mips"
  732. #define ARCHCONFIG "-DSICORTEX " \
  733. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  734. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  735. "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  736. #define LIBNAME "mips"
  737. #define CORENAME "sicortex"
  738. #endif
  739. #ifdef FORCE_LOONGSON3A
  740. #define FORCE
  741. #define ARCHITECTURE "MIPS"
  742. #define SUBARCHITECTURE "LOONGSON3A"
  743. #define SUBDIRNAME "mips64"
  744. #define ARCHCONFIG "-DLOONGSON3A " \
  745. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  746. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  747. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  748. #define LIBNAME "loongson3a"
  749. #define CORENAME "LOONGSON3A"
  750. #else
  751. #endif
  752. #ifdef FORCE_LOONGSON3B
  753. #define FORCE
  754. #define ARCHITECTURE "MIPS"
  755. #define SUBARCHITECTURE "LOONGSON3B"
  756. #define SUBDIRNAME "mips64"
  757. #define ARCHCONFIG "-DLOONGSON3B " \
  758. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  759. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  760. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  761. #define LIBNAME "loongson3b"
  762. #define CORENAME "LOONGSON3B"
  763. #else
  764. #endif
  765. #ifdef FORCE_I6400
  766. #define FORCE
  767. #define ARCHITECTURE "MIPS"
  768. #define SUBARCHITECTURE "I6400"
  769. #define SUBDIRNAME "mips64"
  770. #define ARCHCONFIG "-DI6400 " \
  771. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  772. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  773. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  774. #define LIBNAME "i6400"
  775. #define CORENAME "I6400"
  776. #else
  777. #endif
  778. #ifdef FORCE_P6600
  779. #define FORCE
  780. #define ARCHITECTURE "MIPS"
  781. #define SUBARCHITECTURE "P6600"
  782. #define SUBDIRNAME "mips64"
  783. #define ARCHCONFIG "-DP6600 " \
  784. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  785. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  786. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  787. #define LIBNAME "p6600"
  788. #define CORENAME "P6600"
  789. #else
  790. #endif
  791. #ifdef FORCE_P5600
  792. #define FORCE
  793. #define ARCHITECTURE "MIPS"
  794. #define SUBARCHITECTURE "P5600"
  795. #define SUBDIRNAME "mips"
  796. #define ARCHCONFIG "-DP5600 " \
  797. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  798. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  799. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  800. #define LIBNAME "p5600"
  801. #define CORENAME "P5600"
  802. #else
  803. #endif
  804. #ifdef FORCE_MIPS1004K
  805. #define FORCE
  806. #define ARCHITECTURE "MIPS"
  807. #define SUBARCHITECTURE "MIPS1004K"
  808. #define SUBDIRNAME "mips"
  809. #define ARCHCONFIG "-DMIPS1004K " \
  810. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  811. "-DL2_SIZE=262144 -DL2_LINESIZE=32 " \
  812. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  813. #define LIBNAME "mips1004K"
  814. #define CORENAME "MIPS1004K"
  815. #else
  816. #endif
  817. #ifdef FORCE_MIPS24K
  818. #define FORCE
  819. #define ARCHITECTURE "MIPS"
  820. #define SUBARCHITECTURE "MIPS24K"
  821. #define SUBDIRNAME "mips"
  822. #define ARCHCONFIG "-DMIPS24K " \
  823. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  824. "-DL2_SIZE=32768 -DL2_LINESIZE=32 " \
  825. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  826. #define LIBNAME "mips24K"
  827. #define CORENAME "MIPS24K"
  828. #else
  829. #endif
  830. #ifdef FORCE_I6500
  831. #define FORCE
  832. #define ARCHITECTURE "MIPS"
  833. #define SUBARCHITECTURE "I6500"
  834. #define SUBDIRNAME "mips64"
  835. #define ARCHCONFIG "-DI6500 " \
  836. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  837. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  838. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  839. #define LIBNAME "i6500"
  840. #define CORENAME "I6500"
  841. #else
  842. #endif
  843. #ifdef FORCE_ITANIUM2
  844. #define FORCE
  845. #define ARCHITECTURE "IA64"
  846. #define SUBARCHITECTURE "ITANIUM2"
  847. #define SUBDIRNAME "ia64"
  848. #define ARCHCONFIG "-DITANIUM2 " \
  849. "-DL1_DATA_SIZE=262144 -DL1_DATA_LINESIZE=128 " \
  850. "-DL2_SIZE=1572864 -DL2_LINESIZE=128 -DDTB_SIZE=16384 -DDTB_DEFAULT_ENTRIES=128 "
  851. #define LIBNAME "itanium2"
  852. #define CORENAME "itanium2"
  853. #endif
  854. #ifdef FORCE_SPARC
  855. #define FORCE
  856. #define ARCHITECTURE "SPARC"
  857. #define SUBARCHITECTURE "SPARC"
  858. #define SUBDIRNAME "sparc"
  859. #define ARCHCONFIG "-DSPARC -DV9 " \
  860. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  861. "-DL2_SIZE=1572864 -DL2_LINESIZE=64 -DDTB_SIZE=8192 -DDTB_DEFAULT_ENTRIES=64 "
  862. #define LIBNAME "sparc"
  863. #define CORENAME "sparc"
  864. #endif
  865. #ifdef FORCE_SPARCV7
  866. #define FORCE
  867. #define ARCHITECTURE "SPARC"
  868. #define SUBARCHITECTURE "SPARC"
  869. #define SUBDIRNAME "sparc"
  870. #define ARCHCONFIG "-DSPARC -DV7 " \
  871. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 " \
  872. "-DL2_SIZE=1572864 -DL2_LINESIZE=64 -DDTB_SIZE=8192 -DDTB_DEFAULT_ENTRIES=64 "
  873. #define LIBNAME "sparcv7"
  874. #define CORENAME "sparcv7"
  875. #endif
  876. #ifdef FORCE_GENERIC
  877. #define FORCE
  878. #define ARCHITECTURE "GENERIC"
  879. #define SUBARCHITECTURE "GENERIC"
  880. #define SUBDIRNAME "generic"
  881. #define ARCHCONFIG "-DGENERIC " \
  882. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  883. "-DL2_SIZE=512488 -DL2_LINESIZE=128 " \
  884. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
  885. #define LIBNAME "generic"
  886. #define CORENAME "generic"
  887. #endif
  888. #ifdef FORCE_ARMV7
  889. #define FORCE
  890. #define ARCHITECTURE "ARM"
  891. #define SUBARCHITECTURE "ARMV7"
  892. #define SUBDIRNAME "arm"
  893. #define ARCHCONFIG "-DARMV7 " \
  894. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  895. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  896. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  897. "-DHAVE_VFPV3 -DHAVE_VFP"
  898. #define LIBNAME "armv7"
  899. #define CORENAME "ARMV7"
  900. #else
  901. #endif
  902. #ifdef FORCE_CORTEXA9
  903. #define FORCE
  904. #define ARCHITECTURE "ARM"
  905. #define SUBARCHITECTURE "CORTEXA9"
  906. #define SUBDIRNAME "arm"
  907. #define ARCHCONFIG "-DCORTEXA9 -DARMV7 " \
  908. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  909. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  910. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  911. "-DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON"
  912. #define LIBNAME "cortexa9"
  913. #define CORENAME "CORTEXA9"
  914. #else
  915. #endif
  916. #ifdef FORCE_CORTEXA15
  917. #define FORCE
  918. #define ARCHITECTURE "ARM"
  919. #define SUBARCHITECTURE "CORTEXA15"
  920. #define SUBDIRNAME "arm"
  921. #define ARCHCONFIG "-DCORTEXA15 -DARMV7 " \
  922. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
  923. "-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
  924. "-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  925. "-DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON"
  926. #define LIBNAME "cortexa15"
  927. #define CORENAME "CORTEXA15"
  928. #else
  929. #endif
  930. #ifdef FORCE_ARMV6
  931. #define FORCE
  932. #define ARCHITECTURE "ARM"
  933. #define SUBARCHITECTURE "ARMV6"
  934. #define SUBDIRNAME "arm"
  935. #define ARCHCONFIG "-DARMV6 " \
  936. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  937. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  938. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 " \
  939. "-DHAVE_VFP"
  940. #define LIBNAME "armv6"
  941. #define CORENAME "ARMV6"
  942. #else
  943. #endif
  944. #ifdef FORCE_ARMV5
  945. #define FORCE
  946. #define ARCHITECTURE "ARM"
  947. #define SUBARCHITECTURE "ARMV5"
  948. #define SUBDIRNAME "arm"
  949. #define ARCHCONFIG "-DARMV5 " \
  950. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=32 " \
  951. "-DL2_SIZE=512488 -DL2_LINESIZE=32 " \
  952. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
  953. #define LIBNAME "armv5"
  954. #define CORENAME "ARMV5"
  955. #else
  956. #endif
  957. #ifdef FORCE_ARMV8
  958. #define FORCE
  959. #define ARCHITECTURE "ARM64"
  960. #define SUBARCHITECTURE "ARMV8"
  961. #define SUBDIRNAME "arm64"
  962. #define ARCHCONFIG "-DARMV8 " \
  963. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  964. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  965. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  966. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  967. #define LIBNAME "armv8"
  968. #define CORENAME "ARMV8"
  969. #endif
  970. #ifdef FORCE_CORTEXA53
  971. #define FORCE
  972. #define ARCHITECTURE "ARM64"
  973. #define SUBARCHITECTURE "CORTEXA53"
  974. #define SUBDIRNAME "arm64"
  975. #define ARCHCONFIG "-DCORTEXA53 " \
  976. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  977. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  978. "-DL2_SIZE=262144 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  979. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  980. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  981. #define LIBNAME "cortexa53"
  982. #define CORENAME "CORTEXA53"
  983. #else
  984. #endif
  985. #ifdef FORCE_CORTEXA57
  986. #define FORCE
  987. #define ARCHITECTURE "ARM64"
  988. #define SUBARCHITECTURE "CORTEXA57"
  989. #define SUBDIRNAME "arm64"
  990. #define ARCHCONFIG "-DCORTEXA57 " \
  991. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  992. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  993. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  994. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  995. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  996. #define LIBNAME "cortexa57"
  997. #define CORENAME "CORTEXA57"
  998. #else
  999. #endif
  1000. #ifdef FORCE_CORTEXA72
  1001. #define FORCE
  1002. #define ARCHITECTURE "ARM64"
  1003. #define SUBARCHITECTURE "CORTEXA72"
  1004. #define SUBDIRNAME "arm64"
  1005. #define ARCHCONFIG "-DCORTEXA72 " \
  1006. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1007. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1008. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1009. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1010. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1011. #define LIBNAME "cortexa72"
  1012. #define CORENAME "CORTEXA72"
  1013. #else
  1014. #endif
  1015. #ifdef FORCE_CORTEXA73
  1016. #define FORCE
  1017. #define ARCHITECTURE "ARM64"
  1018. #define SUBARCHITECTURE "CORTEXA73"
  1019. #define SUBDIRNAME "arm64"
  1020. #define ARCHCONFIG "-DCORTEXA73 " \
  1021. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1022. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1023. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1024. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1025. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1026. #define LIBNAME "cortexa73"
  1027. #define CORENAME "CORTEXA73"
  1028. #else
  1029. #endif
  1030. #ifdef FORCE_NEOVERSEN1
  1031. #define FORCE
  1032. #define ARCHITECTURE "ARM64"
  1033. #define SUBARCHITECTURE "NEOVERSEN1"
  1034. #define SUBDIRNAME "arm64"
  1035. #define ARCHCONFIG "-DNEOVERSEN1 " \
  1036. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1037. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1038. "-DL2_SIZE=1048576 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1039. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1040. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8 " \
  1041. "-march=armv8.2-a -mtune=cortex-a72"
  1042. #define LIBNAME "neoversen1"
  1043. #define CORENAME "NEOVERSEN1"
  1044. #else
  1045. #endif
  1046. #ifdef FORCE_FALKOR
  1047. #define FORCE
  1048. #define ARCHITECTURE "ARM64"
  1049. #define SUBARCHITECTURE "FALKOR"
  1050. #define SUBDIRNAME "arm64"
  1051. #define ARCHCONFIG "-DFALKOR " \
  1052. "-DL1_CODE_SIZE=49152 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=3 " \
  1053. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=2 " \
  1054. "-DL2_SIZE=2097152 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=16 " \
  1055. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1056. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1057. #define LIBNAME "falkor"
  1058. #define CORENAME "FALKOR"
  1059. #else
  1060. #endif
  1061. #ifdef FORCE_THUNDERX
  1062. #define FORCE
  1063. #define ARCHITECTURE "ARM64"
  1064. #define SUBARCHITECTURE "THUNDERX"
  1065. #define SUBDIRNAME "arm64"
  1066. #define ARCHCONFIG "-DTHUNDERX " \
  1067. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=128 " \
  1068. "-DL2_SIZE=16777216 -DL2_LINESIZE=128 -DL2_ASSOCIATIVE=16 " \
  1069. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1070. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1071. #define LIBNAME "thunderx"
  1072. #define CORENAME "THUNDERX"
  1073. #else
  1074. #endif
  1075. #ifdef FORCE_THUNDERX2T99
  1076. #define ARMV8
  1077. #define FORCE
  1078. #define ARCHITECTURE "ARM64"
  1079. #define SUBARCHITECTURE "THUNDERX2T99"
  1080. #define SUBDIRNAME "arm64"
  1081. #define ARCHCONFIG "-DTHUNDERX2T99 " \
  1082. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1083. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1084. "-DL2_SIZE=262144 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1085. "-DL3_SIZE=33554432 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=32 " \
  1086. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1087. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1088. #define LIBNAME "thunderx2t99"
  1089. #define CORENAME "THUNDERX2T99"
  1090. #else
  1091. #endif
  1092. #ifdef FORCE_TSV110
  1093. #define FORCE
  1094. #define ARCHITECTURE "ARM64"
  1095. #define SUBARCHITECTURE "TSV110"
  1096. #define SUBDIRNAME "arm64"
  1097. #define ARCHCONFIG "-DTSV110 " \
  1098. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=4 " \
  1099. "-DL1_DATA_SIZE=65536 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=4 " \
  1100. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1101. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1102. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1103. #define LIBNAME "tsv110"
  1104. #define CORENAME "TSV110"
  1105. #else
  1106. #endif
  1107. #ifdef FORCE_EMAG8180
  1108. #define ARMV8
  1109. #define FORCE
  1110. #define ARCHITECTURE "ARM64"
  1111. #define SUBARCHITECTURE "EMAG8180"
  1112. #define SUBDIRNAME "arm64"
  1113. #define ARCHCONFIG "-DEMAG8180 " \
  1114. "-DL1_CODE_SIZE=32768 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1115. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1116. "-DL2_SIZE=262144 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1117. "-DL3_SIZE=33554432 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=32 " \
  1118. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1119. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1120. #define LIBNAME "emag8180"
  1121. #define CORENAME "EMAG8180"
  1122. #endif
  1123. #ifdef FORCE_THUNDERX3T110
  1124. #define ARMV8
  1125. #define FORCE
  1126. #define ARCHITECTURE "ARM64"
  1127. #define SUBARCHITECTURE "THUNDERX3T110"
  1128. #define SUBDIRNAME "arm64"
  1129. #define ARCHCONFIG "-DTHUNDERX3T110 " \
  1130. "-DL1_CODE_SIZE=65536 -DL1_CODE_LINESIZE=64 -DL1_CODE_ASSOCIATIVE=8 " \
  1131. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 -DL1_DATA_ASSOCIATIVE=8 " \
  1132. "-DL2_SIZE=524288 -DL2_LINESIZE=64 -DL2_ASSOCIATIVE=8 " \
  1133. "-DL3_SIZE=94371840 -DL3_LINESIZE=64 -DL3_ASSOCIATIVE=32 " \
  1134. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 " \
  1135. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1136. #define LIBNAME "thunderx3t110"
  1137. #define CORENAME "THUNDERX3T110"
  1138. #else
  1139. #endif
  1140. #ifdef FORCE_VORTEX
  1141. #define FORCE
  1142. #define ARCHITECTURE "ARM64"
  1143. #define SUBARCHITECTURE "VORTEX"
  1144. #define SUBDIRNAME "arm64"
  1145. #define ARCHCONFIG "-DVORTEX " \
  1146. "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
  1147. "-DL2_SIZE=262144 -DL2_LINESIZE=64 " \
  1148. "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=32 " \
  1149. "-DHAVE_VFPV4 -DHAVE_VFPV3 -DHAVE_VFP -DHAVE_NEON -DARMV8"
  1150. #define LIBNAME "vortex"
  1151. #define CORENAME "VORTEX"
  1152. #endif
  1153. #ifdef FORCE_ZARCH_GENERIC
  1154. #define FORCE
  1155. #define ARCHITECTURE "ZARCH"
  1156. #define SUBARCHITECTURE "ZARCH_GENERIC"
  1157. #define ARCHCONFIG "-DZARCH_GENERIC " \
  1158. "-DDTB_DEFAULT_ENTRIES=64"
  1159. #define LIBNAME "zarch_generic"
  1160. #define CORENAME "ZARCH_GENERIC"
  1161. #endif
  1162. #ifdef FORCE_Z13
  1163. #define FORCE
  1164. #define ARCHITECTURE "ZARCH"
  1165. #define SUBARCHITECTURE "Z13"
  1166. #define ARCHCONFIG "-DZ13 " \
  1167. "-DDTB_DEFAULT_ENTRIES=64"
  1168. #define LIBNAME "z13"
  1169. #define CORENAME "Z13"
  1170. #endif
  1171. #ifdef FORCE_Z14
  1172. #define FORCE
  1173. #define ARCHITECTURE "ZARCH"
  1174. #define SUBARCHITECTURE "Z14"
  1175. #define ARCHCONFIG "-DZ14 " \
  1176. "-DDTB_DEFAULT_ENTRIES=64"
  1177. #define LIBNAME "z14"
  1178. #define CORENAME "Z14"
  1179. #endif
  1180. #ifndef FORCE
  1181. #ifdef USER_TARGET
  1182. #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
  1183. #endif
  1184. #if defined(__powerpc__) || defined(__powerpc) || defined(powerpc) || \
  1185. defined(__PPC__) || defined(PPC) || defined(_POWER) || defined(__POWERPC__)
  1186. #ifndef POWER
  1187. #define POWER
  1188. #endif
  1189. #define OPENBLAS_SUPPORTED
  1190. #endif
  1191. #if defined(__zarch__) || defined(__s390x__)
  1192. #define ZARCH
  1193. #include "cpuid_zarch.c"
  1194. #define OPENBLAS_SUPPORTED
  1195. #endif
  1196. #ifdef INTEL_AMD
  1197. #include "cpuid_x86.c"
  1198. #define OPENBLAS_SUPPORTED
  1199. #endif
  1200. #ifdef __ia64__
  1201. #include "cpuid_ia64.c"
  1202. #define OPENBLAS_SUPPORTED
  1203. #endif
  1204. #ifdef __alpha
  1205. #include "cpuid_alpha.c"
  1206. #define OPENBLAS_SUPPORTED
  1207. #endif
  1208. #ifdef POWER
  1209. #include "cpuid_power.c"
  1210. #define OPENBLAS_SUPPORTED
  1211. #endif
  1212. #ifdef sparc
  1213. #include "cpuid_sparc.c"
  1214. #define OPENBLAS_SUPPORTED
  1215. #endif
  1216. #ifdef __mips__
  1217. #ifdef __mips64
  1218. #include "cpuid_mips64.c"
  1219. #else
  1220. #include "cpuid_mips.c"
  1221. #endif
  1222. #define OPENBLAS_SUPPORTED
  1223. #endif
  1224. #ifdef __arm__
  1225. #include "cpuid_arm.c"
  1226. #define OPENBLAS_SUPPORTED
  1227. #endif
  1228. #ifdef __aarch64__
  1229. #include "cpuid_arm64.c"
  1230. #define OPENBLAS_SUPPORTED
  1231. #endif
  1232. #ifndef OPENBLAS_SUPPORTED
  1233. #error "This arch/CPU is not supported by OpenBLAS."
  1234. #endif
  1235. #else
  1236. #endif
  1237. static int get_num_cores(void) {
  1238. #ifdef OS_WINDOWS
  1239. SYSTEM_INFO sysinfo;
  1240. #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
  1241. int m[2], count;
  1242. size_t len;
  1243. #endif
  1244. #if defined(linux) || defined(__sun__)
  1245. //returns the number of processors which are currently online
  1246. return sysconf(_SC_NPROCESSORS_CONF);
  1247. #elif defined(OS_WINDOWS)
  1248. GetSystemInfo(&sysinfo);
  1249. return sysinfo.dwNumberOfProcessors;
  1250. #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
  1251. m[0] = CTL_HW;
  1252. m[1] = HW_NCPU;
  1253. len = sizeof(int);
  1254. sysctl(m, 2, &count, &len, NULL, 0);
  1255. return count;
  1256. #elif defined(AIX)
  1257. //returns the number of processors which are currently online
  1258. return sysconf(_SC_NPROCESSORS_ONLN);
  1259. #else
  1260. return 2;
  1261. #endif
  1262. }
  1263. int main(int argc, char *argv[]){
  1264. #ifdef FORCE
  1265. char buffer[8192], *p, *q;
  1266. int length;
  1267. #endif
  1268. if (argc == 1) return 0;
  1269. switch (argv[1][0]) {
  1270. case '0' : /* for Makefile */
  1271. #ifdef FORCE
  1272. printf("CORE=%s\n", CORENAME);
  1273. #else
  1274. #if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc)
  1275. printf("CORE=%s\n", get_corename());
  1276. #endif
  1277. #endif
  1278. #ifdef FORCE
  1279. printf("LIBCORE=%s\n", LIBNAME);
  1280. #else
  1281. printf("LIBCORE=");
  1282. get_libname();
  1283. printf("\n");
  1284. #endif
  1285. printf("NUM_CORES=%d\n", get_num_cores());
  1286. #if defined(__arm__)
  1287. #if !defined(FORCE)
  1288. fprintf(stderr,"get features!\n");
  1289. get_features();
  1290. #else
  1291. fprintf(stderr,"split archconfig!\n");
  1292. sprintf(buffer, "%s", ARCHCONFIG);
  1293. p = &buffer[0];
  1294. while (*p) {
  1295. if ((*p == '-') && (*(p + 1) == 'D')) {
  1296. p += 2;
  1297. if (*p != 'H') {
  1298. while( (*p != ' ') && (*p != '-') && (*p != '\0') && (*p != '\n')) {p++; }
  1299. if (*p == '-') continue;
  1300. }
  1301. while ((*p != ' ') && (*p != '\0')) {
  1302. if (*p == '=') {
  1303. printf("=");
  1304. p ++;
  1305. while ((*p != ' ') && (*p != '\0')) {
  1306. printf("%c", *p);
  1307. p ++;
  1308. }
  1309. } else {
  1310. printf("%c", *p);
  1311. p ++;
  1312. if ((*p == ' ') || (*p =='\0')) printf("=1\n");
  1313. }
  1314. }
  1315. } else p ++;
  1316. }
  1317. #endif
  1318. #endif
  1319. #ifdef INTEL_AMD
  1320. #ifndef FORCE
  1321. get_sse();
  1322. #else
  1323. sprintf(buffer, "%s", ARCHCONFIG);
  1324. p = &buffer[0];
  1325. while (*p) {
  1326. if ((*p == '-') && (*(p + 1) == 'D')) {
  1327. p += 2;
  1328. while ((*p != ' ') && (*p != '\0')) {
  1329. if (*p == '=') {
  1330. printf("=");
  1331. p ++;
  1332. while ((*p != ' ') && (*p != '\0')) {
  1333. printf("%c", *p);
  1334. p ++;
  1335. }
  1336. } else {
  1337. printf("%c", *p);
  1338. p ++;
  1339. if ((*p == ' ') || (*p =='\0')) printf("=1");
  1340. }
  1341. }
  1342. printf("\n");
  1343. } else p ++;
  1344. }
  1345. #endif
  1346. #endif
  1347. #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  1348. printf("__BYTE_ORDER__=__ORDER_BIG_ENDIAN__\n");
  1349. #elif defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ > 0
  1350. printf("__BYTE_ORDER__=__ORDER_BIG_ENDIAN__\n");
  1351. #endif
  1352. #if defined(_CALL_ELF) && (_CALL_ELF == 2)
  1353. printf("ELF_VERSION=2\n");
  1354. #endif
  1355. #ifdef MAKE_NB_JOBS
  1356. #if MAKE_NB_JOBS > 0
  1357. printf("MAKE += -j %d\n", MAKE_NB_JOBS);
  1358. #else
  1359. // Let make use parent -j argument or -j1 if there
  1360. // is no make parent
  1361. #endif
  1362. #elif NO_PARALLEL_MAKE==1
  1363. printf("MAKE += -j 1\n");
  1364. #else
  1365. printf("MAKE += -j %d\n", get_num_cores());
  1366. #endif
  1367. break;
  1368. case '1' : /* For config.h */
  1369. #ifdef FORCE
  1370. sprintf(buffer, "%s -DCORE_%s\n", ARCHCONFIG, CORENAME);
  1371. p = &buffer[0];
  1372. while (*p) {
  1373. if ((*p == '-') && (*(p + 1) == 'D')) {
  1374. p += 2;
  1375. printf("#define ");
  1376. while ((*p != ' ') && (*p != '\0')) {
  1377. if (*p == '=') {
  1378. printf(" ");
  1379. p ++;
  1380. while ((*p != ' ') && (*p != '\0')) {
  1381. printf("%c", *p);
  1382. p ++;
  1383. }
  1384. } else {
  1385. if (*p != '\n')
  1386. printf("%c", *p);
  1387. p ++;
  1388. }
  1389. }
  1390. printf("\n");
  1391. } else p ++;
  1392. }
  1393. #else
  1394. get_cpuconfig();
  1395. #endif
  1396. #ifdef FORCE
  1397. printf("#define CHAR_CORENAME \"%s\"\n", CORENAME);
  1398. #else
  1399. #if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc)
  1400. printf("#define CHAR_CORENAME \"%s\"\n", get_corename());
  1401. #endif
  1402. #endif
  1403. break;
  1404. case '2' : /* SMP */
  1405. if (get_num_cores() > 1) printf("SMP=1\n");
  1406. break;
  1407. }
  1408. fflush(stdout);
  1409. return 0;
  1410. }