Skip to content

Commit 1833a67

Browse files
authored
Add support for a user-defined list of dynamic targets
1 parent 0b2b83d commit 1833a67

File tree

1 file changed

+139
-0
lines changed

1 file changed

+139
-0
lines changed

driver/others/dynamic.c

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,127 @@
4949
#define EXTERN
5050
#endif
5151

52+
#ifdef DYNAMIC_LIST
53+
extern gotoblas_t gotoblas_PRESCOTT;
54+
55+
#ifdef DYN_ATHLON
56+
extern gotoblas_t gotoblas_ATHLON;
57+
#else
58+
#define gotoblas_ATHLON gotoblas_PRESCOTT
59+
#endif
60+
#ifdef DYN_KATMAI
61+
extern gotoblas_t gotoblas_KATMAI;
62+
#else
63+
#define gotoblas_KATMAI gotoblas_PRESCOTT
64+
#endif
65+
#ifdef DYN_BANIAS
66+
extern gotoblas_t gotoblas_BANIAS;
67+
#else
68+
#define gotoblas_BANIAS gotoblas_PRESCOTT
69+
#endif
70+
#ifdef DYN_COPPERMINE
71+
extern gotoblas_t gotoblas_COPPERMINE;
72+
#else
73+
#define gotoblas_COPPERMINE gotoblas_PRESCOTT
74+
#endif
75+
#ifdef DYN_NORTHWOOD
76+
extern gotoblas_t gotoblas_NORTHWOOD;
77+
#else
78+
#define gotoblas_NORTHWOOD gotoblas_PRESCOTT
79+
#endif
80+
#ifdef DYN_CORE2
81+
extern gotoblas_t gotoblas_CORE2;
82+
#else
83+
#define gotoblas_CORE2 gotoblas_PRESCOTT
84+
#endif
85+
#ifdef DYN_NEHALEM
86+
extern gotoblas_t gotoblas_NEHALEM;
87+
#else
88+
#define gotoblas_NEHALEM gotoblas_PRESCOTT
89+
#endif
90+
#ifdef DYN_BARCELONA
91+
extern gotoblas_t gotoblas_BARCELONA;
92+
#else
93+
#define gotoblas_BARCELONA gotoblas_PRESCOTT
94+
#endif
95+
#ifdef DYN_ATOM
96+
extern gotoblas_t gotoblas_ATOM;
97+
#else
98+
#define gotoblas_ATOM gotoblas_PRESCOTT
99+
#endif
100+
#ifdef DYN_NANO
101+
extern gotoblas_t gotoblas_NANO;
102+
#else
103+
#define gotoblas_NANO gotoblas_PRESCOTT
104+
#endif
105+
#ifdef DYN_PENRYN
106+
extern gotoblas_t gotoblas_PENRYN;
107+
#else
108+
#define gotoblas_PENRYN gotoblas_PRESCOTT
109+
#endif
110+
#ifdef DYN_DUNNINGTON
111+
extern gotoblas_t gotoblas_DUNNINGTON;
112+
#else
113+
#define gotoblas_DUNNINGTON gotoblas_PRESCOTT
114+
#endif
115+
#ifdef DYN_OPTERON
116+
extern gotoblas_t gotoblas_OPTERON;
117+
#else
118+
#define gotoblas_OPTERON gotoblas_PRESCOTT
119+
#endif
120+
#ifdef DYN_OPTERON_SSE3
121+
extern gotoblas_t gotoblas_OPTERON_SSE3;
122+
#else
123+
#define gotoblas_OPTERON_SSE3 gotoblas_PRESCOTT
124+
#endif
125+
#ifdef DYN_BOBCAT
126+
extern gotoblas_t gotoblas_BOBCAT;
127+
#else
128+
#define gotoblas_BOBCAT gotoblas_PRESCOTT
129+
#endif
130+
#ifdef DYN_SANDYBRIDGE
131+
extern gotoblas_t gotoblas_SANDYBRIDGE;
132+
#else
133+
#define gotoblas_SANDYBRIDGE gotoblas_PRESCOTT
134+
#endif
135+
#ifdef DYN_BULLDOZER
136+
extern gotoblas_t gotoblas_BULLDOZER;
137+
#else
138+
#define gotoblas_BULLDOZER gotoblas_PRESCOTT
139+
#endif
140+
#ifdef DYN_PILEDRIVER
141+
extern gotoblas_t gotoblas_PILEDRIVER;
142+
#else
143+
#define gotoblas_PILEDRIVER gotoblas_PRESCOTT
144+
#endif
145+
#ifdef DYN_STEAMROLLER
146+
extern gotoblas_t gotoblas_STEAMROLLER;
147+
#else
148+
#define gotoblas_STEAMROLLER gotoblas_PRESCOTT
149+
#endif
150+
#ifdef DYN_EXCAVATOR
151+
extern gotoblas_t gotoblas_EXCAVATOR;
152+
#else
153+
#define gotoblas_EXCAVATOR gotoblas_PRESCOTT
154+
#endif
155+
#ifdef DYN_HASWELL
156+
extern gotoblas_t gotoblas_HASWELL;
157+
#else
158+
#define gotoblas_HASWELL gotoblas_PRESCOTT
159+
#endif
160+
#ifdef DYN_ZEN
161+
extern gotoblas_t gotoblas_ZEN;
162+
#else
163+
#define gotoblas_ZEN gotoblas_PRESCOTT
164+
#endif
165+
#ifdef DYN_SKYLAKEX
166+
extern gotoblas_t gotoblas_SKYLAKEX;
167+
#else
168+
#define gotoblas_SKYLAKEX gotoblas_PRESCOTT
169+
#endif
170+
171+
172+
#else // not DYNAMIC_LIST
52173
EXTERN gotoblas_t gotoblas_KATMAI;
53174
EXTERN gotoblas_t gotoblas_COPPERMINE;
54175
EXTERN gotoblas_t gotoblas_NORTHWOOD;
@@ -108,6 +229,7 @@ extern gotoblas_t gotoblas_SKYLAKEX;
108229
#define gotoblas_ZEN gotoblas_BARCELONA
109230
#endif
110231

232+
#endif // DYNAMIC_LIST
111233

112234
#define VENDOR_INTEL 1
113235
#define VENDOR_AMD 2
@@ -338,6 +460,23 @@ static gotoblas_t *get_coretype(void){
338460
return &gotoblas_NEHALEM;
339461
}
340462
return NULL;
463+
case 6:
464+
if (model == 6) {
465+
// Cannon Lake
466+
#ifndef NO_AVX512
467+
return &gotoblas_SKYLAKEX;
468+
#else
469+
if(support_avx())
470+
#ifndef NO_AVX2
471+
return &gotoblas_HASWELL;
472+
#else
473+
return &gotblas_SANDYBRIDGE;
474+
#endif
475+
else
476+
return &gotoblas_NEHALEM;
477+
#endif
478+
}
479+
return NULL;
341480
case 9:
342481
case 8:
343482
if (model == 14 ) { // Kaby Lake

0 commit comments

Comments
 (0)