From 54cd65e47f514c9136194a29c3e68c700452bccc Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Mon, 13 Aug 2012 15:25:08 +0800 Subject: [PATCH] Use sandy bridge kernel when DYNAMIC_ARCH=1. --- Makefile | 2 +- driver/others/dynamic.c | 37 +++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c152488bc..d95373086 100644 --- a/Makefile +++ b/Makefile @@ -231,7 +231,7 @@ ifndef NOFORTRAN -@echo "LAPACKLIB_P = ../$(LIBNAME_P)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "SUFFIX = $(SUFFIX)" >> $(NETLIB_LAPACK_DIR)/make.inc -@echo "PSUFFIX = $(PSUFFIX)" >> $(NETLIB_LAPACK_DIR)/make.inc -# -@echo "CEXTRALIB = $(CEXTRALIB)" >> $(NETLIB_LAPACK_DIR)/make.inc + -@echo "CEXTRALIB = $(EXTRALIB)" >> $(NETLIB_LAPACK_DIR)/make.inc -@cat make.inc >> $(NETLIB_LAPACK_DIR)/make.inc endif diff --git a/driver/others/dynamic.c b/driver/others/dynamic.c index 0364d0374..aa4b867fd 100644 --- a/driver/others/dynamic.c +++ b/driver/others/dynamic.c @@ -60,6 +60,8 @@ extern gotoblas_t gotoblas_NEHALEM; extern gotoblas_t gotoblas_OPTERON; extern gotoblas_t gotoblas_OPTERON_SSE3; extern gotoblas_t gotoblas_BARCELONA; +extern gotoblas_t gotoblas_SANDYBRIDGE; +extern gotoblas_t gotoblas_BOBCAT; #define VENDOR_INTEL 1 #define VENDOR_AMD 2 @@ -122,15 +124,24 @@ static gotoblas_t *get_coretype(void){ if (model == 12) return &gotoblas_ATOM; return NULL; - case 2: - //Intel Core (Clarkdale) / Core (Arrandale) - // Pentium (Clarkdale) / Pentium Mobile (Arrandale) - // Xeon (Clarkdale), 32nm - if (model == 5) return &gotoblas_NEHALEM; + case 2: + //Intel Core (Clarkdale) / Core (Arrandale) + // Pentium (Clarkdale) / Pentium Mobile (Arrandale) + // Xeon (Clarkdale), 32nm + if (model == 5) return &gotoblas_NEHALEM; - //Intel Xeon Processor 5600 (Westmere-EP) - if (model == 12) return &gotoblas_NEHALEM; - return NULL; + //Intel Xeon Processor 5600 (Westmere-EP) + //Xeon Processor E7 (Westmere-EX) + if (model == 12 || model == 15) return &gotoblas_NEHALEM; + + //Intel Core i5-2000 /i7-2000 (Sandy Bridge) + //Intel Core i7-3000 / Xeon E5 + if (model == 10 || model == 13) return &gotoblas_SANDYBRIDGE; + return NULL; + case 3: + //Intel Sandy Bridge 22nm (Ivy Bridge?) + if (model == 10) return &gotoblas_SANDYBRIDGE; + return NULL; } case 0xf: if (model <= 0x2) return &gotoblas_NORTHWOOD; @@ -144,7 +155,9 @@ static gotoblas_t *get_coretype(void){ if ((exfamily == 0) || (exfamily == 2)) { if (ecx & (1 << 0)) return &gotoblas_OPTERON_SSE3; else return &gotoblas_OPTERON; - } else { + } else if (exfamily == 5) { + return &gotoblas_BOBCAT; + } else { return &gotoblas_BARCELONA; } } @@ -178,6 +191,8 @@ static char *corename[] = { "Opteron(SSE3)", "Barcelona", "Nano", + "Sandybridge", + "Bobcat", }; char *gotoblas_corename(void) { @@ -197,7 +212,9 @@ char *gotoblas_corename(void) { if (gotoblas == &gotoblas_OPTERON) return corename[13]; if (gotoblas == &gotoblas_BARCELONA) return corename[14]; if (gotoblas == &gotoblas_NANO) return corename[15]; - + if (gotoblas == &gotoblas_SANDYBRIDGE) return corename[16]; + if (gotoblas == &gotoblas_BOBCAT) return corename[17]; + return corename[0]; }