Skip to content

Commit a03ed06

Browse files
committed
Wire up alpha in new build system
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1 parent 50c4eeb commit a03ed06

File tree

3 files changed

+57
-31
lines changed

3 files changed

+57
-31
lines changed

Makefile.alpha

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,24 @@
1-
CPP = $(CC) -E
2-
RANLIB = ranlib
3-
4-
ifeq ($(LIBSUBARCH), EV4)
5-
LIBNAME = $(LIBPREFIX)_ev4.a
6-
LIBNAME_P = $(LIBPREFIX)_ev4_p.a
7-
endif
8-
9-
ifeq ($(LIBSUBARCH), EV5)
10-
LIBNAME = $(LIBPREFIX)_ev5.a
11-
LIBNAME_P = $(LIBPREFIX)_ev5_p.a
12-
endif
13-
14-
ifeq ($(LIBSUBARCH), EV6)
15-
LIBNAME = $(LIBPREFIX)_ev6.a
16-
LIBNAME_P = $(LIBPREFIX)_ev6_p.a
17-
endif
18-
191
ifneq ($(COMPILER), NATIVE)
202
# GCC User
21-
ifeq ($(LIBSUBARCH), EV4)
22-
OPTION += -DEV4 -mcpu=ev4
3+
ifeq ($(CORE), EV4)
4+
CCOMMON_OPT += -mcpu=ev4
235
endif
24-
ifeq ($(LIBSUBARCH), EV5)
25-
OPTION += -DEV5 -mcpu=ev5
6+
ifeq ($(CORE), EV5)
7+
CCOMMON_OPT += -mcpu=ev5
268
endif
27-
ifeq ($(LIBSUBARCH), EV6)
28-
OPTION += -DEV6 -mcpu=ev6
9+
ifeq ($(CORE), EV6)
10+
CCOMMON_OPT += -mcpu=ev6
2911
endif
3012
else
3113
# Compaq Compiler User
32-
ifeq ($(LIBSUBARCH), EV4)
33-
OPTION += -DEV4 -tune ev4 -arch ev4
14+
ifeq ($(CORE), EV4)
15+
CCOMMON_OPT += -tune ev4 -arch ev4
3416
endif
35-
ifeq ($(LIBSUBARCH), EV5)
36-
OPTION += -DEV5 -tune ev5 -arch ev5
17+
ifeq ($(CORE), EV5)
18+
CCOMMON_OPT += -tune ev5 -arch ev5
3719
endif
38-
ifeq ($(LIBSUBARCH), EV6)
39-
OPTION += -DEV6 -tune ev6 -arch ev6
20+
ifeq ($(CORE), EV6)
21+
CCOMMON_OPT += -tune ev6 -arch ev6
4022
endif
4123
endif
4224

cpuid_alpha.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ void get_subarchitecture(void){
5959
printf("ev%d", implver() + 4);
6060
}
6161

62+
63+
void get_corename(void){
64+
printf("EV%d", implver() + 4);
65+
}
66+
6267
void get_subdirname(void){
6368
printf("alpha");
6469
}

getarch.c

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146146
/* #define FORCE_SPARCV7 */
147147
/* #define FORCE_ZARCH_GENERIC */
148148
/* #define FORCE_Z13 */
149+
/* #define FORCE_EV4 */
150+
/* #define FORCE_EV5 */
151+
/* #define FORCE_EV6 */
149152
/* #define FORCE_GENERIC */
150153

151154
#ifdef FORCE_P2
@@ -1601,6 +1604,42 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16011604
#define CORENAME "Z14"
16021605
#endif
16031606

1607+
#ifdef FORCE_EV4
1608+
#define FORCE
1609+
#define ARCHITECTURE "ALPHA"
1610+
#define SUBARCHITECTURE "ev4"
1611+
#define ARCHCONFIG "-DEV4 " \
1612+
"-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
1613+
"-DL2_SIZE=2097152 -DL2_LINESIZE=32 " \
1614+
"-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=8192 "
1615+
#define LIBNAME "ev4"
1616+
#define CORENAME "EV4"
1617+
#endif
1618+
1619+
#ifdef FORCE_EV5
1620+
#define FORCE
1621+
#define ARCHITECTURE "ALPHA"
1622+
#define SUBARCHITECTURE "ev5"
1623+
#define ARCHCONFIG "-DEV5 " \
1624+
"-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \
1625+
"-DL2_SIZE=2097152 -DL2_LINESIZE=64 " \
1626+
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=8192 "
1627+
#define LIBNAME "ev5"
1628+
#define CORENAME "EV5"
1629+
#endif
1630+
1631+
#ifdef FORCE_EV6
1632+
#define FORCE
1633+
#define ARCHITECTURE "ALPHA"
1634+
#define SUBARCHITECTURE "ev6"
1635+
#define ARCHCONFIG "-DEV6 " \
1636+
"-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \
1637+
"-DL2_SIZE=4194304 -DL2_LINESIZE=64 " \
1638+
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=8192 "
1639+
#define LIBNAME "ev6"
1640+
#define CORENAME "EV6"
1641+
#endif
1642+
16041643
#ifdef FORCE_C910V
16051644
#define FORCE
16061645
#define ARCHITECTURE "RISCV64"
@@ -1777,7 +1816,7 @@ int main(int argc, char *argv[]){
17771816
#ifdef FORCE
17781817
printf("CORE=%s\n", CORENAME);
17791818
#else
1780-
#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv)
1819+
#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv) || defined(__alpha__)
17811820
printf("CORE=%s\n", get_corename());
17821821
#endif
17831822
#endif

0 commit comments

Comments
 (0)