From 2315613b3835fc0b89601a1fc2e72fffa1857b35 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 15 Nov 2016 13:50:15 -0500 Subject: [PATCH] Fix some s390x declarations. s/S390x/S390X/ --- Makefile | 2 +- src/Makefile | 3 ++- src/lj_arch.h | 29 +++++++++++++++++++---------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 6dfbbde4..6d1a8127 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ FILE_PC= luajit.pc FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \ dis_x86.lua dis_x64.lua dis_arm.lua dis_ppc.lua \ - dis_mips.lua dis_mipsel.lua vmdef.lua + dis_mips.lua dis_mipsel.lua dis_s390x.lua vmdef.lua ifeq (,$(findstring Windows,$(OS))) HOST_SYS:= $(shell uname -s) diff --git a/src/Makefile b/src/Makefile index 40cd1015..1450adc0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -238,7 +238,7 @@ else ifneq (,$(findstring LJ_TARGET_ARM ,$(TARGET_TESTARCH))) TARGET_LJARCH= arm else -ifneq (,$(findstring LJ_TARGET_S390x ,$(TARGET_TESTARCH))) +ifneq (,$(findstring LJ_TARGET_S390X ,$(TARGET_TESTARCH))) TARGET_LJARCH= s390x else ifneq (,$(findstring LJ_TARGET_ARM64 ,$(TARGET_TESTARCH))) @@ -269,6 +269,7 @@ endif endif endif endif +endif ifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH))) TARGET_SYS= PS3 diff --git a/src/lj_arch.h b/src/lj_arch.h index 2638a941..f699e90c 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h @@ -29,7 +29,8 @@ #define LUAJIT_ARCH_mips32 6 #define LUAJIT_ARCH_MIPS64 7 #define LUAJIT_ARCH_mips64 7 -#define LUAJIT_ARCH_S390x 8 +#define LUAJIT_ARCH_S390X 8 +#define LUAJIT_ARCH_s390x 8 /* Target OS. */ #define LUAJIT_OS_OTHER 0 @@ -50,8 +51,8 @@ #define LUAJIT_TARGET LUAJIT_ARCH_ARM #elif defined(__aarch64__) #define LUAJIT_TARGET LUAJIT_ARCH_ARM64 -#elif defined(__s390x__) || defined(__s390x) || defined(__S390x__) || defined(__S390x) || defined(S390x) -#define LUAJIT_TARGET LUAJIT_ARCH_S390x +#elif defined(__s390x__) || defined(__s390x) +#define LUAJIT_TARGET LUAJIT_ARCH_S390X #elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC) #define LUAJIT_TARGET LUAJIT_ARCH_PPC #elif defined(__mips64__) || defined(__mips64) || defined(__MIPS64__) || defined(__MIPS64) @@ -233,13 +234,6 @@ #define LJ_ARCH_VERSION 80 -#elif LUAJIT_TARGET == LUAJIT_ARCH_S390 - - #define LJ_ARCH_NAME "s390x" - #define LJ_ARCH_BITS 64 - #define LJ_ARCH_ENDIAN LUAJIT_BE - #define LJ_TARGET_S390 1 - #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC #ifndef LJ_ARCH_ENDIAN @@ -362,6 +356,21 @@ #define LJ_ARCH_VERSION 10 #endif +#elif LUAJIT_TARGET == LUAJIT_ARCH_S390X + +#define LJ_ARCH_NAME "s390x" +#define LJ_ARCH_BITS 64 +#define LJ_ARCH_ENDIAN LUAJIT_BE +#define LJ_TARGET_S390X 1 +#define LJ_TARGET_EHRETREG 0 +#define LJ_TARGET_JUMPRANGE 32 /* +-2^32 = +-4GB (32-bit, halfword aligned) */ +#define LJ_TARGET_MASKSHIFT 1 +#define LJ_TARGET_MASKROT 1 +#define LJ_TARGET_UNALIGNED 1 +#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL +#define LJ_TARGET_GC64 1 +#define LJ_ARCH_NOJIT 1 /* NYI */ + #else #error "No target architecture defined" #endif