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