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

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