From 981ec8d2aac5cac76bdedd4015b6d32447b29597 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 20 Jan 2020 22:56:47 +0100 Subject: [PATCH] Remove support for de-facto dead archs. --- src/Makefile | 3 --- src/host/buildvm_asm.c | 11 ----------- src/host/buildvm_peobj.c | 15 +-------------- src/lj_arch.h | 6 ++---- src/vm_ppc.dasc | 1 - 5 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/Makefile b/src/Makefile index 386f279f..1777cbe6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -461,9 +461,6 @@ ifeq (ppc,$(TARGET_LJARCH)) ifeq (PS3,$(TARGET_SYS)) DASM_AFLAGS+= -D PPE -D TOC endif - ifneq (,$(findstring LJ_ARCH_PPC64 ,$(TARGET_TESTARCH))) - DASM_ARCH= ppc64 - endif endif endif endif diff --git a/src/host/buildvm_asm.c b/src/host/buildvm_asm.c index 43595b31..85ce79f9 100644 --- a/src/host/buildvm_asm.c +++ b/src/host/buildvm_asm.c @@ -144,14 +144,6 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n, fprintf(ctx->fp, "\t%s %d, %d, " TOCPREFIX "%s\n", (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym); } else if ((ins >> 26) == 18) { -#if LJ_ARCH_PPC64 - const char *suffix = strchr(sym, '@'); - if (suffix && suffix[1] == 'h') { - fprintf(ctx->fp, "\taddis 11, 2, %s\n", sym); - } else if (suffix && suffix[1] == 'l') { - fprintf(ctx->fp, "\tld 12, %s\n", sym); - } else -#endif fprintf(ctx->fp, "\t%s " TOCPREFIX "%s\n", (ins & 1) ? "bl" : "b", sym); } else { fprintf(stderr, @@ -250,9 +242,6 @@ void emit_asm(BuildCtx *ctx) int i, rel; fprintf(ctx->fp, "\t.file \"buildvm_%s.dasc\"\n", ctx->dasm_arch); -#if LJ_ARCH_PPC64 - fprintf(ctx->fp, "\t.abiversion 2\n"); -#endif fprintf(ctx->fp, "\t.text\n"); emit_asm_align(ctx, 4); diff --git a/src/host/buildvm_peobj.c b/src/host/buildvm_peobj.c index 2eb2bb7b..280ea8d2 100644 --- a/src/host/buildvm_peobj.c +++ b/src/host/buildvm_peobj.c @@ -9,7 +9,7 @@ #include "buildvm.h" #include "lj_bc.h" -#if LJ_TARGET_X86ORX64 || LJ_TARGET_PPC +#if LJ_TARGET_X86ORX64 /* Context for PE object emitter. */ static char *strtab; @@ -93,12 +93,6 @@ typedef struct PEsymaux { #define PEOBJ_RELOC_ADDR32NB 0x03 #define PEOBJ_RELOC_OFS 0 #define PEOBJ_TEXT_FLAGS 0x60500020 /* 60=r+x, 50=align16, 20=code. */ -#elif LJ_TARGET_PPC -#define PEOBJ_ARCH_TARGET 0x01f2 -#define PEOBJ_RELOC_REL32 0x06 -#define PEOBJ_RELOC_DIR32 0x02 -#define PEOBJ_RELOC_OFS (-4) -#define PEOBJ_TEXT_FLAGS 0x60400020 /* 60=r+x, 40=align8, 20=code. */ #endif /* Section numbers (0-based). */ @@ -251,15 +245,8 @@ void emit_peobj(BuildCtx *ctx) /* Write .text section. */ host_endian.u = 1; if (host_endian.b != LJ_ENDIAN_SELECT(1, 0)) { -#if LJ_TARGET_PPC - uint32_t *p = (uint32_t *)ctx->code; - int n = (int)(ctx->codesz >> 2); - for (i = 0; i < n; i++, p++) - *p = lj_bswap(*p); /* Byteswap .text section. */ -#else fprintf(stderr, "Error: different byte order for host and target\n"); exit(1); -#endif } owrite(ctx, ctx->code, ctx->codesz); for (i = 0; i < ctx->nreloc; i++) { diff --git a/src/lj_arch.h b/src/lj_arch.h index cd1a0568..d561917b 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h @@ -296,9 +296,7 @@ #define LJ_ARCH_PPC32ON64 1 #define LJ_ARCH_NOFFI 1 #elif LJ_ARCH_BITS == 64 -#define LJ_ARCH_PPC64 1 -#define LJ_TARGET_GC64 1 -#define LJ_ARCH_NOJIT 1 /* NYI */ +#error "No support for PPC64" #endif #if _ARCH_PWR7 @@ -465,7 +463,7 @@ #error "No support for ILP32 model on ARM64" #endif #elif LJ_TARGET_PPC -#if !LJ_ARCH_PPC64 && (defined(_LITTLE_ENDIAN) && (!defined(_BYTE_ORDER) || (_BYTE_ORDER == _LITTLE_ENDIAN))) +#if defined(_LITTLE_ENDIAN) && (!defined(_BYTE_ORDER) || (_BYTE_ORDER == _LITTLE_ENDIAN)) #error "No support for little-endian PPC32" #endif #if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT) diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc index 0839668c..51543397 100644 --- a/src/vm_ppc.dasc +++ b/src/vm_ppc.dasc @@ -18,7 +18,6 @@ |// DynASM defines used by the PPC port: |// |// P64 64 bit pointers (only for GPR64 testing). -|// Note: see vm_ppc64.dasc for a full PPC64 _LP64 port. |// GPR64 64 bit registers (but possibly 32 bit pointers, e.g. PS3). |// Affects reg saves, stack layout, carry/overflow/dot flags etc. |// FRAME32 Use 32 bit frame layout, even with GPR64 (Xbox 360).