From a03ed065e1d693642732f9135cdd9cbe70b8cb1b Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Thu, 11 Aug 2022 14:51:57 +0100 Subject: [PATCH] Wire up alpha in new build system Signed-off-by: Jiaxun Yang --- Makefile.alpha | 42 ++++++++++++------------------------------ cpuid_alpha.c | 5 +++++ getarch.c | 41 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/Makefile.alpha b/Makefile.alpha index bd4f4d58b..97e4d757e 100644 --- a/Makefile.alpha +++ b/Makefile.alpha @@ -1,42 +1,24 @@ -CPP = $(CC) -E -RANLIB = ranlib - -ifeq ($(LIBSUBARCH), EV4) -LIBNAME = $(LIBPREFIX)_ev4.a -LIBNAME_P = $(LIBPREFIX)_ev4_p.a -endif - -ifeq ($(LIBSUBARCH), EV5) -LIBNAME = $(LIBPREFIX)_ev5.a -LIBNAME_P = $(LIBPREFIX)_ev5_p.a -endif - -ifeq ($(LIBSUBARCH), EV6) -LIBNAME = $(LIBPREFIX)_ev6.a -LIBNAME_P = $(LIBPREFIX)_ev6_p.a -endif - ifneq ($(COMPILER), NATIVE) # GCC User -ifeq ($(LIBSUBARCH), EV4) -OPTION += -DEV4 -mcpu=ev4 +ifeq ($(CORE), EV4) +CCOMMON_OPT += -mcpu=ev4 endif -ifeq ($(LIBSUBARCH), EV5) -OPTION += -DEV5 -mcpu=ev5 +ifeq ($(CORE), EV5) +CCOMMON_OPT += -mcpu=ev5 endif -ifeq ($(LIBSUBARCH), EV6) -OPTION += -DEV6 -mcpu=ev6 +ifeq ($(CORE), EV6) +CCOMMON_OPT += -mcpu=ev6 endif else # Compaq Compiler User -ifeq ($(LIBSUBARCH), EV4) -OPTION += -DEV4 -tune ev4 -arch ev4 +ifeq ($(CORE), EV4) +CCOMMON_OPT += -tune ev4 -arch ev4 endif -ifeq ($(LIBSUBARCH), EV5) -OPTION += -DEV5 -tune ev5 -arch ev5 +ifeq ($(CORE), EV5) +CCOMMON_OPT += -tune ev5 -arch ev5 endif -ifeq ($(LIBSUBARCH), EV6) -OPTION += -DEV6 -tune ev6 -arch ev6 +ifeq ($(CORE), EV6) +CCOMMON_OPT += -tune ev6 -arch ev6 endif endif diff --git a/cpuid_alpha.c b/cpuid_alpha.c index 58dccdefc..e0e019af2 100644 --- a/cpuid_alpha.c +++ b/cpuid_alpha.c @@ -59,6 +59,11 @@ void get_subarchitecture(void){ printf("ev%d", implver() + 4); } + +void get_corename(void){ + printf("EV%d", implver() + 4); +} + void get_subdirname(void){ printf("alpha"); } diff --git a/getarch.c b/getarch.c index 7761551ea..403f3ef7b 100644 --- a/getarch.c +++ b/getarch.c @@ -146,6 +146,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* #define FORCE_SPARCV7 */ /* #define FORCE_ZARCH_GENERIC */ /* #define FORCE_Z13 */ +/* #define FORCE_EV4 */ +/* #define FORCE_EV5 */ +/* #define FORCE_EV6 */ /* #define FORCE_GENERIC */ #ifdef FORCE_P2 @@ -1601,6 +1604,42 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define CORENAME "Z14" #endif +#ifdef FORCE_EV4 +#define FORCE +#define ARCHITECTURE "ALPHA" +#define SUBARCHITECTURE "ev4" +#define ARCHCONFIG "-DEV4 " \ + "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \ + "-DL2_SIZE=2097152 -DL2_LINESIZE=32 " \ + "-DDTB_DEFAULT_ENTRIES=32 -DDTB_SIZE=8192 " +#define LIBNAME "ev4" +#define CORENAME "EV4" +#endif + +#ifdef FORCE_EV5 +#define FORCE +#define ARCHITECTURE "ALPHA" +#define SUBARCHITECTURE "ev5" +#define ARCHCONFIG "-DEV5 " \ + "-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=32 " \ + "-DL2_SIZE=2097152 -DL2_LINESIZE=64 " \ + "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=8192 " +#define LIBNAME "ev5" +#define CORENAME "EV5" +#endif + +#ifdef FORCE_EV6 +#define FORCE +#define ARCHITECTURE "ALPHA" +#define SUBARCHITECTURE "ev6" +#define ARCHCONFIG "-DEV6 " \ + "-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=64 " \ + "-DL2_SIZE=4194304 -DL2_LINESIZE=64 " \ + "-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=8192 " +#define LIBNAME "ev6" +#define CORENAME "EV6" +#endif + #ifdef FORCE_C910V #define FORCE #define ARCHITECTURE "RISCV64" @@ -1777,7 +1816,7 @@ int main(int argc, char *argv[]){ #ifdef FORCE printf("CORE=%s\n", CORENAME); #else -#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv) +#if defined(INTEL_AMD) || defined(POWER) || defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(ZARCH) || defined(sparc) || defined(__loongarch__) || defined(__riscv) || defined(__alpha__) printf("CORE=%s\n", get_corename()); #endif #endif